Skip to content

Commit

Permalink
remove WERROR hack and add run_all_runtime_tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Oct 18, 2024
1 parent db3cc6b commit 8974d20
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions build_tools/build_test_cpp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions build_tools/build_test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-""}
Expand Down
52 changes: 52 additions & 0 deletions build_tools/ci/run_all_runtime_tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8974d20

Please sign in to comment.