ONNX Runtime WebGPU PR Monitor

Last Updated: 05/12/2026, 07:53 PM | Total: 229 PRs

Showing 1-10 of 38 PRs
Page 1 of 4
🤖 AI 摘要

本 PR 标题为"[WebGPU] Correct MatMul bias input indexing in `MatMul::ComputeInternal`",主要修改了 1 个文件,涉及 onnxruntime 等模块。代码变更包括 1 行新增和 1 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (1 files, 2 changes: +1/-1)
onnxruntime/core/providers/webgpu/math/matmul.cc
ep:WebGPU
👤 xhcao📅 Created: 05/09/2026
🤖 AI 摘要

本 PR 标题为"webgpu: support vec2 type for gemm-subgroup",主要修改了 7 个文件,涉及 onnxruntime 等模块。代码变更包括 57 行新增和 48 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (7 files, 105 changes: +57/-48)
onnxruntime/core/providers/webgpu/math/matmul.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm.h
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.h
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.h
👤 xenova📅 Created: 05/08/2026
🤖 AI 摘要

本 PR 标题为"[WebGPU] Fix SkipSimplifiedLayerNormalization bias",主要修改了 2 个文件,涉及 onnxruntime 等模块。代码变更包括 56 行新增和 4 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (2 files, 64 changes: +60/-4)
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.cc
onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc
ep:WebGPU
👤 daijh📅 Created: 05/08/2026
🤖 AI 摘要

本 PR 标题为"[webgpu] Optimize LinearAttention Op with subgroup",主要修改了 3 个文件,涉及 onnxruntime 等模块。代码变更包括 137 行新增和 5 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (3 files, 142 changes: +137/-5)
onnxruntime/contrib_ops/webgpu/bert/linear_attention.cc
onnxruntime/contrib_ops/webgpu/bert/linear_attention.h
onnxruntime/contrib_ops/webgpu/bert/linear_attention.wgsl.template
ep:WebGPU
🤖 AI 摘要

本 PR 标题为"webgpu: Extend FlashAttention decode path for any sequence length",主要修改了 5 个文件,涉及 onnxruntime 等模块。代码变更包括 124 行新增和 64 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (6 files, 777 changes: +368/-409)
onnxruntime/contrib_ops/webgpu/bert/flash_attention.cc
onnxruntime/contrib_ops/webgpu/bert/flash_attention.h
onnxruntime/contrib_ops/webgpu/bert/flash_attention_decode_qkt.wgsl.template
onnxruntime/contrib_ops/webgpu/bert/flash_attention_decode_qkv.wgsl.template
onnxruntime/contrib_ops/webgpu/bert/flash_attention_decode_split_vx.wgsl.template
onnxruntime/contrib_ops/webgpu/bert/flash_attention_decode_vx_reduce.wgsl.template
👤 danielsongmicrosoft📅 Created: 05/04/2026
🤖 AI 摘要

本 PR 标题为"Add python implementation for wgsl-gen",主要修改了 18 个文件,涉及 onnxruntime、cmake 等模块。代码变更包括 3864 行新增和 28 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (18 files, 3736 changes: +3708/-28)
cmake/onnxruntime_providers_webgpu.cmake
onnxruntime/core/providers/webgpu/wgsl_templates/README.md
tools/python/wgsl_gen.py
tools/python/wgsl_template/__init__.py
tools/python/wgsl_template/code_generator/__init__.py
tools/python/wgsl_template/code_generator/static_cpp.py
tools/python/wgsl_template/code_pattern.py
tools/python/wgsl_template/errors.py
tools/python/wgsl_template/generator.py
tools/python/wgsl_template/loader.py
tools/python/wgsl_template/parser.py
tools/python/wgsl_template/test/run_tests.py
tools/python/wgsl_template/test/test_build.py
tools/python/wgsl_template/test/test_generator.py
tools/python/wgsl_template/test/test_in_tree_smoke.py
tools/python/wgsl_template/test/test_loader.py
tools/python/wgsl_template/test/test_parser.py
tools/python/wgsl_template/types.py
ep:WebGPU
👤 hariharans29📅 Created: 05/02/2026
🤖 AI 摘要

