Skip to content

Conversation

@qti-yuduo
Copy link
Contributor

Description

Enhance unique name generator for node and tensor names

Motivation and Context

QNN requires node name to be unique. We've seen many instance of QNN node name conflicts results in failures on QNN graph finalizations. However, currently it's hard-coded and thus error-prone, this change adds utility to generate unique names used in QNN nodes and intermediate I/O tensors.

@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Aug 11, 2025
@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).

@HectorSVC HectorSVC requested a review from Copilot August 11, 2025 17:01
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 enhances the QNN execution provider by introducing a unique name generator utility to prevent node and tensor name conflicts. The implementation replaces hardcoded name generation with a centralized utility that automatically appends counters to ensure uniqueness.

  • Introduces GetUniqueName utility functions for generating unique node and tensor names
  • Replaces hardcoded name concatenations throughout the codebase with centralized name generation
  • Updates function calls from GetNodeName to GetUniqueName to utilize the new naming system

Reviewed Changes

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

Show a summary per file
File Description
qnn_utils.h Declares new GetUniqueName functions to replace GetNodeName
qnn_utils.cc Implements unique name generation logic with static counter and removes old GetNodeName
Multiple fusion files Updates node name generation to use new unique naming utilities
Multiple op builders Replaces hardcoded name generation with GetUniqueName calls
qnn_model_wrapper.cc Updates node creation to use unique names and fixes typo

@HectorSVC
Copy link
Contributor

please fix build error

@qti-yuduo
Copy link
Contributor Author

please fix build error

Will do. Sync issue. :(

@qti-yuduo qti-yuduo force-pushed the dev/yuduo/qnn-node-name-cl branch from 646e020 to 7cc7abb Compare August 11, 2025 20:30
@qti-yuduo qti-yuduo requested a review from HectorSVC August 11, 2025 20:30
@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

@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 c5a8c53 into microsoft:main Aug 13, 2025
86 checks passed
HectorSVC pushed a commit that referenced this pull request Aug 14, 2025
Follow up for #25702. 

Improve thread safety.
gedoensmax pushed a commit to gedoensmax/onnxruntime that referenced this pull request Sep 2, 2025
…rosoft#25702)

### Description
Enhance unique name generator for node and tensor names

### Motivation and Context
QNN requires node name to be unique. We've seen many instance of QNN node name conflicts results in failures on QNN graph finalizations.
However, currently it's hard-coded and thus error-prone, this change adds utility to generate unique names used in QNN nodes and intermediate
I/O tensors.
gedoensmax pushed a commit to gedoensmax/onnxruntime that referenced this pull request Sep 2, 2025
qti-yuduo pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Sep 24, 2025
@qti-yuduo qti-yuduo deleted the dev/yuduo/qnn-node-name-cl 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