-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[QNN EP] Add ONNX ScatterElements support #24811
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
[QNN EP] Add ONNX ScatterElements support #24811
Conversation
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
|
Please check the doc to make sure there are no steps missing: https://onnxruntime.ai/docs/execution-providers/QNN-ExecutionProvider.html#add-new-operator-support-in-qnn-ep |
- Translate ONNX ScatterElements as QNN's ScatterElements Op - Handle unsupported reduction value i.e., "min" - Add unit tests to verify ScatterElements Op support on HTP
- Add QDQ selector for ScatterElements to fold DQ and Q nodes on inputs and outputs of ScatterElements Op into a single nodeunit. - Add more unit tests to verify the ScatterElement Op translations in QNN EP
992764c to
16d2c32
Compare
Thanks for pointing the missing functionality. The PR is updated with adding missing functionality. |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the ONNX ScatterElements operation to the QNN execution provider. It includes translation of the operator to QNN's ScatterElements op, handling of unsupported reduction modes (specifically "min"), and comprehensive test coverage.
Key changes:
- Implements QNN EP support for ScatterElements with proper attribute handling (axis and reduction)
- Adds validation to reject unsupported "min" reduction mode
- Extends test infrastructure to support multi-type input operations and adds comprehensive unit tests
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/test/providers/qnn/simple_op_htp_test.cc | Adds comprehensive test cases for ScatterElements on CPU and HTP backends |
| onnxruntime/test/providers/qnn/qnn_test_utils.h | Extends test infrastructure with new template functions for multi-type input operations |
| onnxruntime/test/providers/cpu/tensor/scatter_op_test.cc | Updates existing tests to exclude QNN EP for unsupported scenarios |
| onnxruntime/core/providers/qnn/builder/opbuilder/simple_op_builder.cc | Implements ScatterElements operator translation with attribute processing |
| onnxruntime/core/providers/qnn/builder/opbuilder/base_op_builder.h | Adds ONNX to QNN operator type mapping |
| onnxruntime/core/providers/qnn/builder/op_builder_factory.cc | Registers ScatterElements operator builder |
| onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc | Adds QDQ selector registration for ScatterElements |
| onnxruntime/core/optimizer/qdq_transformer/selectors_actions/qdq_selectors.h | Declares ScatterElements QDQ selector class |
| onnxruntime/core/optimizer/qdq_transformer/selectors_actions/qdq_selectors.cc | Implements ScatterElements QDQ validation logic |
Comments suppressed due to low confidence (1)
onnxruntime/test/providers/qnn/simple_op_htp_test.cc:1363
- Test name should follow consistent capitalization. Change 'int8' to 'Int8' to match the naming pattern used in other tests like 'ScatterElements_Int8_Reduction_Max'.
TEST_F(QnnHTPBackendTests, ScatterElements_int8_reduction_mul) {
onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc
Show resolved
Hide resolved
|
Need to disable some Onnx node test: scatter_elements_with_negative_indices |
We are checking how can we disable it. |
@HectorSVC |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
### Description - Translate ONNX ScatterElements as QNN's ScatterElements Op - Handle unsupported reduction value i.e., "min" - Add unit tests to verify ScatterElements Op support on HTP --------- Co-authored-by: Tirupathi Reddy T <[email protected]>
### Description - Translate ONNX ScatterElements as QNN's ScatterElements Op - Handle unsupported reduction value i.e., "min" - Add unit tests to verify ScatterElements Op support on HTP --------- Co-authored-by: Tirupathi Reddy T <[email protected]>
Description