ONNX Runtime WebGPU PR Monitor

Last Updated: 05/09/2026, 07:03 PM | Total: 227 PRs

Showing 1-10 of 39 PRs
Page 1 of 4
👤 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/09/2026
🤖 AI 摘要

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

📁 Changed Files (3 files, 82 changes: +76/-6)
onnxruntime/contrib_ops/webgpu/moe/gate.wgsl.template
onnxruntime/contrib_ops/webgpu/moe/gate_1token.wgsl.template
onnxruntime/test/contrib_ops/moe_test.cc
👤 xenova📅 Created: 05/08/2026
🤖 AI 摘要

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

📁 Changed Files (2 files, 60 changes: +56/-4)
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.cc
onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc
👤 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
👤 xiaofeihan1📅 Created: 05/08/2026
🤖 AI 摘要

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

📁 Changed Files (2 files, 8 changes: +4/-4)
onnxruntime/core/optimizer/graph_transformer_utils.cc
onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.h
👤 qjia7📅 Created: 05/07/2026
🤖 AI 摘要

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

📁 Changed Files (5 files, 188 changes: +124/-64)
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_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 (4 files, 32 changes: +22/-10)
onnxruntime/core/providers/webgpu/nn/conv.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/gemm_subgroup.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul.h
👤 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 (23 files, 4339 changes: +4320/-19)
docs/ContribOperators.md
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_mlp_wide_tile_m1.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/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