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

[js/webgpu] Simplify the Resize shader when noScale is true #18321

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

qjia7
Copy link
Contributor

@qjia7 qjia7 commented Nov 7, 2023

Description

For Resize, when noScale is true, the shader can become very simple, which is not related with attributes.mode anymore. So we should remove those parts of shader code for simplification.

This PR can also fix #18311 since the noScale are all true in that model.

However, #18311 also exposes that the Resize implementation for linear mode has bug. It seems that the currently implementation always treat the input as either 2d or 4d tensor, however, the actual input is 3d tensor, that's why the shader compilation is failed. We may need to fix it in a separate PR.

@qjia7
Copy link
Contributor Author

qjia7 commented Nov 7, 2023

@guschmue @fs-eire Please take a look, thanks!

@guschmue guschmue added the ep:WebGPU ort-web webgpu provider label Nov 7, 2023
@guschmue
Copy link
Contributor

guschmue commented Nov 7, 2023

/azp run ONNX Runtime Web CI Pipeline

@guschmue
Copy link
Contributor

guschmue commented Nov 7, 2023

/azp run 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,Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@guschmue
Copy link
Contributor

guschmue commented Nov 7, 2023

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

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@guschmue guschmue merged commit 606356d into microsoft:main Nov 7, 2023
39 checks passed
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
…t#18321)

### Description
For Resize, when `noScale` is true, the shader can become very simple,
which is not related with `attributes.mode` anymore. So we should remove
those parts of shader code for simplification.

This PR can also fix microsoft#18311 since the `noScale` are all true in that
model.

However, microsoft#18311 also exposes that the Resize implementation for `linear`
mode has bug. It seems that the currently implementation always treat
the input as either 2d or 4d tensor, however, the actual input is 3d
tensor, that's why the shader compilation is failed. We may need to fix
it in a separate PR.
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
…t#18321)

### Description
For Resize, when `noScale` is true, the shader can become very simple,
which is not related with `attributes.mode` anymore. So we should remove
those parts of shader code for simplification.

This PR can also fix microsoft#18311 since the `noScale` are all true in that
model.

However, microsoft#18311 also exposes that the Resize implementation for `linear`
mode has bug. It seems that the currently implementation always treat
the input as either 2d or 4d tensor, however, the actual input is 3d
tensor, that's why the shader compilation is failed. We may need to fix
it in a separate PR.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Web] WebGPU incorrect output for Segment Anything Model (SAM)
3 participants