ONNX Runtime WebGPU PR Monitor

Last Updated: 10/13/2026, 10:27 PM | Total: 619 PRs

Showing 1-10 of 108 PRs
Page 1 of 11
👤 aciddelgado📅 Created: 10/13/2026
🤖 AI 摘要

该改动将 ONNX Runtime WebGPU 的 FP16 MatMul GEMV 快速路径从仅支持 M=1 扩展到 1≤M≤8,旨在缓解推测解码中小 M 投影因切换到通用 MatMul 而出现的性能骤降,同时保留原有形状和结构约束。实现上,每行使用独立工作组,着色器从展平的工作组索引计算行号和列分组索引,并为输入输出访问添加行偏移,继续沿用 FP32 累加与归约。修改还涉及 MatMul 路径选择,并补充矩阵乘法与工作组调度归一化测试,以覆盖扩展后的执行场景。在 A100、WebGPU/Vulkan 环境下,针对 [M,5120]×[5120,48] 的独立内核测量显示,M=2、4、8 时相对通用 MatMul 约加速 5.15–5.57 倍;这些结果仅来自一次预热和三次测量的中位数,尚不能据此推断端到端生成收益或其他 GPU 上的表现。

📁 Changed Files (5 files, 259 changes: +218/-41)
onnxruntime/core/providers/webgpu/math/matmul.cc
onnxruntime/core/providers/webgpu/math/matmul.h
onnxruntime/core/providers/webgpu/math/matmul_gemv.wgsl.template
onnxruntime/test/providers/webgpu/dispatch_normalization_test.cc
onnxruntime/test/providers/webgpu/math/matmul_test.cc
👤 gyagp📅 Created: 10/13/2026
🤖 AI 摘要

该改动修复了 ONNX Runtime WebGPU 后端 Pow 算子在向量化广播路径中将标量操作数传给仅支持 vec4 的 pow_v 辅助函数的问题,覆盖底数为 [3,2,64,64]、指数为 [1,1,1,1] 等场景。实现上,将两个参数分别转换为各自元素类型的 vec4,使标量正确广播,同时保留底数与指数的混合类型。新增六项回归测试,覆盖双向广播、逐行 float/int32 混合类型及 FP16,并分别验证动态输入和初始化器指数;禁用 CPU 回退后,在 Windows x64 原生 WebGPU/D3D12 上确认修复前失败、修复后通过,共完成 12 次 GPU 执行且无跳过。该修复提升了 WebGPU Pow 广播与类型处理的正确性,但未提供性能测量,Metal 和浏览器/Wasm 平台的兼容性也尚未验证。

📁 Changed Files (2 files, 64 changes: +63/-1)
onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc
onnxruntime/test/providers/webgpu/math/element_wise_ops_test.cc
👤 edgchen1📅 Created: 10/12/2026
🤖 AI 摘要

该 PR 为 WebGPU EP 0.5.0 发布回合入两项修复,重点是共享数据传输的状态管理,以及恢复与 ONNX Runtime 1.24.4 的兼容性。关键调整包括将共享 WebGPU 数据传输改为无状态设计、采用按 Session 独立记录和串行化执行,并配套修改分配器、执行提供程序及工厂逻辑,新增运行时兼容性处理模块。这些改动旨在减少多 Session 共享资源时的状态耦合,以执行串行化保障兼容性和并发场景下的正确性,但也可能限制执行重叠,不能据此认定吞吐或延迟有所改善。测试侧大幅扩充了并发与分配器覆盖,并新增记录模式测试;现有信息未提供具体同步机制、兼容性判断条件或性能测量结果,因此无法量化其性能影响。

