Skip to content

Commit

Permalink
Update .gitmodules
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Sep 2, 2024
1 parent fc2dee4 commit ad11611
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 33 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,22 @@ jobs:
run: |
/gitmirror/scripts/trigger_update_mirrors.sh
/gitmirror/scripts/git_config.sh
- name: "Checking out repository"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
submodules: recursive
- name: "Checking out repository"
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_ADDRESS: ${{ github.server_url }}/${{ github.repository }}
run: |
git \
-c submodule."third_party/torch-mlir".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."src/runtime_src/core/common/aiebu".update=none \
clone \
--recursive \
--shallow-submodules \
--depth 1 \
-b $BRANCH_NAME $REPO_ADDRESS .
- name: Install deps
run: |
dnf install -y almalinux-release-devel epel-release
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,19 @@ jobs:
timezoneWindows: "Singapore Standard Time"

- name: "Checking out repository"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
submodules: recursive
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_ADDRESS: ${{ github.server_url }}/${{ github.repository }}
run: |
git \
-c submodule."third_party/torch-mlir".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."src/runtime_src/core/common/aiebu".update=none \
clone \
--recursive \
--shallow-submodules \
--depth 1 \
-b $BRANCH_NAME $REPO_ADDRESS .
- uses: actions/setup-python@v4
with:
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@ jobs:
timezoneWindows: "Singapore Standard Time"

- name: "Checking out repository"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
submodules: recursive
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
REPO_ADDRESS: ${{ github.server_url }}/${{ github.repository }}
run: |
git \
-c submodule."third_party/torch-mlir".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."src/runtime_src/core/common/aiebu".update=none \
clone \
--recursive \
--shallow-submodules \
--depth 1 \
-b $BRANCH_NAME $REPO_ADDRESS .
- name: Setup Cpp
uses: aminya/setup-cpp@v1
Expand Down
8 changes: 0 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,3 @@
path = third_party/iree
url = https://github.com/iree-org/iree.git
shallow = true
[submodule "third_party/stablehlo"]
path = third_party/iree/third_party/stablehlo
url = https://github.com/iree-org/stablehlo.git
update = none
[submodule "third_party/torch-mlir"]
path = third_party/iree/third_party/torch-mlir
url = https://github.com/iree-org/torch-mlir.git
update = none
58 changes: 43 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,46 @@ interfacing the AMD AIE accelerator to IREE.

## Developer Setup

These instructions assume that you have an appropriate IREE checkout side by side
with this repository have an IREE build setup in an `iree-build` directory that
is also a sibling. This is not a requirement, but instructions will need to be
changed for different paths.
**Strong recommendation**: check the CI scripts @ [.github/workflows](.github/workflows) - they do a fresh/clean
checkout and build and are exercised on every commit *and* are written such that they're simple enough to be read
by even a non-CI expert.

Preparing repository:
### Getting the repository:

Either

```
git submodule update --init --recursive
# ssh
git clone --recursive [email protected]:nod-ai/iree-amd-aie.git
# https
git clone --recursive https://github.com/nod-ai/iree-amd-aie.git
```

or if you want a faster checkout

```
git \
-c submodule."third_party/torch-mlir".update=none \
-c submodule."third_party/stablehlo".update=none \
-c submodule."src/runtime_src/core/common/aiebu".update=none \
clone \
--recursive \
--depth 1 \
--shallow-submodules \
https://github.com/nod-ai/iree-amd-aie.git
```

which has the effect of not cloning entire repo histories *and* skipping nested submodules that we currently do not need.

## Building (along with IREE)

### Just show me the CMake

From the checkout of the repo:

```
cmake -B $WHERE_YOU_WOULD_LIKE_TO_BUILD -S $IREE_REPO_SRC_DIR \
-DIREE_CMAKE_PLUGIN_PATHS=$IREE_AMD_AIE_REPO_SRC_DIR -DIREE_BUILD_PYTHON_BINDINGS=ON \
cmake -B $WHERE_YOU_WOULD_LIKE_TO_BUILD -S third_party/iree \
-DIREE_CMAKE_PLUGIN_PATHS=$PWD -DIREE_BUILD_PYTHON_BINDINGS=ON \
-DIREE_INPUT_STABLEHLO=OFF -DIREE_INPUT_TORCH=OFF -DIREE_INPUT_TOSA=OFF \
-DIREE_HAL_DRIVER_DEFAULTS=OFF -DIREE_TARGET_BACKEND_DEFAULTS=OFF -DIREE_TARGET_BACKEND_LLVM_CPU=ON \
-DIREE_BUILD_TESTS=ON -DIREE_EXTERNAL_HAL_DRIVERS=xrt \
Expand All @@ -43,9 +65,12 @@ cmake -B $WHERE_YOU_WOULD_LIKE_TO_BUILD -S $IREE_REPO_SRC_DIR \
The bare minimum CMake configure command is

```
cd ../iree-build
cmake -DIREE_BUILD_PYTHON_BINDINGS=ON -DIREE_CMAKE_PLUGIN_PATHS=$PWD/../iree-amd-aie .
ninja
cmake \
-B $WHERE_YOU_WOULD_LIKE_TO_BUILD \
-S $IREE_REPO_SRC_DIR \
-DIREE_CMAKE_PLUGIN_PATHS=$IREE_AMD_AIE_REPO_SRC_DIR \
-DIREE_BUILD_PYTHON_BINDINGS=ON
cmake --build $WHERE_YOU_WOULD_LIKE_TO_BUILD
```

to build IREE with amd-aie plugin. Very likely, you will want to use `ccache` and `lld` (or some other modern linker like [mold](https://github.com/rui314/mold))
Expand Down Expand Up @@ -88,10 +113,13 @@ ctest -R amd-aie
To enable the runtime driver, you need to also enable the XRT HAL:

```
cd ../iree-build
cmake . -DIREE_CMAKE_PLUGIN_PATHS=../iree-amd-aie \
-DIREE_EXTERNAL_HAL_DRIVERS=xrt
ninja
cmake \
-B $WHERE_YOU_WOULD_LIKE_TO_BUILD \
-S $IREE_REPO_SRC_DIR \
-DIREE_CMAKE_PLUGIN_PATHS=$IREE_AMD_AIE_REPO_SRC_DIR \
-DIREE_BUILD_PYTHON_BINDINGS=ON \
-DIREE_EXTERNAL_HAL_DRIVERS=xrt
cmake --build $WHERE_YOU_WOULD_LIKE_TO_BUILD
```

### Ubuntu Dependencies
Expand Down

0 comments on commit ad11611

Please sign in to comment.