ONNX Runtime WebGPU PR Monitor

Last Updated: 05/06/2026, 07:48 PM | Total: 218 PRs

Showing 1-10 of 36 PRs
Page 1 of 4
👤 edgchen1📅 Created: 05/06/2026
🤖 AI 摘要

本 PR 标题为"[WebGPU plugin EP packaging] Remove explicit ORT package dependency",主要修改了 12 个文件,涉及 plugin-ep-webgpu、tools 等模块。代码变更包括 119 行新增和 77 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (12 files, 196 changes: +119/-77)
plugin-ep-webgpu/README.md
plugin-ep-webgpu/_packaging_utils.py
plugin-ep-webgpu/csharp/Microsoft.ML.OnnxRuntime.EP.WebGpu/Microsoft.ML.OnnxRuntime.EP.WebGpu.csproj
plugin-ep-webgpu/csharp/Microsoft.ML.OnnxRuntime.EP.WebGpu/README.md
plugin-ep-webgpu/csharp/pack_nuget.py
plugin-ep-webgpu/csharp/test/WebGpuEpNuGetTest/WebGpuEpNuGetTest.csproj
plugin-ep-webgpu/python/build_wheel.py
plugin-ep-webgpu/python/onnxruntime_ep_webgpu/README.md
plugin-ep-webgpu/python/pyproject.toml.in
tools/ci_build/github/azure-pipelines/stages/plugin-linux-webgpu-test-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-mac-webgpu-test-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml
plugin-ep-webgpu/release:0.1.0
👤 tianleiwu📅 Created: 05/05/2026
🤖 AI 摘要

本 PR 标题为"[CUDA Plugin EP] Add NuGet packaging pipeline",主要修改了 23 个文件,涉及 plugin-ep-cuda、plugin-ep-webgpu 等模块。代码变更包括 1195 行新增和 39 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (23 files, 1234 changes: +1195/-39)
plugin-ep-cuda/csharp/Microsoft.ML.OnnxRuntime.EP.Cuda/CudaEp.cs
plugin-ep-cuda/csharp/Microsoft.ML.OnnxRuntime.EP.Cuda/Microsoft.ML.OnnxRuntime.EP.Cuda.csproj
plugin-ep-cuda/csharp/Microsoft.ML.OnnxRuntime.EP.Cuda/README.md
plugin-ep-cuda/csharp/README.md
plugin-ep-cuda/csharp/pack_nuget.py
plugin-ep-cuda/csharp/test/CudaEpNuGetTest/CudaEpNuGetTest.csproj
plugin-ep-cuda/csharp/test/CudaEpNuGetTest/Program.cs
plugin-ep-cuda/csharp/test/CudaEpNuGetTest/generate_mul_model.py
plugin-ep-cuda/csharp/test/CudaEpNuGetTest/mul.onnx
plugin-ep-webgpu/README.md
tools/ci_build/github/azure-pipelines/stages/plugin-cuda-nuget-packaging-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-cuda-packaging-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-linux-cuda-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-linux-cuda-test-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-linux-webgpu-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-mac-webgpu-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-webgpu-nuget-packaging-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-win-cuda-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-win-cuda-test-stage.yml
tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-stage.yml
tools/ci_build/github/azure-pipelines/templates/set-plugin-ep-build-variables-step.yml
tools/ci_build/github/linux/docker/scripts/manylinux/install_centos.sh
tools/ci_build/set_plugin_ep_build_variables.py
👤 adrianlizarraga📅 Created: 05/05/2026
🤖 AI 摘要

本 PR 标题为"[Plugin EP] Session options getters",主要修改了 7 个文件,涉及 include、onnxruntime 等模块。代码变更包括 95 行新增和 0 行删除。 这是一个与 ONNX Runtime WebGPU 相关的改动,具体功能需要查看代码详情。

