Support weight sharing in QNN GPU#2325
Open
vjatoth-qti wants to merge 1 commit intomicrosoft:mainfrom
Open
Conversation
olive/passes/onnx/static_llm.py
Outdated
| decoder_config_extra=decoder_config_extra, | ||
| composite_components=None, | ||
| ) | ||
| return handler |
Check warning
Code scanning / lintrunner
RUFF/RET504 Warning
jambayk
reviewed
Feb 11, 2026
0c0236a to
24f1374
Compare
qti-mattsinc
reviewed
Mar 9, 2026
| "List of context lengths to generate static models QNN_GPU." | ||
| "If None or empty, falls back to single 'context_length'." | ||
| ), | ||
| ), |
There was a problem hiding this comment.
@vjatoth-qti, would the intended use of this in a recipe look like this?
"st": {
"type": "StaticLLM",
"batch_size": 1,
"context_lengths": [1, 64]
}Do we ever expect len(context_lengths) > 2? If not, it seems like we could follow the NPU strategy for StaticLLM, where "context_length": x always implies a hybrid AR1 + ARx model, and we wouldn't need a new "context_lengths" key.
qti-mattsinc
reviewed
Mar 9, 2026
| if str(device).lower() == "gpu": | ||
| provider_options["backend_path"] = "libQnnGpu.so" if platform.system() == "Linux" else "QnnGpu.dll" | ||
| if share_ep_contexts: | ||
| provider_options["enable_gpu_weight_sharing"] = "1" |
There was a problem hiding this comment.
Is enable_gpu_weight_sharing a supported provider option? The corresponding PR to onnxruntime-qnn (onnxruntime/onnxruntime-qnn#67) does not add it as one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Checklist before requesting a review
lintrunner -a(Optional) Issue link