📁 Changed Files (24 files, 1306 changes: +1221/-85)
cmake/onnxruntime_providers_webgpu.cmake
cmake/onnxruntime_unittests.cmake
docs/WebGPU_External_Dawn.md
include/onnxruntime/ep/api.h
onnxruntime/core/providers/webgpu/allocator.cc
onnxruntime/core/providers/webgpu/allocator.h
onnxruntime/core/providers/webgpu/buffer_manager.cc
onnxruntime/core/providers/webgpu/compute_context.cc
onnxruntime/core/providers/webgpu/ep/README.md
onnxruntime/core/providers/webgpu/ep/allocator.cc
onnxruntime/core/providers/webgpu/ep/allocator.h
onnxruntime/core/providers/webgpu/ep/api.cc
onnxruntime/core/providers/webgpu/ep/factory.cc
onnxruntime/core/providers/webgpu/ep/runtime_compatibility.cc
onnxruntime/core/providers/webgpu/ep/runtime_compatibility.h
onnxruntime/core/providers/webgpu/webgpu_context.h
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc
onnxruntime/core/providers/webgpu/webgpu_provider_factory_creator.h
onnxruntime/test/providers/webgpu/plugin/test_webgpu_allocators.cc
onnxruntime/test/providers/webgpu/plugin/test_webgpu_concurrency.cc
onnxruntime/test/providers/webgpu/plugin/test_webgpu_recording_mode.cc
plugin-ep-webgpu/MIN_ONNXRUNTIME_VERSION
plugin-ep-webgpu/README.md
👤 kylo5aby📅 Created: 10/12/2026
🤖 AI 摘要

此改动修复了 If 分支直接返回、且未被分支内节点消费的 initializer 未获分配位置而默认留在 CPU 的问题,避免 If 运行于非 CPU 执行提供程序(EP)时,每次 Run 因分支输出源位置与取回目标不一致而产生两次拷贝。核心实现是在分配规划器的 ComputeValueLocation 中,将这类 initializer 放到 If 节点所属 EP 的默认设备,使其在会话初始化时一次性上传,运行时相关拷贝则变为设备到设备。对于 WebGPU 等非 CPU EP,这有助于减少重复的 CPU 到设备数据传输,但提供的信息未包含 WebGPU 专项测试或性能测量,无法量化收益。规则仅针对 If:Loop 的条件输出需取回 CPU,循环携带输出需匹配 Loop 输入位置,因此不适用父节点设备规则;Scan 也保持不变,并新增了针对 initializer 作为 If 子图输出的位置规划测试。

📁 Changed Files (2 files, 137 changes: +137/-0)
onnxruntime/core/framework/allocation_planner.cc
onnxruntime/test/framework/allocation_planner_test.cc
👤 qjia7📅 Created: 10/12/2026
🤖 AI 摘要

该 PR 修复 Windows 原生推理已完成并写出 profiling 结果后,进程退出仍可能卡在 1DS 遥测上传器清理流程的问题。实现上从已加载的 ntdll.dll 动态解析 RtlDllShutdownInProgress,在 OneDsTelemetry 析构函数获取遥测锁之前检测进程终止状态,并跳过上传器清理,因此退出时不会刷新待发送的遥测数据。该检测也适用于编译进 EP 插件 DLL 的遥测组件,正常对象析构和显式 FreeLibrary 仍走原有清理路径,非 Windows 行为不变,同时新增了 Windows 遥测生命周期测试及构建配置。此改动针对退出阶段的可靠性,不涉及 WebGPU 算子或 GPU 推理执行路径;现有信息未提供推理性能变化或具体 Windows 版本兼容性验证结果。

📁 Changed Files (8 files, 279 changes: +279/-0)
cmake/onnxruntime_unittests.cmake
onnxruntime/core/platform/telemetry_1ds.cc
onnxruntime/core/platform/telemetry_1ds.h
onnxruntime/core/platform/telemetry_1ds_platform.h
onnxruntime/core/platform/windows/telemetry_1ds.cc
onnxruntime/test/platform/windows_telemetry/lifecycle/telemetry_shutdown_test.cc
onnxruntime/test/platform/windows_telemetry/lifecycle/telemetry_shutdown_test_library.cc
onnxruntime/test/platform/windows_telemetry/lifecycle/telemetry_shutdown_test_library.def
👤 qjia7📅 Created: 10/12/2026
🤖 AI 摘要

此次改动将 WebGPU MatMul 执行计划的合法性检查前移到规划器,使 CreateExecutionPlan 返回 Status,并仅在验证成功后更新输出计划,强化“成功生成的计划满足主机侧已知执行前提”的接口契约。规划器统一检查算法与配置兼容性、算法执行前提、packed 调优参数、subgroup 大小一致性,以及 packed 和 Split-K 调度计算中的整数溢出,同时移除 MatMulComputeDispatcher 中重复的前提重建与校验逻辑。新增契约测试覆盖不受支持的强制请求、失败时输出保持不变、无效厂商配置和调度溢出,并同步更新设计文档。这主要提升了非法配置的提前拦截能力和规划、执行两阶段的一致性;现有信息未提供性能基准或设备覆盖结果,不能据此判断推理速度提升或硬件兼容范围扩大。

