Skip to content

Commit 1c9a388

Browse files
authored
Move provider tests to onnxruntime_provider_test and enable use of plugin EPs (#25689)
### Description <!-- Describe your changes. --> Move provider-specific unit tests that were formerly in `onnxruntime_test_all` to a new test program, `onnxruntime_provider_test`. Notably, this includes the op tests which test different provider implementations. Enable some tests in `onnxruntime_provider_test` (those using `ModelTester` or `OpTester`) to use a plugin EP. The plugin EP usage is specified at runtime, so it is referred to as "dynamic". The dynamic plugin EP configuration can be specified with environment variable `ORT_UNIT_TEST_MAIN_DYNAMIC_PLUGIN_EP_CONFIG_JSON`. This is an example value for `ORT_UNIT_TEST_MAIN_DYNAMIC_PLUGIN_EP_CONFIG_JSON`. The test infrastructure will register the plugin EP library at `path/to/example_plugin_ep.dll`. The op tests will use a plugin EP instance with the name `example_ep`. ```json { "ep_library_registration_name": "example_ep", "ep_library_path": "/path/to/example_plugin_ep.dll", "selected_ep_name": "example_ep" } ``` ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Enable use of plugin EPs in some provider-specific unit tests.
1 parent 2d2a3e5 commit 1c9a388

File tree

184 files changed

+1102
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+1102
-558
lines changed

.github/workflows/linux-wasm-ci-build-and-test-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
path: ${{ github.workspace }}/artifacts/wasm
121121

122122
- name: Test (Node.js) (simd + threads)
123-
# onnxruntime_test_all is currently only supported in Debug build because it requires exception, which is disabled in Release build.
123+
# unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds.
124124
if: ${{ inputs.build_config == 'Debug' }}
125125
run: |
126126
python ./tools/ci_build/build.py \
@@ -130,14 +130,14 @@ jobs:
130130
working-directory: ${{ github.workspace }}
131131

132132
- name: Test (browser) (simd + threads)
133-
# onnxruntime_test_all is currently only supported in Debug build because it requires exception, which is disabled in Release build.
133+
# unit tests are currently only supported in Debug builds because they require exceptions, which are disabled in Release builds.
134134
if: ${{ inputs.build_config == 'Debug' }}
135135
run: |
136136
python ./tools/ci_build/build.py \
137137
${{ env.common_build_args }} \
138138
--build_dir ${{ github.workspace }}/build/wasm_inferencing \
139139
--wasm_run_tests_in_browser \
140-
--target onnxruntime_test_all \
140+
--targets onnxruntime_test_all onnxruntime_provider_test \
141141
--update --build --test
142142
working-directory: ${{ github.workspace }}
143143

.github/workflows/windows_webgpu.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,23 @@ jobs:
127127
}
128128
Remove-Item "${{ github.workspace }}\RelWithDebInfo" -Include "*.obj" -Recurse
129129
130-
- name: Run tests (onnxruntime_test_all) with verbose logging
130+
- name: Run tests (onnxruntime_test_all, onnxruntime_provider_test) with verbose logging
131131
shell: pwsh
132132
run: |
133133
$env:ORT_UNIT_TEST_MAIN_LOG_LEVEL = "0"
134-
.\onnxruntime_test_all.exe 2>.\onnxruntime_test_all_stderr.log
134+
.\onnxruntime_test_all.exe 2> .\onnxruntime_test_stderr.log
135+
.\onnxruntime_provider_test.exe 2>> .\onnxruntime_test_stderr.log
135136
working-directory: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo
136137

137138
- name: Check log file
138139
shell: cmd
139140
run: |
140-
dir ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_all_stderr.log
141+
dir ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_stderr.log
141142
142143
- name: Validate shader keys
143144
uses: ./.github/actions/webgpu-validate-shader-key
144145
with:
145-
log_file_path: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_all_stderr.log
146+
log_file_path: ${{ github.workspace }}\RelWithDebInfo\RelWithDebInfo\onnxruntime_test_stderr.log
146147

147148
- name: Validate C# native delegates
148149
run: python tools\ValidateNativeDelegateAttributes.py

cmake/onnxruntime_test_pch.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
55
target_precompile_headers(onnxruntime_test_all PRIVATE
66
"${CMAKE_CURRENT_SOURCE_DIR}/test_pch.h"
77
)
8-
endif()
8+
target_precompile_headers(onnxruntime_provider_test PRIVATE
9+
"${CMAKE_CURRENT_SOURCE_DIR}/test_pch.h"
10+
)
11+
endif()
912

1013
# Exclude certain files that might conflict with PCH
1114
set(PCH_EXCLUDE_FILES

0 commit comments

Comments
 (0)