## PR 主要改动总结 ### 1. 主要功能改动 该 PR 重构了 WebGPU 的 BufferManager 创建时机和路由机制,采用延迟创建(lazy creation)策略,并引入 `graph_buffer_mgr_active_` 标志来控制图模式下的 buffer 管理器在 OnRunStart/OnRunEnd 之间的激活状态。 ### 2. 解决的核心问题 修复了图捕获(graph capture)首次重放时的**陈旧缓冲区绑定问题**:当启用图捕获时,捕获的命令持有捕获阶段的 buffer 指针,如果分配器在首次 Replay() 前释放并重用了内存槽位,会导致调度读取过期内存,产生错误的 logits 张量输出,影响模型推理正确性。 ### 3. 对 WebGPU 支持的影响 该修复对 WebGPU 的图捕获优化功能至关重要,特别是在 MatMulNBits MLP/QKV 融合等会改变内存分配模式的场景下,确保了固定形状解码和动态形状推理的正确性。 ### 4. 技术要点 - 重构 `GpuBufferAllocator` 使用 `std::function<const BufferManager&()>` 动态解析活跃的 buffer 管理器 - 新增 `WebGpuContext::WaitForQueueIdle()` 和 `ComputeContextBase::FlushAndWait()` 辅助方法用于 buffer 管理器生命周期管理 - 通过门控机制避免在非图执行期间使用图模式的 buffer 管理器

📁 Changed Files (7 files, 69 changes: +49/-20)
onnxruntime/core/providers/webgpu/allocator.cc
onnxruntime/core/providers/webgpu/allocator.h
onnxruntime/core/providers/webgpu/compute_context.h
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_execution_provider.h
ep:WebGPU
👤 xhcao📅 Created: 04/30/2026
🤖 AI 摘要

## ONNX Runtime WebGPU PR 改动总结 ### 主要改动 此 PR 将 `gemm-subgroup` 优化扩展到 Conv(卷积)算子,并根据工作组(workgroup)数量动态决定是否启用 gemm-subgroup 优化。 ### 解决的问题 为 WebGPU 后端的卷积操作引入了 subgroup 级别的 GEMM 优化,增强了英特尔硬件上的性能表现,同时添加了基于工作组数量的智能启用机制,避免在不适合的场景下使用该优化。 ### 技术要点 - 修改了 matmul 相关代码,增加工作组数量参数传递(添加参数到函数接口) - 在 conv.cc 中集成了 gemm-subgroup 支持 - 优化决策逻辑更加智能化,根据实际计算规模动态选择是否使用 subgroup 优化 ### 影响范围 代码改动较小(22 行新增,10 行删除),主要集中在英特尔厂商特定的数学运算优化模块,对 WebGPU 的卷积性能有积极影响。

📁 Changed Files (8 files, 189 changes: +172/-17)
onnxruntime/core/providers/webgpu/math/matmul.cc
onnxruntime/core/providers/webgpu/nn/conv.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.h
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.h
onnxruntime/test/providers/webgpu/conv_large_test.cc
👤 hariharans29📅 Created: 04/30/2026
🤖 AI 摘要

## PR 主要改动总结 ### 核心功能 此 PR 为 ONNX Runtime 的 WebGPU 后端添加了两个专门针对 Qwen3 模型的图融合优化,分别是 **MatMulNBitsMlp** 和 **MatMulNBitsQkv** 融合算子及其对应的 kernel 实现。 ### 解决的问题 - **MatMulNBitsMlp**:将 SwiGLU MLP 块中的 5-7 个独立操作(可选的 LayerNorm + 两个 MatMulNBits 投影 + 可选 bias + Sigmoid/Mul(SiLU) + 逐元素乘法)融合为单次 dispatch,显著减少 GPU 调用开销 - **MatMulNBitsQkv**:将注意力机制中的 4 个操作(可选的 LayerNorm + 三个共享输入的 Q/K/V 投影)融合为单次 dispatch ### WebGPU 支持影响 这两个融合专为 WebGPU 优化,通过减少多次 kernel 调度和中间数据传输,大幅提升 Qwen3 等 Transformer 模型在 WebGPU 上的推理性能,特别是在量化(N-bit)场景下。 ### 技术要点 重构了现有 `MatMulNBits` 的调度逻辑以便新融合 kernel 复用判断条件;新增完整的 op schema、WGSL shader 模板以及对应的图优化和单元测试,共新增约 3800 行代码。

