Skip to content

Native WebGPU EP fails to run model with in-memory external data #24768

Open
@huningxin

Description

@huningxin

Description

For models that are built by ModelEditorAPI, they may have initializers that are TensorProto with external data in existing memory buffer. For those TensorProto, the 'location' field of the external data info is set to a special marker */_ORT_MEM_ADDR_/*, and the 'offset' field contains the address of the memory buffer.

When running those models with native WebGPU EP, it reports error, for example the error log of running a "Conv" node with initializer using in-memory external data:

"ORT status error code: 6 error message: Non-zero status code returned while running Conv node. Name:'_0_token_1' Status Message: C:\workspace\onnxruntime\onnxruntime\core\providers\webgpu\webgpu_context.cc:210 onnxruntime::webgpu::WebGpuContext::Run std::all_of(inputs.begin(), inputs.end(), [](const ProgramInput& input) { const auto* tensor = input.tensor; return tensor != nullptr && tensor->Location().mem_type == OrtMemType::OrtMemTypeDefault && tensor->Location().device.Type() == OrtDevice::GPU && !strcmp(tensor->Location().name, WEBGPU_BUFFER); }) was false. All inputs must be tensors on WebGPU buffers."

It seems WebGPU EP doesn't upload the in-memory external weights to GPU buffer before running it.

/cc @fdwr @skottmckay @guschmue

Metadata

Metadata

Assignees

Labels

ep:WebGPUort-web webgpu providerplatform:webissues related to ONNX Runtime web; typically submitted using template

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions