Skip to content

Conversation

@qti-yuduo
Copy link
Contributor

[QNN-EP] Einsum equation ReduceSum Multiply on broadcast X

@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Jul 29, 2025
@HectorSVC
Copy link
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows x64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@HectorSVC HectorSVC requested a review from Copilot July 29, 2025 21:21
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 a new Einsum equation pattern "ReduceSum Multiply on broadcast X" (e.g., "bhwc,wkc->bhwk") to the QNN provider. The implementation handles cases where the first input needs broadcasting and both inputs are multiplied before being reduced along the contraction axis.

  • Adds pattern recognition for the new ReduceSum Multiply broadcast equation type
  • Implements the equation by reshaping, multiplying with broadcasting, and reducing along the contraction axis
  • Includes comprehensive test coverage across CPU, HTP, and GPU backends with appropriate disabling for known issues

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
onnxruntime/test/providers/qnn/einsum_op_test.cc Adds test cases for the new equation pattern across different backends, with some disabled due to QAIRT limitations
onnxruntime/core/providers/qnn/builder/opbuilder/einsum_op_builder.cc Implements pattern detection and graph construction for ReduceSum Multiply broadcast operations
Comments suppressed due to low confidence (1)

onnxruntime/test/providers/qnn/einsum_op_test.cc:192

  • The test name 'EinsumRank4MatMulTransposeAll2' is misleading as this test was moved and replaced with a different equation pattern. The name should reflect that this is testing the ReduceSum Multiply broadcast functionality, not MatMul transpose.
TEST_F(QnnCPUBackendTests, EinsumRank4MatMulTransposeAll2) {

@HectorSVC HectorSVC merged commit c22f70d into microsoft:main Jul 30, 2025
86 checks passed
sanketkaleoss pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…#25581)

[QNN-EP] Einsum equation ReduceSum Multiply on broadcast X
@qti-yuduo qti-yuduo deleted the dev/yuduo/einsum2 branch September 24, 2025 18:46
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