Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebGPU] Error: [WebGPU] Kernel "[MaxPool] /sincnet/pool1d.0/MaxPool" failed. Error: length of specified kernel shapes should be 2 less than length of input dimensions #21386

Open
xenova opened this issue Jul 17, 2024 · 4 comments
Labels
ep:WebGPU ort-web webgpu provider model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@xenova
Copy link

xenova commented Jul 17, 2024

Describe the issue

Attempting to run this PyAnnote segmentation model with WebGPU produces the following error:

An error occurred during model execution: "Error: [WebGPU] Kernel "[MaxPool] /sincnet/pool1d.0/MaxPool" failed. Error: length of specified kernel shapes should be 2 less than length of input dimensions".

Running with WASM produces the correct result.

To reproduce

minimum reproduction: https://jsfiddle.net/omgkb3n1/1/

Urgency

Prevents use of this model in Transformers.js

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.18.0

Execution Provider

'webgpu' (WebGPU)

@xenova xenova added the platform:web issues related to ONNX Runtime web; typically submitted using template label Jul 17, 2024
@xenova
Copy link
Author

xenova commented Jul 17, 2024

cc @guschmue for viz

@github-actions github-actions bot added the model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. label Jul 17, 2024
@sophies927 sophies927 added the ep:WebGPU ort-web webgpu provider label Jul 18, 2024
@gyagp
Copy link
Contributor

gyagp commented Jul 19, 2024

The root cause is ORT WebGPU only implements maxpool2d. But this model requires maxpool1d, then fails with the check "kernelShape.length !== inputDims.length - 2" in adjustPoolAttributes().

axinging added a commit to axinging/onnxruntime that referenced this issue Jul 30, 2024
axinging added a commit to axinging/onnxruntime that referenced this issue Jul 30, 2024
@guschmue
Copy link
Contributor

guschmue commented Jul 30, 2024

I think there are more issues with pyannotate after the first maxpool,
The Conv1D behind that maxpool is messing up its output shape as far I can tell.
But worse with pyannotate: there are LSTMs behind the first 2 layers - don't think we have plans
to support LSTM in webgpu.

@guschmue
Copy link
Contributor

And the fix for maxpool looks good.

axinging added a commit to axinging/onnxruntime that referenced this issue Aug 1, 2024
axinging added a commit to axinging/onnxruntime that referenced this issue Aug 11, 2024
fs-eire pushed a commit that referenced this issue Aug 14, 2024
Bug: #21386

### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:WebGPU ort-web webgpu provider model:transformer issues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc. platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

4 participants