Tensor Backing Buffer Mismatch Detected in Buffer Reuse #23739
Labels
ep:WebGPU
ort-web webgpu provider
platform:mobile
issues related to ONNX Runtime mobile; typically submitted using template
platform:web
issues related to ONNX Runtime web; typically submitted using template
Describe the issue
A reuse of a tensor backing buffer mismatch has been detected between the re-use target tensor with shape
(1,320,640,3)
and an output tensor that tends to reuse the buffer in shape(1,720,1280,3)
. This issue occurs when using a model with a dynamic input tensor in NCHW format where the input is(1,320,640,3)
and the corresponding dimension parameters are empty.Expected Behavior:
Tensor buffer reuse should only occur when the dimensions of the source and target tensors match correctly. In the case of dynamic dimensions with empty parameters, the algorithm should perform a more cautious check to avoid mismatches.
Current Workaround Patch:
The issue can be temporarily resolved with the following patch to disable the incorrect dimension parameter check, forcing the allocation planner to reject mismatches:
Impact:
This issue may lead to unintended behavior or even instability since tensor buffers are being reused inappropriately when their shapes do not match. A permanent fix should enforce proper validation of tensor dimensions during buffer reuse to ensure robustness in dynamic input scenarios.
Additional Information:
(1,320,640,3)
Any assistance or further investigation into this issue is appreciated.
Please let me know if additional information is needed.
Thank you.
To reproduce
(1,320,640,3)
.(1,720,1280,3)
.Urgency
No response
Platform
Android
OS Version
Android 15
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
afd3e81
ONNX Runtime API
C++
Architecture
X64
Execution Provider
Other / Unknown
Execution Provider Library Version
webgpu
The text was updated successfully, but these errors were encountered: