-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[QNN EP] Add support for GatherNd Op in QNN EP #25635
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 support for GatherNd Op in QNN EP #25635
Conversation
- Added new op builder for GatherNd Op - Added unit tests for GatherNd and QDQ tests - Disabled two tests in ORT test as QNN CPU does not support negative indices
|
/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 GatherND operation in the QNN Execution Provider. The implementation handles quantized and non-quantized models, supports different index types, and includes proper shape handling and type casting.
Key changes:
- Added complete GatherND op builder implementation with index processing and casting
- Added comprehensive test coverage for both QDQ and non-QDQ GatherND scenarios
- Disabled specific CPU tests that use negative indices due to QNN CPU limitations
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| gather_nd_op_builder.cc | Complete GatherND op builder implementation with index handling and type casting |
| gather_op_htp_test.cc | Added comprehensive test cases for GatherND including QDQ variants |
| gather_nd_op_test.cc | Disabled negative index tests for QNN CPU compatibility |
| op_builder_factory.h | Added function declaration for GatherND op builder |
| op_builder_factory.cc | Registered GatherND op builder in factory |
Comments suppressed due to low confidence (2)
onnxruntime/core/providers/qnn/builder/opbuilder/gather_nd_op_builder.cc:68
- The comment mentions converting int64 to uint32, but the function template converts to int32. The comment should be updated to reflect the actual conversion to int32.
}
onnxruntime/core/providers/qnn/builder/opbuilder/gather_nd_op_builder.cc:70
- The data_shape parameter is passed by non-const reference but is only read from. It should be passed by const reference for better API design.
Status GatherNDOpBuilder::ProcessInputs(QnnModelWrapper& qnn_model_wrapper,
onnxruntime/core/providers/qnn/builder/opbuilder/gather_nd_op_builder.cc
Show resolved
Hide resolved
onnxruntime/core/providers/qnn/builder/opbuilder/gather_nd_op_builder.cc
Show resolved
Hide resolved
HectorSVC
left a comment
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.
![]()
- Added new op builder for GatherNd Op - Added unit tests for GatherNd and QDQ tests - Disabled two tests in ORT test as QNN CPU does not support negative indices ### Description Adding support for GatherNd op in QNN EP ### Motivation and Context Currently GatherNd op is not supported in QNN EP and hence falls back to ORT CPU.
- Added new op builder for GatherNd Op - Added unit tests for GatherNd and QDQ tests - Disabled two tests in ORT test as QNN CPU does not support negative indices ### Description Adding support for GatherNd op in QNN EP ### Motivation and Context Currently GatherNd op is not supported in QNN EP and hence falls back to ORT CPU.
- pick microsoft#25584 - pick microsoft#25635 - pick microsoft#25673 - pick microsoft#25702 - pick microsoft#25738
Description
Adding support for GatherNd op in QNN EP
Motivation and Context
Currently GatherNd op is not supported in QNN EP and hence falls back to ORT CPU.