[WebGPU] Register DataTransfer to Env
This pull request adds a C API for WebGPU data transfer, enabling tensor copying between CPU and GPU devices via the WebGPU execution provider. The main changes introduce a wrapper implementation for data transfer, integrate it with the plugin execution provider factory, and expose a creation function for use by the ONNX Runtime core.
Please add override CreateDataTransfer:
https://github.com/microsoft/onnxruntime/blob/c30905d638418383b8d83b3b1bb65b7b42226f5a/onnxruntime/core/session/plugin_ep/ep_factory_internal_impl.h#L56-L59
in class WebGpuEpFactory (file in https://github.com/Microsoft/onnxruntime/blob/main/onnxruntime/core/session/plugin_ep/ep_factory_webgpu.h) for the purpose of this change.
Please add override
CreateDataTransfer:https://github.com/microsoft/onnxruntime/blob/c30905d638418383b8d83b3b1bb65b7b42226f5a/onnxruntime/core/session/plugin_ep/ep_factory_internal_impl.h#L56-L59
in class
WebGpuEpFactory(file in https://github.com/Microsoft/onnxruntime/blob/main/onnxruntime/core/session/plugin_ep/ep_factory_webgpu.h) for the purpose of this change.
WebGPU DataTransfer requires a BufferManager. For graph capture, the BufferManager is tied to the execution provider instance not session-independent. That's the problem.
Please add override
CreateDataTransfer:https://github.com/microsoft/onnxruntime/blob/c30905d638418383b8d83b3b1bb65b7b42226f5a/onnxruntime/core/session/plugin_ep/ep_factory_internal_impl.h#L56-L59
in class
WebGpuEpFactory(file in https://github.com/Microsoft/onnxruntime/blob/main/onnxruntime/core/session/plugin_ep/ep_factory_webgpu.h) for the purpose of this change.
Done. Use the context 0's buffer manager. Will create one if not exist.
@fs-eire @guschmue The webgpu related failures have been fixed. Others are not related with my changes. Please take a look, thanks.