📁 Changed Files (27 files, 4334 changes: +4301/-33)
docs/ContribOperators.md
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.cc
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_common.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_common.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_mlp.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_mlp.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_mlp.wgsl.template
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_qkv.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_qkv.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_qkv.wgsl.template
onnxruntime/contrib_ops/webgpu/webgpu_contrib_kernels.cc
onnxruntime/core/graph/contrib_ops/contrib_defs.cc
onnxruntime/core/optimizer/graph_transformer_utils.cc
onnxruntime/core/optimizer/matmul_nbits_mlp_fusion.cc
onnxruntime/core/optimizer/matmul_nbits_mlp_fusion.h
onnxruntime/core/optimizer/matmul_nbits_qkv_fusion.cc
onnxruntime/core/optimizer/matmul_nbits_qkv_fusion.h
onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.h
onnxruntime/core/providers/webgpu/nn/layer_norm.cc
onnxruntime/core/providers/webgpu/nn/layer_norm.h
onnxruntime/test/optimizer/graph_transform_utils_test.cc
onnxruntime/test/optimizer/matmul_nbits_mlp_fusion_test.cc
onnxruntime/test/optimizer/matmul_nbits_qkv_fusion_test.cc
onnxruntime/test/optimizer/webgpu_fusion_test_util.h
onnxruntime/test/util/default_providers.cc
ep:WebGPU
👤 qjia7📅 Created: 04/29/2026
🤖 AI 摘要

## PR 主要改动总结 **核心改动:** 为 ONNX Runtime WebGPU 实现了基于图标注 ID 的独立缓冲区管理器(per-graph buffer manager),替换原有的全局共享缓冲区管理器。这使得多个使用不同提示词的生成器可以各自拥有隔离的缓冲区缓存。 **解决的问题:** 修复了在启用图捕获(graph capture)时,多个生成器之间可能发生的缓冲区数据污染问题。通过为每个图分配独立的缓冲区管理器,确保不同生成器的执行互不干扰。 **技术要点:** 1. 引入 `per_graph_buffer_mgrs_` 映射表,以图标注 ID 为键存储各自的缓冲区管理器 2. 重构 `GpuBufferAllocator`,将固定的 `const BufferManager&` 改为支持动态路由的指针和 `SetBufferManager()` 方法 3. 新增 `ReleaseGraph` API 贯穿整个调用栈(从 EP 基类到 C API),允许在生成器销毁时释放已捕获的图资源,包括命令、缓冲区管理器和跟踪状态

📁 Changed Files (17 files, 252 changes: +215/-37)
include/onnxruntime/core/framework/execution_provider.h
include/onnxruntime/core/session/onnxruntime_c_api.h
include/onnxruntime/core/session/onnxruntime_ep_c_api.h
onnxruntime/core/providers/webgpu/allocator.cc
onnxruntime/core/providers/webgpu/allocator.h
onnxruntime/core/providers/webgpu/ep/ep.cc
onnxruntime/core/providers/webgpu/ep/ep.h
onnxruntime/core/providers/webgpu/ep/factory.cc
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/core/providers/webgpu/webgpu_execution_provider.h
onnxruntime/core/session/inference_session.cc
onnxruntime/core/session/inference_session.h
onnxruntime/core/session/onnxruntime_c_api.cc
onnxruntime/core/session/ort_apis.h
onnxruntime/core/session/ort_version_check.h
onnxruntime/core/session/plugin_ep/ep_plugin_provider_interfaces.cc
onnxruntime/core/session/plugin_ep/ep_plugin_provider_interfaces.h