Skip to content

Conversation

@quic-ashwshan
Copy link
Contributor

  • 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
@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Aug 1, 2025
@HectorSVC HectorSVC requested a review from Copilot August 1, 2025 21:25
@HectorSVC
Copy link
Contributor

/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
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

Copy link
Contributor

Copilot AI left a 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,

Copy link
Contributor

@HectorSVC HectorSVC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@HectorSVC HectorSVC merged commit 539d0ed into microsoft:main Aug 4, 2025
86 of 89 checks passed
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
- 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.
gedoensmax pushed a commit to gedoensmax/onnxruntime that referenced this pull request Sep 2, 2025
- 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.
qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:QNN issues related to QNN exeution provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants