ONNX Runtime WebGPU PR Monitor

Last Updated: 10/27/2026, 10:00 PM | Total: 691 PRs

Showing 1-10 of 120 PRs
Page 1 of 12
👤 edgchen1📅 Created: 10/27/2026
🤖 AI 摘要

该 PR 修复 ONNX Runtime 在 Windows 上的 WebGPU 插件执行提供程序(EP)打包流水线,重点是确保 Dawn 所需的固定版本 Agility SDK 能通过配置的 NuGet 源获取并用于打包。实现上新增暂存脚本,使用 nuget.exe 下载 SDK、校验 SHA1,并将其放入本地 CMake 依赖镜像,同时调整 Windows WebGPU 流水线和 CMake 外部依赖配置以接入该流程。新增的针对性回归测试用于验证这一依赖获取与暂存流程,但现有信息未列出具体测试场景。该改动主要改善构建与打包的可靠性及依赖版本一致性,不涉及已知的 GPU 推理计算路径优化;由于缺少 SDK 版本、运行时变更和基准数据,无法据此判断性能或设备兼容性是否有所提升。

📁 Changed Files (4 files, 361 changes: +361/-0)
cmake/external/onnxruntime_external_deps.cmake
tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-stage.yml
tools/ci_build/github/windows/stage_dawn_agility_sdk.py
tools/ci_build/github/windows/stage_dawn_agility_sdk_test.py
👤 justinchuby📅 Created: 10/27/2026
🤖 AI 摘要

该 PR 为现有 com.microsoft::QMoE v1 增加可选的 activation_quantization="dynamic_fp8",在 CUDA 上实现原生动态 W8A8 推理,支持 FLOAT、FLOAT16 和 BFLOAT16 输入、路由及输出张量,默认 "none" 仍保持仅权重量化执行。实现保留 E4M3FN 专家权重及 FP32 方形块缩放网格,复用稀疏路由和独立 gate/up 或融合 SwiGLU 布局,在 gate/up 投影前及 FP32 SiLU/SwiGLU 后按连续 K128 分组动态量化,并通过原生 FP8 mma.sync.m16n8k32 指令计算、以 FP32 应用各组缩放。量化采用饱和最近偶数舍入、指定的缩放公式和 FP32 div.full 归一化,避免第二次量化前额外的 FP16/BF16 舍入,并增加确定性回归测试覆盖 FP8 中点附近的一 ULP 差异。算子定义、CUDA 类型注册、形状推断测试及文档也同步调整;WebGPU 和 CPU 侧仅有少量配套修改,现有信息不足以确认它们支持该动态 FP8 模式,也未提供 GPU 架构要求或性能基准,因此不能断言跨后端可用性或具体加速幅度。

📁 Changed Files (13 files, 1124 changes: +1068/-56)
docs/ContribOperators.md
docs/contrib_ops/cuda/moe_qmoe.md
onnxruntime/contrib_ops/cpu/moe/moe_quantization_cpu.cc
onnxruntime/contrib_ops/cuda/cuda_contrib_kernels.cc
onnxruntime/contrib_ops/cuda/moe/moe_quantization.cc
onnxruntime/contrib_ops/cuda/moe/moe_quantization.h
onnxruntime/contrib_ops/cuda/moe/qmoe_kernels.cu
onnxruntime/contrib_ops/cuda/moe/qmoe_kernels.h
onnxruntime/contrib_ops/webgpu/moe/qmoe.h
onnxruntime/core/graph/contrib_ops/contrib_defs.cc
onnxruntime/test/contrib_ops/cuda_kernels/qmoe_fp8_compaction_test.cc
onnxruntime/test/contrib_ops/qmoe_shape_inference_test.cc
onnxruntime/test/python/transformers/test_qmoe_fp8_cuda.py
👤 SharmaRithik📅 Created: 10/27/2026
🤖 AI 摘要

该 PR 为 ONNX Runtime 的 WebGPU subgroup matrix MatMul 增加 NVIDIA 专用的共享内存分块路径,由工作组内多个 subgroup 协作将 A、B 的 K 维切片暂存到共享内存,再从中加载 subgroup 矩阵,以提高数据复用、减少重复访问全局内存。实现涉及 WGSL 内核、C++ 分块选择与设备限制检查,并同步更新生成代码和 MatMul 测试:采用 4×4 subgroup 网格和深度为 64 的 K 切片,大规模问题计算 128×128 输出块,其余适用场景计算 64×64 输出块。小规模问题保留原有 split-K 分块以更充分利用 GPU,各候选分块均检查设备限制,并以原有分块作为回退;该路径仅对 NVIDIA 启用,其他厂商保持不变。分块参数已在 RTX 5080 和 RTX 4070 上通过 ORT 实测调优,但提供的 Linux/Vulkan prefill 基准表缺少模型条目和加速数据,因此无法量化实际性能收益。

📁 Changed Files (16 files, 3868 changes: +2290/-1578)
onnxruntime/core/providers/webgpu/math/subgroup_matrix_matmul.cc
onnxruntime/core/providers/webgpu/math/subgroup_matrix_matmul.wgsl.template
onnxruntime/core/providers/webgpu/math/subgroup_matrix_tiling.h
onnxruntime/test/providers/webgpu/math/matmul_test.cc
tools/python/wgsl_template/test/in_tree_golden/static-cpp-literal/generated/math/subgroup_matrix_matmul.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp-literal/index.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp-literal/index_impl.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/math/subgroup_matrix_matmul.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/math/subgroup_matrix_matmul_pad_b.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/nn/conv_transpose3d.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/nn/im2col_matmul.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/tensor/oihw_to_ohwi.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/generated/tensor/pad.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/index.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/index_impl.h
tools/python/wgsl_template/test/in_tree_golden/static-cpp/string_table.h
👤 qjia7📅 Created: 10/27/2026
🤖 AI 摘要

该 PR 将可复用的 MatMulNBits 内核优化从 QLoRA 相关 PR 中拆出,使 WebGPU 在一次调用内的多个投影能够共享激活量化结果和 subgroup-matrix 输入预打包结果,减少重复准备开销。计算路径上,将现有 K 维并行 DP4A 调度扩展到 N ≤ 32、K ≥ 2048 的 INT2/4/8 窄投影,并以 FP32 累加部分和;固定 64×64 的 DP4AMatMulNBitsProgram、其调度和 WGSL 着色器保持不变。测试改动覆盖输入准备、WebGPU MatMulNBits 及 2/4/8 位量化场景,但现有信息不足以确认具体误差阈值或跨设备兼容性。已给出的 RTX 5080、Windows、块大小 32、启用图捕获的完整数据表明,128×2048×32 的 INT8 权重/FP16 激活场景中,包含准备与乘法的 GPU 耗时在 D3D12 上由 47 降至 10 微秒、Vulkan 上由 52 降至 14 微秒;其余性能数据不完整,不能据此推断其他形状或硬件的收益。

📁 Changed Files (12 files, 759 changes: +592/-167)
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_k_parallel.wgsl.template
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_nbits.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.h
onnxruntime/contrib_ops/webgpu/quantization/subgroup_matrix_matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/subgroup_matrix_matmul_nbits.h
onnxruntime/test/contrib_ops/matmul_2bits_test.cc
onnxruntime/test/contrib_ops/matmul_4bits_test.cc
onnxruntime/test/contrib_ops/matmul_8bits_test.cc
onnxruntime/test/providers/webgpu/contrib_ops/matmul_nbits_test.cc
onnxruntime/test/providers/webgpu/matmul_nbits_input_preparation_test.cc
👤 gyagp📅 Created: 10/27/2026
🤖 AI 摘要

该 PR 修复了 WebGPU 插件通过 EP API 适配器转换 CPU 张量时可能导致进程终止的问题,尤其涉及 C# 默认使用的 OrtMemType.Cpu 描述符:适配器误将值为 -1 的 OrtMemType 作为仅接受 0 或 5 的 OrtDevice::MemoryType,导致校验异常越过 noexcept 构造函数边界。核心修复是在重建 OrtDevice 时使用 GetDeviceMemoryType(),同时保留独立的 OrtMemType 字段,使合法的 CPU 和主机可访问内存描述符通过现有校验。新增回归测试覆盖默认、CPU 输入、CPU 输出及主机可访问内存描述符,通过同一输入被 CPU 与 GPU 共同消费的推理图,并结合性能分析记录确认 MemcpyFromHost 实际执行。C# NuGet 冒烟测试还改为按库路径选择已注册插件,避免内置 WebGPU 后端意外满足测试条件;整体改动提升了插件的内存描述符兼容性和运行稳定性,但未提供性能基准,不能据此判断推理速度变化。

