-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Patch] allows new memory info name for WebGPU #27475
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,7 +237,19 @@ ORT_API_STATUS_IMPL(OrtApis::CreateMemoryInfo, _In_ const char* name1, enum OrtA | |
| OrtDevice(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, OrtDevice::VendorIds::AMD, device_id), | ||
| mem_type1); | ||
| } else if (strcmp(name1, onnxruntime::WEBGPU_BUFFER) == 0 || | ||
| strcmp(name1, onnxruntime::WEBNN_TENSOR) == 0) { | ||
| strcmp(name1, onnxruntime::WEBNN_TENSOR) == 0 || | ||
| // PR #27207 (merged to main/1.25.x, not in 1.24.x) shortened the WebGPU/WebNN | ||
| // memory info names from "WebGPU_Buffer"/"WebNN_Tensor" to "WebGPU_Buf"/"WebNN_Ten" | ||
| // to enable Small String Optimization (SSO) on wasm32 (emscripten), where strings | ||
| // must be <= 10 chars for SSO. | ||
| // | ||
| // A WebGPU/WebNN plugin EP built against 1.25.x will use the new short names. | ||
| // Accept both old and new names here so that plugin EPs targeting either 1.24.x | ||
| // or 1.25.x can work with this 1.24.x runtime. | ||
| // | ||
| // See: https://github.com/microsoft/onnxruntime/pull/27207 | ||
| strcmp(name1, "WebGPU_Buf") == 0 || | ||
| strcmp(name1, "WebNN_Ten") == 0) { | ||
|
Comment on lines
+241
to
+252
|
||
| *out = new OrtMemoryInfo( | ||
| name1, type, | ||
| OrtDevice(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, OrtDevice::VendorIds::NONE, device_id), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change also adds support for the WebNN short name ("WebNN_Ten"), but the PR title/description only mention WebGPU. Please update the PR description (or remove the WebNN part) so the change scope matches what’s being shipped.