📁 Changed Files (8 files, 786 changes: +602/-184)
docs/design/webgpu_matmul_execution_planner.md
onnxruntime/core/providers/webgpu/math/matmul.cc
onnxruntime/core/providers/webgpu/math/matmul_execution_planner.cc
onnxruntime/core/providers/webgpu/math/matmul_execution_planner.h
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup_utils.h
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.cc
onnxruntime/test/providers/webgpu/matmul_execution_planner_test.cc
👤 xiaofeihan1📅 Created: 10/12/2026
🤖 AI 摘要

本次重构将 WebGPU 的上传、GPU 间拷贝和下载实现从 BufferManager 移至 DataTransferImpl,使数据传输直接使用上下文和命令录制对象,而 BufferManager 专注于缓冲区分配、缓存和释放。新增 Flush(recording) 以解除传输对缓冲区管理器的依赖,并在分配与调度路径中通过非拥有型原子指针将缓存管理器关联到命令录制对象,提交时仍按现有缓存策略处理待回收缓冲区。改动同步适配内置执行提供程序、插件及相关测试,旨在支持共享上下文下的独立命令录制,同时保留延迟调度顺序、暂存缓冲区对齐和提交行为。验证信息确认 Windows 原生 WebGPU 的 onnxruntime_provider_test 构建成功,但定向测试记录被截断,无法确认完整测试结果;该改动主要改善职责划分与调用兼容性,未提供性能数据,不能据此认定推理或传输速度提升。

📁 Changed Files (15 files, 406 changes: +245/-161)
onnxruntime/core/providers/webgpu/buffer_manager.cc
onnxruntime/core/providers/webgpu/buffer_manager.h
onnxruntime/core/providers/webgpu/data_transfer.cc
onnxruntime/core/providers/webgpu/data_transfer.h
onnxruntime/core/providers/webgpu/ep/sync_stream.cc
onnxruntime/core/providers/webgpu/webgpu_context.cc
onnxruntime/core/providers/webgpu/webgpu_context.h
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc
onnxruntime/test/providers/webgpu/concurrent_context_test.cc
onnxruntime/test/providers/webgpu/contrib_ops/moe_test.cc
onnxruntime/test/providers/webgpu/dispatch_normalization_test.cc
onnxruntime/test/providers/webgpu/plugin/test_webgpu_allocators.cc
onnxruntime/test/providers/webgpu/webgpu_context_test.cc
onnxruntime/test/providers/webgpu/webgpu_stream_regression_test.cc
👤 daijh📅 Created: 10/12/2026
🤖 AI 摘要

此次改动聚焦于 ONNX Runtime WebGPU 后端的 MatMulNBits 低比特量化矩阵乘法,目的是整理宽分块(wide-tile)实现的选择与调用流程,而非新增计算功能。通过采用 CanApplyWideTileMatMulNBits() 和 ApplyWideTileMatMulNBits(),将适用条件判断与执行逻辑分别封装,使实现选择流程更清晰。结合主要实现文件的调整及公共文件中代码的移除,可以判断这是相关逻辑的组织重构,但现有信息未给出具体适用条件或分块参数。PR 明确声明功能不变,因此不应将其视为 WebGPU 算法优化或兼容性扩展;同时缺少性能基准与兼容性测试结果,无法据此确认吞吐、延迟或设备支持范围有变化。

📁 Changed Files (4 files, 240 changes: +122/-118)
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_common.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_common.h
👤 dannyota📅 Created: 10/11/2026
🤖 AI 摘要

该 PR 将 Go 绑定同步到 ONNX Runtime C API 32,并补充插件执行提供程序(EP)的接入能力,主要涉及 Go 封装、C shim 桥接和测试,而非 GPU 算子实现。初始化时按已加载运行时的版本请求匹配的 API,并回退到 API 17,避免逐级探测失败时向 stderr 输出噪声;新增接口在运行时版本不足时返回类型化错误。新增能力包括 API 22 起支持的插件 EP 库注册与注销、设备发现和选择,以及 API 29 起支持的无权重编译模型源缓冲区设置,另有从内存读取 EPContext 数据的封装与桥接测试,但描述未完整给出后者的版本要求。这些改动为 Go 应用接入插件 EP、选择加速设备和使用编译模型提供了接口基础,但未提供 WebGPU 专用实现、支持矩阵或性能测试结果,因此不能据此认定新增了 WebGPU 支持或直接提升了 GPU 推理性能。

