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] Update API for ort.env.webgpu #23026

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Dec 5, 2024

Description

This PR is a replacement of #21671. It offers a new way for accessing the following:

  • ort.env.webgpu.adapter:
    • deprecating. There is no point to get the value of it. Once GPUDevice.adapterInfo is supported, there is no point to set the value too.
  • ort.env.webgpu.device:
    • set value of GPUDevice if user created it. Use at user's own risk.
    • get value of Promise<GPUDevice>. if not exist, create a new one. if exist return it.
  • ort.env.webgpu.powerPreference:
    • deprecating. encouraging users to set ort.env.webgpu.device if necessary.
  • ort.env.webgpu.forceFallbackAdapter:
    • deprecating. encouraging users to set ort.env.webgpu.device if necessary.

@fs-eire
Copy link
Contributor Author

fs-eire commented Dec 5, 2024

@gyagp

Copy link

@gyagp gyagp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change, and the interface looks very clean now.
Please also change the way to get the adapterInfo when device is created externally.

@fs-eire fs-eire merged commit e605870 into main Dec 11, 2024
95 checks passed
@fs-eire fs-eire deleted the fs-eire/webgpu-api-update branch December 11, 2024 18:24
@xenova
Copy link

xenova commented Dec 15, 2024

Very useful! Could you put out a dev build for onnxruntime-common to include this? 😇 thanks!

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.

4 participants