📁 Changed Files (3 files, 125 changes: +121/-4)
include/onnxruntime/ep/adapter/tensor_helper.h
onnxruntime/test/providers/webgpu/plugin/test_webgpu_allocators.cc
plugin-ep-webgpu/csharp/test/WebGpuEpNuGetTest/Program.cs
👤 aciddelgado📅 Created: 10/26/2026
🤖 AI 摘要

该 PR 为 ONNX Runtime 的 WebGPU MatMulNBits 新增 small-M SIMT 内核,默认用于受支持的大尺寸 INT4 投影,旨在降低少量激活行计算时现有 subgroup-matrix 路径的开销。内核采用 128 线程、BN8/BK512 分块及 72 字节共享内存行步长,以高效处理多个激活行。当 2 ≤ M ≤ 8、K 和 N 均不小于 4096,且满足 FP16 激活、INT4 权重、量化块大小为 32 等支持条件时,该内核的选择优先于 subgroup-matrix 和 DP4A;其他形状和配置(包括较小投影)保持原有选择逻辑。改动还补充了 WebGPU 量化 MatMulNBits 测试,但提供的性能章节不完整,缺少基准数据和测试硬件信息,无法量化实际加速幅度。

📁 Changed Files (4 files, 399 changes: +399/-0)
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_small_m_simt.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_small_m_simt.h
onnxruntime/test/providers/webgpu/quantization/matmul_nbits_test.cc
👤 eserscor📅 Created: 10/26/2026
🤖 AI 摘要

该 PR 在前置 PR 已集中管理 CI SDK 配置的基础上,将 GitHub Actions 和 Azure Pipelines 的共享 .NET SDK 选择从 8.x 升至 10.x,并同步迁移 C# 托管库、测试、示例、性能工具、API 文档及插件消费者。托管库与共享测试改为面向 netstandard2.0 和 net10.0,同时更新框架条件编译与必要的编译修复,并保留 E2E 启动器显式指定 net462 的兼容路径。移动端项目、工作负载及原生 NuGet 依赖和资产分组也随之对齐 .NET 10,包括 Android 36.0、iOS/Mac Catalyst 18.7 库平台版本。对 Node/WebGPU 的影响主要是既有打包流程使用的共享 SDK 升级,现有信息未显示 WebGPU 执行提供程序、GPU 内核或推理算法发生变化;由于缺少性能基准和跨平台验证结果,不能据此认定推理性能提升或所有目标平台均已验证兼容。

📁 Changed Files (30 files, 622 changes: +368/-254)
.github/actions/setup-dotnet/action.yml
.github/workflows/publish-csharp-apidocs.yml
csharp/ApiDocs/ApiDocs.csproj
csharp/ApiDocs/docfx.json
csharp/readme.md
csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.Maui/Microsoft.ML.OnnxRuntime.InferenceSample.Maui.csproj
csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp/Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj
csharp/sample/Microsoft.ML.OnnxRuntime.ResNet50v2Sample/Microsoft.ML.OnnxRuntime.ResNet50v2Sample.csproj
csharp/sample/Microsoft.ML.OnnxRuntime.ResNet50v2Sample/readme.md
csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
csharp/src/Microsoft.ML.OnnxRuntime/OrtValue.shared.cs
csharp/src/Microsoft.ML.OnnxRuntime/targets/net10.0-android/targets.xml
csharp/src/Microsoft.ML.OnnxRuntime/targets/net10.0-ios/targets.xml
csharp/src/Microsoft.ML.OnnxRuntime/targets/net10.0-maccatalyst/README.md
csharp/src/Microsoft.ML.OnnxRuntime/targets/net10.0-maccatalyst/_._
csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Mobile/EndToEndTests.Mobile.Automation/EndToEndTests.Mobile.Automation.csproj
csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj
csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.bat
csharp/test/Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android/.config/dotnet-tools.json
csharp/test/Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android/Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android.csproj
csharp/test/Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android/README.md
csharp/test/Microsoft.ML.OnnxRuntime.Tests.BrowserStack.Android/browserstack.yml
csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/Microsoft.ML.OnnxRuntime.Tests.Common.csproj
csharp/test/Microsoft.ML.OnnxRuntime.Tests.MAUI/Microsoft.ML.OnnxRuntime.Tests.MAUI.csproj
csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/InferenceTest.netcore.cs
csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj
csharp/tools/MauiModelTester/MauiModelTester.csproj
csharp/tools/Microsoft.ML.OnnxRuntime.PerfTool/Microsoft.ML.OnnxRuntime.PerfTool.csproj
plugin-ep-cuda/csharp/README.md
plugin-ep-cuda/csharp/test/CudaEpNuGetTest/CudaEpNuGetTest.csproj
🤖 AI 摘要