📁 Changed Files (24 files, 5397 changes: +5284/-113)
go/onnxruntime/compiler_command_test.go
go/onnxruntime/cshim.c
go/onnxruntime/cshim.h
go/onnxruntime/doc.go
go/onnxruntime/ep.go
go/onnxruntime/ep_context.go
go/onnxruntime/ep_context_bridge_test.go
go/onnxruntime/ep_context_test.go
go/onnxruntime/ep_context_testbridge.go
go/onnxruntime/ep_integration_test.go
go/onnxruntime/ep_test.go
go/onnxruntime/errors.go
go/onnxruntime/iobinding.go
go/onnxruntime/iobinding_test.go
go/onnxruntime/onnxruntime_c_api.h
go/onnxruntime/onnxruntime_ep_c_api.h
go/onnxruntime/onnxruntime_error_code.h
go/onnxruntime/options.go
go/onnxruntime/options_test.go
go/onnxruntime/ort.go
go/onnxruntime/ort_test.go
go/onnxruntime/session.go
go/testdata/gen_models.py
go/testdata/mul_f32.onnx
👤 gyagp📅 Created: 10/11/2026
🤖 AI 摘要

该 PR 将 Windows WebGPU CI 中重复执行的完整算子数值测试集中到共享插件任务,并补齐共享插件此前缺失的 WebGPU 算子与私有实现测试覆盖。实现上新增私有测试运行器、测试内核及插件测试入口,通过 CMake 接入构建,复用生产插件已编译的 provider 对象,并拆分或调整 MoE、并发上下文等测试。共享插件承担完整 provider/算子测试、插件集成、框架与设备选择及 Java WebGPU 推理验证;静态插件和内置 WebGPU 配置则保留分配器、并发、框架集成等针对性检查,内置配置继续覆盖 vcpkg 与非 vcpkg 构建及 D3D12 加速加载。此调整旨在减少不同构建模式之间的昂贵测试重复,同时加强共享插件路径的覆盖;现有信息未提供 CI 耗时对比,也不足以判断 GPU 推理性能或运行时兼容性是否发生变化。

📁 Changed Files (30 files, 1558 changes: +1328/-230)
.github/workflows/windows_webgpu.yml
cmake/CMakeLists.txt
cmake/onnxruntime_unittests.cmake
docs/WebGPU_CI.md
java/build.gradle
java/src/test/java/ai/onnxruntime/InferenceTest.java
onnxruntime/core/providers/webgpu/webgpu_execution_provider.h
onnxruntime/test/autoep/test_autoep_utils.h
onnxruntime/test/autoep/test_selection.cc
onnxruntime/test/contrib_ops/causal_conv_with_state_op_test.cc
onnxruntime/test/contrib_ops/matmul_2bits_test.cc
onnxruntime/test/providers/webgpu/concurrent_context_test.cc
onnxruntime/test/providers/webgpu/concurrent_internal_test.cc
onnxruntime/test/providers/webgpu/contrib_ops/moe_internal_test.cc
onnxruntime/test/providers/webgpu/contrib_ops/moe_test.cc
onnxruntime/test/providers/webgpu/dispatch_normalization_test.cc
onnxruntime/test/providers/webgpu/internal_test.lds
onnxruntime/test/providers/webgpu/internal_test_api.h
onnxruntime/test/providers/webgpu/internal_test_kernel.cc
onnxruntime/test/providers/webgpu/internal_test_kernel.h
onnxruntime/test/providers/webgpu/internal_test_main.cc
onnxruntime/test/providers/webgpu/internal_test_runner.cc
onnxruntime/test/providers/webgpu/matmul_large_test.cc
onnxruntime/test/providers/webgpu/plugin_factory_test.cc
onnxruntime/test/providers/webgpu/test_plugin.cc
onnxruntime/test/providers/webgpu/test_plugin.h
onnxruntime/test/providers/webgpu/webgpu_context_test.cc
onnxruntime/test/providers/webgpu/webgpu_stream_regression_test.cc
onnxruntime/test/util/default_providers.cc
onnxruntime/test/webgpu/delay_load/main.cc