📁 Changed Files (7 files, 95 changes: +95/-0)
include/onnxruntime/core/session/onnxruntime_c_api.h
include/onnxruntime/core/session/onnxruntime_cxx_api.h
include/onnxruntime/core/session/onnxruntime_cxx_inline.h
onnxruntime/core/session/abi_session_options.cc
onnxruntime/core/session/onnxruntime_c_api.cc
onnxruntime/core/session/ort_apis.h
onnxruntime/test/shared_lib/test_session_options.cc
👤 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
👤 maxwbuckley📅 Created: 04/30/2026
🤖 AI 摘要

## PR 主要改动总结 **注意:此 PR 实际上与 WebGPU 无关,而是关于 CoreML EP 的改进** ### 核心改动 为 CoreML EP 添加了对 `com.microsoft:FusedConv` 算子的支持,覆盖 MLProgram 和 NeuralNetwork 两种执行路径。 ### 解决的问题 解决了预优化模型(通过 CPU EP 或 WebGPU 等 EP 优化并保存的模型)在 CoreML EP 上加载时的分区碎片化问题。之前当模型包含 `FusedConv` 节点时,CoreML EP 无法识别这些节点,导致无法有效执行。 ### WebGPU 关联 虽然 PR 针对 CoreML EP,但与 WebGPU 相关:当使用 WebGPU EP 优化模型并保存后,生成的 `FusedConv` 节点现在可以被 CoreML EP 正确处理,改善了跨平台模型部署的兼容性。 ### 技术要点 `FusedConv` 是 Conv+Activation 融合算子,由 ORT 的 `ConvActivationFusion` 优化 pass 生成。此改动主要影响移动端部署和 ORT 格式模型的使用场景,新增 132 行测试代码和 107 行实现代码。

📁 Changed Files (4 files, 243 changes: +240/-3)
onnxruntime/core/providers/coreml/builders/impl/conv_op_builder.cc
onnxruntime/core/providers/coreml/builders/op_builder_factory.cc
onnxruntime/test/providers/coreml/coreml_basic_test.cc
tools/ci_build/github/apple/coreml_supported_mlprogram_ops.md
👤 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
👤 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, 242 changes: +209/-33)
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
🤖 AI 摘要

## ONNX Runtime WebGPU PR 改动总结 ### 主要改动 此 PR 将 `GroupQueryAttention` 算子的 `present_key` 和 `present_value` 输出标记为可选项,并添加了对 Gemma 4 模型的支持。 ### 解决的问题 Gemma 4 模型包含 20 个 KV 共享的解码器层,这些层从源层借用 K/V 缓存而不需要维护自己的 KV cache。将输出改为可选避免了为这些层分配和填充冗余的 KV 张量,减少内存开销和计算浪费。 ### WebGPU 影响 WebGPU 实现已同步更新(`group_query_attention.cc`),添加了对可选 present 输出的验证逻辑,确保 `present_key` 和 `present_value` 要么同时存在要么同时缺失。 ### 技术要点 - 修改了算子 Schema 定义,使用 `OpSchema::Optional` 标记输出 - 在 CPU、CUDA 和 WebGPU 三个后端的内核中都添加了相应的验证逻辑 - 新增了 245 行测试代码以覆盖可选输出场景

📁 Changed Files (9 files, 614 changes: +550/-64)
docs/ContribOperators.md
onnxruntime/contrib_ops/cpu/bert/gqa_attention_base.h
onnxruntime/contrib_ops/cpu/bert/group_query_attention.cc
onnxruntime/contrib_ops/cpu/bert/group_query_attention_helper.h
onnxruntime/contrib_ops/cuda/bert/group_query_attention.cc
onnxruntime/contrib_ops/cuda/bert/group_query_attention_impl.cu
onnxruntime/contrib_ops/webgpu/bert/group_query_attention.cc
onnxruntime/core/graph/contrib_ops/bert_defs.cc
onnxruntime/test/contrib_ops/group_query_attention_op_test.cc