diff --git a/onnxruntime/python/tools/kernel_explorer/kernels/kernel_explorer.py b/onnxruntime/python/tools/kernel_explorer/kernels/kernel_explorer.py index 8be8481fd1..0f23f64553 100644 --- a/onnxruntime/python/tools/kernel_explorer/kernels/kernel_explorer.py +++ b/onnxruntime/python/tools/kernel_explorer/kernels/kernel_explorer.py @@ -26,8 +26,8 @@ if build_dir is None: if not os.path.exists(build_dir): raise ValueError(f"KERNEL_EXPLORER_BUILD_DIR ({build_dir}) points to nonexistent path") -# onnxruntime_pybind11_state and kernel_explorer -sys.path.insert(0, build_dir) +# add path for onnxruntime_pybind11_state +sys.path.insert(0, os.path.join(build_dir, "onnxruntime", "capi")) # pylint: disable=wrong-import-position import onnxruntime_pybind11_state # noqa: E402 diff --git a/onnxruntime/python/tools/kernel_explorer/kernels/pytest.ini b/onnxruntime/python/tools/kernel_explorer/kernels/pytest.ini new file mode 100644 index 0000000000..fb5ba0310b --- /dev/null +++ b/onnxruntime/python/tools/kernel_explorer/kernels/pytest.ini @@ -0,0 +1,11 @@ +[pytest] + +# Add default command-line options +addopts = --maxfail=3 -v + +# Add the current directory to the beginning of sys.path for the duration of the test session. +pythonpath = . + +# Enables logging to the console during test runs +log_cli = true +log_level = INFO diff --git a/tools/ci_build/github/azure-pipelines/linux-rocm-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-rocm-ci-pipeline.yml index 5e02e73c42..6ee9a8dbcd 100644 --- a/tools/ci_build/github/azure-pipelines/linux-rocm-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-rocm-ci-pipeline.yml @@ -177,7 +177,6 @@ jobs: --user $UID:$(id -g $USER) \ --volume $(Build.SourcesDirectory):/onnxruntime_src \ --volume $(Build.BinariesDirectory):/build \ - --workdir /build/Release \ -e OPENBLAS_NUM_THREADS=1 \ -e OPENMP_NUM_THREADS=1 \ -e MKL_NUM_THREADS=1 \ @@ -189,9 +188,8 @@ jobs: /bin/bash -c " set -ex; \ env; \ - cd /build/Release; \ - python --version; \ - pytest /onnxruntime_src/onnxruntime/python/tools/kernel_explorer/ -n 4 --reruns 1 --durations=100" + cd /onnxruntime_src/onnxruntime/python/tools/kernel_explorer/kernels; \ + pytest -n 4 --reruns 1 --durations=100" workingDirectory: $(Build.SourcesDirectory) displayName: 'Run kernel explorer tests' condition: succeededOrFailed()