From 8974d20ba809b5bc9d0245c8f1d602438a88fb93 Mon Sep 17 00:00:00 2001 From: makslevental Date: Fri, 18 Oct 2024 15:49:57 -0400 Subject: [PATCH] remove WERROR hack and add `run_all_runtime_tests.sh` --- .github/workflows/ci-linux.yml | 5 --- README.md | 1 + build_tools/build_test_cpp.ps1 | 2 - build_tools/build_test_cpp.sh | 2 - build_tools/ci/run_all_runtime_tests.sh | 52 +++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 9 deletions(-) create mode 100755 build_tools/ci/run_all_runtime_tests.sh diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index cdc8705db..756d622db 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -59,11 +59,6 @@ jobs: pip install -r third_party/iree/runtime/bindings/python/iree/runtime/build_requirements.txt pip install pyyaml - - name: Peano dep - run: | - bash build_tools/download_peano.sh - echo "PEANO_INSTALL_DIR=$PWD/llvm-aie" >> $GITHUB_ENV - - name: Enable cache uses: actions/cache/restore@v3 with: diff --git a/README.md b/README.md index 18c7cbe92..c6bbe5c1f 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ ctest -R amd-aie --output-on-failure -j 10 (the `-j 10` runs `10` tests in parallel) Other tests, which run on device, are in the `build_tools` subdirectory. +See [build_tools/ci/run_all_runtime_tests.sh](build_tools/ci/run_all_runtime_tests.sh) for an example script that shows how to run all the runtime tests. ## Pro-tips diff --git a/build_tools/build_test_cpp.ps1 b/build_tools/build_test_cpp.ps1 index 4a579cbd6..e686f40cf 100644 --- a/build_tools/build_test_cpp.ps1 +++ b/build_tools/build_test_cpp.ps1 @@ -82,8 +82,6 @@ $CMAKE_ARGS = @( "-DIREE_CMAKE_PLUGIN_PATHS=$repo_root" "-DIREE_EXTERNAL_HAL_DRIVERS=xrt" "-DIREE_BUILD_PYTHON_BINDINGS=ON" - # iree/runtime/src/iree/hal/cts/cts_test_base.h:173:24: error: unused variable 'device_buffer' [-Werror,-Wunused-variable] - "-DIREE_ENABLE_WERROR_FLAG=OFF" ) $peano_install_dir = "$env:PEANO_INSTALL_DIR" diff --git a/build_tools/build_test_cpp.sh b/build_tools/build_test_cpp.sh index e45e3cdf4..a1d610f64 100644 --- a/build_tools/build_test_cpp.sh +++ b/build_tools/build_test_cpp.sh @@ -81,8 +81,6 @@ CMAKE_ARGS=( -DIREE_INPUT_TORCH=OFF -DCMAKE_OBJECT_PATH_MAX=4096 -DIREE_CMAKE_PLUGIN_PATHS="$repo_root" - # iree/runtime/src/iree/hal/cts/cts_test_base.h:173:24: error: unused variable 'device_buffer' [-Werror,-Wunused-variable] - -DIREE_ENABLE_WERROR_FLAG=OFF ) PEANO_INSTALL_DIR=${PEANO_INSTALL_DIR:-""} diff --git a/build_tools/ci/run_all_runtime_tests.sh b/build_tools/ci/run_all_runtime_tests.sh new file mode 100755 index 000000000..1d439b93f --- /dev/null +++ b/build_tools/ci/run_all_runtime_tests.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -eu + +this_dir="$(cd $(dirname $0) && pwd)" +src_dir="$(cd $this_dir/../.. && pwd)" + +if [ -z "${IREE_INSTALL_DIR}" ]; then + echo "IREE_INSTALL_DIR needs to be set" + exit 1 +fi + +if [ -z "${PEANO_INSTALL_DIR}" ]; then + echo "PEANO_INSTALL_DIR needs to be set" + exit 1 +fi + +if [ -z "${VITIS_DIR}" ]; then + echo "VITIS_DIR needs to be set" + exit 1 +fi + +if [ -z "${XILINXD_LICENSE_FILE}" ]; then + echo "XILINXD_LICENSE_FILE needs to be set" + exit 1 +fi + +export PYTHONPATH=$IREE_INSTALL_DIR/python_packages/iree_compiler:$IREE_INSTALL_DIR/python_packages/iree_runtime +export XRT_LITE_N_CORE_ROWS=$(python $this_dir/amdxdna_driver_utils/amdxdna_ioctl.py --num-rows) +export XRT_LITE_N_CORE_COLS=$(python $this_dir/amdxdna_driver_utils/amdxdna_ioctl.py --num-cols) +export PATH=$IREE_INSTALL_DIR/bin:$PATH + +$this_dir/cpu_comparison/run.py \ + $this_dir/test_aie_vs_cpu \ + $IREE_INSTALL_DIR \ + $PEANO_INSTALL_DIR \ + --vitis-dir $VITIS_DIR \ + --xrt_lite_n_core_rows=$XRT_LITE_N_CORE_ROWS \ + --xrt_lite_n_core_cols=$XRT_LITE_N_CORE_COLS \ + -v + +$this_dir/run_matmul_test.sh \ + $this_dir/test_matmuls \ + $IREE_INSTALL_DIR \ + $PEANO_INSTALL_DIR \ + $VITIS_DIR + +pytest -rv --capture=tee-sys $src_dir/tests \ + --peano-install-dir=$PEANO_INSTALL_DIR \ + --iree-install-dir=$IREE_INSTALL_DIR \ + --xrt_lite_n_core_rows=$XRT_LITE_N_CORE_ROWS \ + --xrt_lite_n_core_cols=$XRT_LITE_N_CORE_COLS