[llama32_1b] int4-AWQ RMS + Q/K/V GEMV + RoPE multi-launch decode ELF #4385
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test with AIE tools on Ryzen AI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| # A PR number if a pull request and otherwise the commit hash. This cancels | |
| # queued and in-progress runs for the same PR (presubmit) or commit | |
| # (postsubmit). | |
| group: ci-build-test-ryzenai-${{ github.event.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| XILINXD_LICENSE_FILE: /opt/xilinx/Xilinx.lic | |
| VITIS: /opt/ryzen_ai-1.3.0.1/vitis_aie_essentials | |
| jobs: | |
| build-repo: | |
| name: Build and Test with AIE tools on Ryzen AI | |
| runs-on: ${{ matrix.runner_type }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner_type: [ amd8845hs, amdhx370 ] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: "true" | |
| - name: Setup environment | |
| run: | | |
| python3.12 -m venv air-venv | |
| source air-venv/bin/activate | |
| pip cache purge | |
| pip install --upgrade pip | |
| pip install lit cmake joblib | |
| pip install --pre torch-mlir torchvision \ | |
| --index-url https://download.pytorch.org/whl/nightly/cpu \ | |
| -f https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels | |
| - name: Get mlir-aie | |
| id: clone-mlir-aie | |
| run: | | |
| utils/clone-mlir-aie.sh | |
| source air-venv/bin/activate | |
| pushd mlir-aie | |
| pip install -r python/requirements.txt | |
| pip install -r python/requirements_ml.txt | |
| pip install -r python/requirements_dev.txt | |
| VERSION=$(utils/clone-llvm.sh --get-wheel-version) | |
| pip -q download mlir==$VERSION \ | |
| -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro | |
| unzip -q mlir-*.whl | |
| find mlir -exec touch -a -m -t 201108231405.14 {} \; | |
| popd | |
| - name: Install mlir-aie from wheel | |
| run: | | |
| source air-venv/bin/activate | |
| MLIR_AIE_VERSION=$(utils/clone-mlir-aie.sh --get-wheel-version) | |
| pip install mlir_aie==$MLIR_AIE_VERSION \ | |
| -f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/latest-wheels-3/ | |
| - name: Get llvm-aie | |
| run: | | |
| source air-venv/bin/activate | |
| python3 -m pip install --upgrade --force-reinstall llvm-aie -f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly | |
| - name: Build and test mlir-air | |
| run: | | |
| source air-venv/bin/activate | |
| export PATH=$VITIS/bin:$VITIS/aietools/bin:$PATH | |
| source /opt/xilinx/xrt/setup.sh | |
| WHL_MLIR_DIR=$(pwd)/mlir-aie/mlir | |
| MLIR_AIE_INSTALL_DIR="$(python3 -m pip show mlir_aie | grep ^Location: | awk '{print $2}')/mlir_aie" | |
| PEANO_INSTALL_DIR=$(python3 -m pip show llvm-aie | grep ^Location: | awk '{print $2}')/llvm-aie | |
| CMAKEMODULES_DIR=$(pwd)/mlir-aie/cmake/modulesXilinx | |
| mkdir -p build_assert | |
| pushd build_assert | |
| sudo prlimit -lunlimited --pid $$ | |
| cmake .. \ | |
| -GNinja \ | |
| -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
| -DLLVM_ENABLE_ASSERTIONS=ON \ | |
| -DPython3_EXECUTABLE=$(which python) \ | |
| -DCMAKE_INSTALL_PREFIX=$PWD/../install \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
| -DCMAKE_C_COMPILER=clang \ | |
| -DCMAKE_CXX_COMPILER=clang++ \ | |
| -DCMAKE_ASM_COMPILER=clang \ | |
| -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
| -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
| -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \ | |
| -DCMAKE_MODULE_PATH=${CMAKEMODULES_DIR}/ \ | |
| -DLLVM_EXTERNAL_LIT=$(which lit) \ | |
| -DLLVM_DIR=${WHL_MLIR_DIR}/lib/cmake/llvm \ | |
| -DMLIR_DIR=${WHL_MLIR_DIR}/lib/cmake/mlir \ | |
| -DAIE_DIR=${MLIR_AIE_INSTALL_DIR}/lib/cmake/aie \ | |
| -Dx86_64_TOOLCHAIN_FILE=$PWD/../cmake/modules/toolchain_x86_64.cmake \ | |
| -DAIR_RUNTIME_TARGETS:STRING="x86_64" \ | |
| -DXRT_ROOT=/opt/xilinx/xrt \ | |
| -DENABLE_RUN_XRT_TESTS=ON \ | |
| -DPEANO_INSTALL_DIR=${PEANO_INSTALL_DIR} | |
| ninja install | |
| pip install $PWD/../python/spensor | |
| export LIT_OPTS="-sv --time-tests --show-unsupported --show-excluded --order random --timeout 600 -j8" | |
| ninja check-air-cpp | |
| ninja check-air-mlir | |
| ninja check-air-python | |
| # E2E test set 1: peano tests (retry once on failure for flaky NPU tests) | |
| ninja check-air-e2e-peano || ninja check-air-e2e-peano | |
| # Chess tests disabled to reduce CI time. Uncomment to re-enable: | |
| # ninja check-air-e2e-chess | |
| # Programming examples set 1: peano tests (retry once on failure for flaky NPU tests) | |
| ninja check-programming-examples-peano || ninja check-programming-examples-peano | |
| # Chess tests disabled to reduce CI time. Uncomment to re-enable: | |
| # ninja check-programming-examples-chess | |
| # AIR-Runner test set | |
| ninja check-air-runner | |
| popd | |
| rm -rf build_assert |