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/web] add sessionOptions.freeDimensionOverrides #17488

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Sep 11, 2023

Description

Allows to specify fixed size for dynamic input of a model. resolves #16707

Pending test

@Honry
Copy link
Contributor

Honry commented Sep 12, 2023

@fs-eire, many thanks for your effort, I am really exciting to see this feature be ready for Web soon.

I applied your PR and tested on both WebNN EP and CPU EP, unfortunately I didn't see dynamic dimensions been overridden. i.e. this function FreeDimensionOverrideTransformer::ApplyImp hadn't been called. Looks like it's connection to WebNN EP and CPU EP or other EPs are missing in the underlying.

@fs-eire
Copy link
Contributor Author

fs-eire commented Sep 12, 2023

updated to use C API AddFreeDimensionOverrideByName instead of AddFreeDimensionOverride. please try again!

@Honry
Copy link
Contributor

Honry commented Sep 13, 2023

updated to use C API AddFreeDimensionOverrideByName instead of AddFreeDimensionOverride. please try again!

@fs-eire, 👍 , awesome, it works now!

@guschmue guschmue merged commit a2e7511 into main Sep 13, 2023
94 checks passed
@guschmue guschmue deleted the fs-eire/web-add-free-dimension-override branch September 13, 2023 16:17
@guschmue
Copy link
Contributor

guschmue commented Sep 13, 2023

tested this with webgpu with mobilenet and t5-decoder: batch_size=1.
The option itself works but I did not see gains, depends on model and parameter you make static (for t5 it actually became slower).

kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description
Allows to specify fixed size for dynamic input of a model. resolves
microsoft#16707

Pending test
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
### Description
Allows to specify fixed size for dynamic input of a model. resolves
microsoft#16707

Pending test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Web] SessionOptions::AddFreeDimensionOverride missing
3 participants