该 PR 针对 Qwen3.5 / Qwen3.8 线性注意力的 prefill 和推测解码场景,优化 ONNX Runtime 的 CUDA GatedDeltaNet 与 GatedRMSNorm,目标平台为 SM80+/SM90 GPU,不涉及 WebGPU 后端的直接修改。在共享矩阵运算辅助代码中,SM80+ 路径使用硬件 ldmatrix 替代标量共享内存加载与半精度打包,并通过向量化读写、直接写回共享内存及 SyncBeforeStore 支持优化数据搬运和同步。三角逆构建将前向替代所用的线程局部数组移至共享内存,使该数组对应的栈占用从 64 字节降至 0,同时新增 GatedRMSNormWarp128Kernel 并调整相关算子测试。这些改动旨在降低访存、指令和临时存储开销,但提供的描述在屏障优化部分被截断,且缺少性能数据、新内核调度条件及测试结果,因此无法确认具体加速幅度或完整的兼容性覆盖。

📁 Changed Files (6 files, 734 changes: +546/-188)
onnxruntime/contrib_ops/cuda/bert/gated_delta_net_impl.cu
onnxruntime/contrib_ops/cuda/bert/gated_delta_net_mma.cuh
onnxruntime/contrib_ops/cuda/bert/gated_delta_net_split_impl.cu
onnxruntime/contrib_ops/cuda/bert/linear_attention_gates_impl.cu
onnxruntime/test/contrib_ops/gated_delta_net_op_test.cc
onnxruntime/test/contrib_ops/linear_attention_gates_op_test.cc
model:qwen
👤 usmanmateen📅 Created: 10/26/2026
🤖 AI 摘要

该 PR 修复 ONNX Runtime CPU 执行提供程序中 FP16 分组卷积的权重打包偏移和偏置分组错误,其中权重打包问题出现在 arm64 的 NEON half GEMM 路径,x64 不会进入该路径。关键修改是按字节计算打包权重偏移,避免将 MlasHalfGemmPackBSize 返回的字节数用于 MLFloat16 指针步进,导致第二组起的权重写入和读取越界;同时为每组 GEMM 传入对应的偏置切片,而非重复使用第一组偏置。改动主要改善推理正确性和内存访问安全,不涉及 WebGPU,也没有性能数据支持加速结论。PR 新增了 CPU FP16 卷积测试,并说明曾交叉编译 aarch64 测试程序后通过 QEMU 运行,但测试结果描述被截断,无法确认具体通过情况。

📁 Changed Files (2 files, 52 changes: +49/-3)
onnxruntime/core/providers/cpu/fp16/fp16_conv.cc
onnxruntime/test/providers/cpu/nn/conv_fp16_test.cc
👤 aciddelgado📅 Created: 10/23/2026
🤖 AI 摘要

该改动针对固定状态缓存等场景中大量小型 GPU 拷贝带来的逐次提交开销,默认将兼容且未指定显式流的 GPU 到 GPU `OrtApi::CopyTensors` 向量合并为一次调用内的命令录制和队列提交。拷贝按数组顺序编码以保留条目间依赖,上下文生命周期延续至提交完成,并为并发调用及错误恢复隔离录制状态。单次拷贝、CPU 传输、显式流和不兼容向量继续使用原有路径,不引入公共 API/ABI 变更或实验开关。配套的 WebGPU 提供程序测试覆盖提交次数、流路由、拷贝依赖、错误恢复、缓冲区生命周期及并发 Session 销毁,并更新相关文档;预期收益是减少主机侧提交开销,但现有信息未提供性能基准,无法量化加速幅度。

📁 Changed Files (5 files, 285 changes: +285/-0)
onnxruntime/core/providers/webgpu/ep/README.md
onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc
onnxruntime/test/providers/webgpu/data_transfer_test.cc
onnxruntime/test/providers/webgpu/plugin/test_webgpu_allocators.cc
onnxruntime/test/providers/webgpu/plugin/test_webgpu_concurrency.cc