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 EP] allows GPUDevice to be released after use #23144

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

fs-eire
Copy link
Contributor

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

Description

This change allows the WebGpuContext class to be released after all active inference sessions are released. This will cause:

  • for default context (ID=0), the underlying wgpu::Device and wgpu::Adapter to be released, together with all resources created by the Device.
  • for custom context (ID>0), the reference counts of passed in Instance, Adapter and Device will decrement correctly.

@guschmue guschmue added the ep:WebGPU ort-web webgpu provider label Dec 19, 2024
@fs-eire fs-eire merged commit b4a6a0d into main Dec 19, 2024
94 of 96 checks passed
@fs-eire fs-eire deleted the fs-eire/allow-resource-clean-up branch December 19, 2024 23:33
guschmue pushed a commit that referenced this pull request Dec 20, 2024
### Description

This change allows the `WebGpuContext` class to be released after all
active inference sessions are released. This will cause:
- for default context (ID=0), the underlying `wgpu::Device` and
`wgpu::Adapter` to be released, together with all resources created by
the Device.
- for custom context (ID>0), the reference counts of passed in Instance,
Adapter and Device will decrement correctly.
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.

2 participants