From 1ea963cc77def37e5af4e3ea35969fb717357fd3 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Wed, 27 Aug 2025 09:03:55 -0700 Subject: [PATCH 1/2] add OMP_NUM_THREADS=1 to llvm-lit tests Signed-off-by: Mitchell --- .github/workflows/test_in_devenv.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_in_devenv.yml b/.github/workflows/test_in_devenv.yml index 2e550a9b698..e5b2d680ab6 100644 --- a/.github/workflows/test_in_devenv.yml +++ b/.github/workflows/test_in_devenv.yml @@ -100,11 +100,11 @@ jobs: fi ctest --output-on-failure --test-dir build -E "ctest-nvqpp|ctest-targettests" ctest_status=$? - $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/test/lit.site.cfg.py build/test + OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/test/lit.site.cfg.py build/test lit_status=$? - $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/targettests/lit.site.cfg.py build/targettests + OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/targettests/lit.site.cfg.py build/targettests targ_status=$? - $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/python/tests/mlir/lit.site.cfg.py build/python/tests/mlir + OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/python/tests/mlir/lit.site.cfg.py build/python/tests/mlir pymlir_status=$? if [ ! $ctest_status -eq 0 ] || [ ! $lit_status -eq 0 ] || [ $targ_status -ne 0 ] || [ $pymlir_status -ne 0 ]; then echo "::error file=test_in_devenv.yml::C++ tests failed (ctest status $ctest_status, llvm-lit status $lit_status, \ From 7007ce75a4f5c5aafa2842627f801ebdae0dd5bb Mon Sep 17 00:00:00 2001 From: Mitchell Date: Wed, 27 Aug 2025 14:59:05 -0700 Subject: [PATCH 2/2] add environment variables to cap openmp, in-case ctest does not see it Signed-off-by: Mitchell --- .github/workflows/test_in_devenv.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_in_devenv.yml b/.github/workflows/test_in_devenv.yml index e5b2d680ab6..8cfa1020c7d 100644 --- a/.github/workflows/test_in_devenv.yml +++ b/.github/workflows/test_in_devenv.yml @@ -91,6 +91,12 @@ jobs: shell: bash run: | cd $CUDAQ_REPO_ROOT + + # --- Threading caps (apply to ctest + pytest + all lit) --- + export OMP_NUM_THREADS=1 + export OMP_PROC_BIND=TRUE + export OMP_SCHEDULE=static + python3 -m pip install iqm-client==16.1 python3 -m pytest -v --durations=0 build/python/tests/interop/ pytest_status=$? @@ -100,11 +106,11 @@ jobs: fi ctest --output-on-failure --test-dir build -E "ctest-nvqpp|ctest-targettests" ctest_status=$? - OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/test/lit.site.cfg.py build/test + $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/test/lit.site.cfg.py build/test lit_status=$? - OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/targettests/lit.site.cfg.py build/targettests + $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/targettests/lit.site.cfg.py build/targettests targ_status=$? - OMP_NUM_THREADS=1 $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/python/tests/mlir/lit.site.cfg.py build/python/tests/mlir + $LLVM_INSTALL_PREFIX/bin/llvm-lit -v --time-tests --param nvqpp_site_config=build/python/tests/mlir/lit.site.cfg.py build/python/tests/mlir pymlir_status=$? if [ ! $ctest_status -eq 0 ] || [ ! $lit_status -eq 0 ] || [ $targ_status -ne 0 ] || [ $pymlir_status -ne 0 ]; then echo "::error file=test_in_devenv.yml::C++ tests failed (ctest status $ctest_status, llvm-lit status $lit_status, \