-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[QNN-EP] Enable verbose and artifacts saving in onnxruntime_provider_test.exe #26396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
edgchen1
merged 3 commits into
microsoft:main
from
CodeLinaro:dev/qti-hungjuiw/qnn-test-save
Nov 26, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # ONNX Runtime QNN Execution Provider Tests | ||
| ## Overview | ||
| 1. The `onnxruntime/test/providers/qnn` directory contains integration tests for the Qualcomm Neural Network (QNN) execution provider. | ||
| 2. Most testcases run an ONNX model through the QNN-EP, then verifies the inference result against the one on CPU-EP | ||
|
|
||
| ## Building the Tests | ||
| The tests are built as part of the regular ONNX Runtime build. After a successful build you will have an executable named | ||
| - onnxruntime_provider_test.exe (Windows) | ||
| - onnxruntime_provider_test (Linux/macOS) | ||
|
|
||
| ## Running the Tests | ||
| 1. QNN supports several backends. You can use the standard Google‑Test syntax for filtering: | ||
| - `onnxruntime_provider_test.exe --gtest_filter=QnnCPUBackendTests.*` | ||
| - `onnxruntime_provider_test.exe --gtest_filter=QnnHTPBackendTests.*` | ||
| - `onnxruntime_provider_test.exe --gtest_filter=QnnGPUBackendTests.*` | ||
| - `onnxruntime_provider_test.exe --gtest_filter=QnnIRBackendTests.*` | ||
| 2. Saving Test Artifacts | ||
| - For debugging it is often helpful to keep the intermediate files that the tests generate. The following environment | ||
| variables are recognized by the test binary: | ||
| - `QNN_DUMP_ONNX`: Saves the input ONNX model used for the test | ||
| - `QNN_DUMP_JSON`: Save json qnn graph with provider_option `dump_json_qnn_graph` | ||
| - `QNN_DUMP_DLC`: Saves the compiled QNN DLC file by specifying the provider_option `backend_path` to `QnnIr.dll` | ||
| - The artifacts will be saved to a directory named with `<TestSuite>_<TestName>` | ||
| ``` | ||
| . | ||
| ├── QnnCPUBackendTests_BatchNorm2D_fp32 # RunQnnModelTest | ||
| │ ├── dumped_f32_model.onnx # float32 ONNX model | ||
| │ ├── QNNExecutionProvider_QNN_XXXX_X_X.dlc | ||
| │ └── QNNExecutionProvider_QNN_XXXX_X_X.json | ||
| ├── QnnHTPBackendTests_BatchNorm_FP16 # TestFp16ModelAccuracy | ||
| │ ├── dumped_f16_model.onnx # float16 ONNX model | ||
| │ ├── dumped_f32_model.onnx # float32 ONNX model | ||
| │ ├── QNNExecutionProvider_QNN_XXXX_X_X.dlc | ||
| │ └── QNNExecutionProvider_QNN_XXXX_X_X.json | ||
| └── QnnHTPBackendTests_BatchNorm2D_U8U8S32 # TestQDQModelAccuracy | ||
| ├── dumped_f32_model.onnx # float32 ONNX model | ||
| ├── dumped_qdq_model.onnx # QDQ ONNX model | ||
| ├── QNNExecutionProvider_QNN_XXXX_X_X.dlc | ||
| └── QNNExecutionProvider_QNN_XXXX_X_X.json | ||
|
|
||
| # All artifact files are placed under the current working directory from which the test binary is invoked. | ||
| ``` | ||
| 3. Verbose | ||
| - `QNN_VERBOSE`: Sets the ONNX Runtime log level to `ORT_LOGGING_LEVEL_VERBOSE` | ||
|
|
||
| 4. You can enable any combination of these environment variables, for example: | ||
| - On Linux/macOS | ||
| ```bash | ||
| export QNN_DUMP_ONNX=1 | ||
| export QNN_DUMP_JSON=1 | ||
| export QNN_DUMP_DLC=1 | ||
| export QNN_VERBOSE=1 | ||
| ``` | ||
| - On Windows | ||
| ```cmd | ||
| set QNN_DUMP_ONNX=1 | ||
| set QNN_DUMP_JSON=1 | ||
| set QNN_DUMP_DLC=1 | ||
| set QNN_VERBOSE=1 | ||
| ``` | ||
| ```ps1 | ||
| $Env:QNN_DUMP_ONNX = "1" | ||
| $Env:QNN_DUMP_JSON = "1" | ||
| $Env:QNN_DUMP_DLC = "1" | ||
| $Env:QNN_VERBOSE = "1" | ||
| ``` | ||
|
|
||
| # Note | ||
| - An issue on QNN backends can prevent the test artifacts from being successfully saved. | ||
| - The `onnxruntime_provider_test.exe` does not automatically delete the artifact directories, so you may want to prune them after a debugging session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.