Description
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.