Skip to content

[QNN EP] Passthrough EP Parameters in Node - #23468

Merged
jywu-mysoft merged 20 commits into
microsoft:mainfrom
Cephable:joncamp/qnn_fixes
Feb 20, 2025
Merged

[QNN EP] Passthrough EP Parameters in Node#23468
jywu-mysoft merged 20 commits into
microsoft:mainfrom
Cephable:joncamp/qnn_fixes

Conversation

@joncamp

@joncamp joncamp commented Jan 23, 2025

Copy link
Copy Markdown

Description

The existing implementation of session options for the QNN EP does not honor the various bindings available. As such, even if set at runtime they are ignored. Fix is to follow the pattern of the webgpu provider and parse/populate the options accordingly.

Existing defaults are preserved, such that if options are not set the prior behavior will persist.

Motivation and Context

During debugging and development of Node implementations using the QNN EP the need to set various parameters became apparent. Currently the parameters can only be set via changes to the ORT dll code itself, which is inflexible and slows development.

@jywu-mysoft
jywu-mysoft requested a review from fs-eire January 23, 2025 01:35
@HectorSVC

Copy link
Copy Markdown
Contributor

/azp run Big Models,Linux Android Emulator QNN CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,Linux QNN CI Pipeline,MacOS CI Pipeline

@HectorSVC

Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,Windows x64 QNN CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed

@HectorSVC

Copy link
Copy Markdown
Contributor

/azp run ONNX Runtime Web CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 9 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

@fs-eire

fs-eire commented Jan 24, 2025

Copy link
Copy Markdown
Contributor

Sorry for the late review.

I think we should better first define the JavaScript API for QNN here, then in this PR parse/read them accordingly.

@fs-eire

fs-eire commented Jan 24, 2025

Copy link
Copy Markdown
Contributor

Sorry for the late review.

I think we should better first define the JavaScript API for QNN here, then in this PR parse/read them accordingly.

I created #23486. Please help take a look

Comment thread js/node/src/session_options_helper.cc Outdated
@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Jan 24, 2025
@jywu-mysoft

Copy link
Copy Markdown
Contributor

Sorry for the late review.
I think we should better first define the JavaScript API for QNN here, then in this PR parse/read them accordingly.

I created #23486. Please help take a look

thanks @fs-eire! Can #23486 be merged?

@fs-eire

fs-eire commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

Sorry for the late review.
I think we should better first define the JavaScript API for QNN here, then in this PR parse/read them accordingly.

I created #23486. Please help take a look

thanks @fs-eire! Can #23486 be merged?

Please let me know if you are good with the change (naming and typing). Please approve the PR if you are OK with it and I will go merge it.

fs-eire added a commit that referenced this pull request Feb 4, 2025
@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,Windows x64 QNN CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run ONNX Runtime Web CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run Big Models,Linux Android Emulator QNN CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,Linux QNN CI Pipeline,MacOS CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

1 similar comment
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 9 pipeline(s).

Comment thread js/node/src/session_options_helper.cc Outdated
sfatimar pushed a commit to intel/onnxruntime that referenced this pull request Feb 5, 2025
sfatimar pushed a commit to intel/onnxruntime that referenced this pull request Feb 5, 2025
@fs-eire

fs-eire commented Feb 9, 2025

Copy link
Copy Markdown
Contributor

I checked the implementation and I found that the existing implementation has a few errors.

Since the errors are not only for QNN ( there are also places to be fixed for CoreML and WebGPU), so I made this change. Please refer to 4ce51f3 as a patch to this PR.

ashrit-ms pushed a commit that referenced this pull request Feb 11, 2025
@jywu-mysoft

Copy link
Copy Markdown
Contributor

I checked the implementation and I found that the existing implementation has a few errors.

Since the errors are not only for QNN ( there are also places to be fixed for CoreML and WebGPU), so I made this change. Please refer to 4ce51f3 as a patch to this PR.

@joncamp would you be able to apply @fs-eire 's patch to this PR? let's try to merge it into main asap (for upcoming ORT 1.21 release, code freeze end of week)

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline,Windows GPU CI Pipeline,Windows GPU TensorRT CI Pipeline,Windows x64 QNN CI Pipeline,onnxruntime-binary-size-checks-ci-pipeline,orttraining-linux-ci-pipeline,orttraining-linux-gpu-ci-pipeline,orttraining-ortmodule-distributed

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run Big Models,Linux Android Emulator QNN CI Pipeline,Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,Linux QNN CI Pipeline,MacOS CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run ONNX Runtime Web CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows GPU CUDA CI Pipeline,Windows GPU DML CI Pipeline,Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 5 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 9 pipeline(s).

@fs-eire fs-eire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LTGM.

Please test if the code works before merge.

@jywu-mysoft

Copy link
Copy Markdown
Contributor

/azp run Linux GPU CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jywu-mysoft
jywu-mysoft merged commit 75cf166 into microsoft:main Feb 20, 2025
@joncamp
joncamp deleted the joncamp/qnn_fixes branch February 24, 2025 16:52
guschmue pushed a commit that referenced this pull request Mar 6, 2025
guschmue pushed a commit that referenced this pull request Mar 6, 2025
### Description
The existing implementation of session options for the QNN EP does not
honor the various bindings available. As such, even if set at runtime
they are ignored. Fix is to follow the pattern of the `webgpu` provider
and parse/populate the options accordingly.

Existing defaults are preserved, such that if options are not set the
prior behavior will persist.

### Motivation and Context
During debugging and development of Node implementations using the QNN
EP the need to set various parameters became apparent. Currently the
parameters can only be set via changes to the ORT dll code itself, which
is inflexible and slows development.

---------

Co-authored-by: Yulong Wang <7679871+fs-eire@users.noreply.github.com>
ashrit-ms pushed a commit that referenced this pull request Mar 17, 2025
ashrit-ms pushed a commit that referenced this pull request Mar 17, 2025
### Description
The existing implementation of session options for the QNN EP does not
honor the various bindings available. As such, even if set at runtime
they are ignored. Fix is to follow the pattern of the `webgpu` provider
and parse/populate the options accordingly.

Existing defaults are preserved, such that if options are not set the
prior behavior will persist.

### Motivation and Context
During debugging and development of Node implementations using the QNN
EP the need to set various parameters became apparent. Currently the
parameters can only be set via changes to the ORT dll code itself, which
is inflexible and slows development.

---------

Co-authored-by: Yulong Wang <7679871+fs-eire@users.noreply.github.com>
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.

4 participants