[webgpu] Fix the incorrect shapes when profiling#26928
Merged
Conversation
guschmue
previously approved these changes
Jan 7, 2026
fs-eire
reviewed
Jan 7, 2026
Contributor
fs-eire
left a comment
There was a problem hiding this comment.
It looks like the overriden shape is not preserved. Is this OK for the profiling?
Contributor
Author
I did this intentionally. The overridden shape isn’t very straightforward. Or should we keep both versions? |
Contributor
Contributor
Author
Keeping both versions will result many same shapes if use_override_shape is false, which is also not a good method. Restore to use override shape instead of original shape since this is the actual shape used in shader. |
xiaofeihan1
approved these changes
Jan 13, 2026
alex-spacemit
pushed a commit
to spacemit-com/onnxruntime
that referenced
this pull request
Jan 20, 2026
This pull request refactors how input and output tensor shape
information is stored and accessed in the WebGPU context. Instead of
keeping references to the full input and output tensors, only their
shapes are now stored, which helps avoid issues with accessing released
tensors during profiling.
Before
`"inputs[0] = {1,1,768} inputs[1] = {200064,96,1} inputs[2] = {}
outputs[0] = {} "`
After
`"inputs[0] = {1,1,768} inputs[1] = {200064,96,1} inputs[2] = {19206144}
outputs[0] = {1,1,200064} "`
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.

This pull request refactors how input and output tensor shape information is stored and accessed in the WebGPU context. Instead of keeping references to the full input and output tensors, only their shapes are now stored, which helps avoid issues with accessing released tensors during profiling.
Before
"inputs[0] = {1,1,768} inputs[1] = {200064,96,1} inputs[2] = {} outputs[0] = {} "After
"inputs[0] = {1,1,768} inputs[1] = {200064,96,1} inputs[2] = {19206144} outputs[0] = {1,1,200064} "