ONNX Runtime WebGPU PR Monitor

Last Updated: 10/26/2026, 10:29 PM | Total: 684 PRs

Showing 1-10 of 117 PRs
Page 1 of 12
👤 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
👤 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
👤 adrastogi📅 Created: 10/24/2026
🤖 AI 摘要

该 PR 通过消除 onnxruntime_providers_webgpu 目标内跨目录源文件的同名冲突,避免 MSVC 生成 SARIF 日志时发生命名碰撞。具体做法是保留通用实现的文件名,将六组冲突中的 EP、Intel 专用或 contrib 实现改为更具区分度的名称,例如 session_allocator、intel_gemm、matmul_subgroup 和 contrib_layer_norm,并同步调整配套头文件、引用及文档。构建脚本还新增了 CMake 配置阶段的重名检查,以便后续引入同名源文件时尽早发现问题。这些改动属于文件命名和构建检查层面的维护,不涉及 WebGPU 算子逻辑、GPU 执行路径或接口语义变化,主要改善 MSVC 下分析日志生成的可靠性,不应带来推理性能变化。

📁 Changed Files (22 files, 68 changes: +52/-16)
cmake/onnxruntime_providers_webgpu.cmake
docs/design/webgpu_matmul_execution_planner.md
onnxruntime/contrib_ops/webgpu/bert/contrib_layer_norm.cc
onnxruntime/contrib_ops/webgpu/bert/contrib_rotary_embedding.cc
onnxruntime/contrib_ops/webgpu/bert/contrib_rotary_embedding.h
onnxruntime/contrib_ops/webgpu/bert/group_query_attention.cc
onnxruntime/core/providers/webgpu/allocator.h
onnxruntime/core/providers/webgpu/ep/README.md
onnxruntime/core/providers/webgpu/ep/ep.cc
onnxruntime/core/providers/webgpu/ep/factory.cc
onnxruntime/core/providers/webgpu/ep/session_allocator.cc
onnxruntime/core/providers/webgpu/ep/session_allocator.h
onnxruntime/core/providers/webgpu/llm/rotary_embedding.cc
onnxruntime/core/providers/webgpu/math/gemm.cc
onnxruntime/core/providers/webgpu/math/matmul.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/intel_gemm.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/intel_gemm.h
onnxruntime/core/providers/webgpu/vendor/intel/math/intel_matmul_execution_planner.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/intel_matmul_execution_planner.h
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul_subgroup.cc
onnxruntime/core/providers/webgpu/vendor/intel/math/matmul_subgroup.h
onnxruntime/test/providers/webgpu/matmul_execution_planner_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
👤 El1as42📅 Created: 10/23/2026
🤖 AI 摘要

该改动旨在减少 ONNX Runtime Web 端 Asyncify 构建中不必要的异步插桩,覆盖 JSEP 和未启用 JSPI 的原生 WebGPU 构建。实现上通过 WebAssembly 的 CMake 配置传入 -s ASYNCIFY_REMOVE=@onnxruntime/wasm/asyncify_remove.txt,排除 Graph、GraphViewer、ONNX schema 与形状推断以及 protobuf 解析相关函数。上述代码不会调用异步导入,因此排除它们可减少间接调用导致的冗余插桩,同时保留 WebGPU 回读、适配器/设备/管线创建及 WebNN 相关路径所需的异步支持。此举有助于控制 Wasm 函数体积和插桩开销,但描述中有关 WebKit 优化编译层的说明不完整,也未提供性能实测数据,无法量化收益或确认具体兼容性改善;JSPI 和普通 Wasm 构建不受影响。

📁 Changed Files (2 files, 14 changes: +13/-1)
cmake/onnxruntime_webassembly.cmake
onnxruntime/wasm/asyncify_remove.txt
👤 gyagp📅 Created: 10/23/2026
🤖 AI 摘要

该 PR 优化了 ONNX Runtime WebGPU 中低比特矩阵乘法的 DP4A 路径,重点适配 Qualcomm Adreno 的 64–128 lane 宽子组。激活量化着色器先在每个 lane 内归约四个激活分量的绝对值,再进行 XOR shuffle,以减少跨 lane 通信,同时确保每个 128 值量化块在独立的 32-lane 分区内归约。矩阵乘法路径在兼容的 Qualcomm 适配器上,仅针对 4-bit 权重、块大小为 32 且 M≥128 的情况采用 128×32 输出分块,并显式请求两个 128-lane 子组,每个 lane 负责一个激活行上的 16 个输出列。回归测试覆盖独立量化块、不完整工作组、矩阵分块尾部、批处理、偏置和零点,以验证优化路径的正确性;描述中的 Windows ARM64/Adreno X1-85 基准结果被截断,因此无法确认实际性能提升幅度。

📁 Changed Files (4 files, 157 changes: +136/-21)
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul.wgsl.template
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/dp4a_quantize.wgsl.template
onnxruntime/test/providers/webgpu/quantization/matmul_nbits_test.cc
👤 qjia7📅 Created: 10/23/2026
🤖 AI 摘要

该改动让 CPU 和 WebGPU 的 MatMulNBits 在 weight_prepacked=0 时支持空打包权重,适用于禁用 LoRA 适配器等可选投影场景,无需再提供完整尺寸的全零权重张量;B 的打包形状允许一个或多个维度为零,其余维度仍须符合正常布局。输出保持由 A、K、N 决定的逻辑形状,并填充为零或广播后的 bias,未使用的量化参数也允许为空。CPU 跳过无用的参数打包和矩阵乘法,WebGPU 则记录填充 dispatch,确保图捕获后的重放能够重新写入正确输出,而非仅在首次执行时初始化。WebGPU 的 QKV/MLP 融合仍然启用,空权重投影走共享的零值或 bias 回退路径,非空投影继续计算;算子文档、定义及专项测试同步覆盖精度、量化位宽、输入覆盖切换和图捕获等场景,但未提供量化性能收益的基准数据。

📁 Changed Files (8 files, 578 changes: +567/-11)
docs/ContribOperators.md
onnxruntime/contrib_ops/cpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/cpu/quantization/matmul_nbits_helper.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_mlp.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_qkv.cc
onnxruntime/core/graph/contrib_ops/contrib_defs.cc
onnxruntime/test/contrib_ops/matmul_nbits_empty_weights_test.cc
👤 aciddelgado📅 Created: 10/22/2026
🤖 AI 摘要

该 PR 优化了 ONNX Runtime WebGPU 执行提供程序的 CPU→GPU 数据上传路径,对符合条件且大小不超过 1 MiB 的上传自动使用 Queue.WriteBuffer,以减少每次新建 staging buffer 带来的分配、映射、复制及提交开销。在队列写入前,实现会先提交延迟执行的读取操作,确保旧数据被读取后再覆盖,同时不引入额外的 CPU 完成等待。对于已映射缓冲区、大于阈值、未对齐及 capture/replay 场景,仍保留原有处理或 staging 路径,并维持既有的完成通知、校验、设备丢失和失败处理语义。配套修改补充了 WebGPU 上下文与数据传输测试,并记录执行顺序、源数据生命周期保证和阈值规则;该优化旨在缓解 Qwen/DFlash2 在 A100 上分析发现的主机端开销,但所给信息未包含量化性能收益或跨设备验证结果。

📁 Changed Files (4 files, 595 changes: +594/-1)
docs/WebGPU_Queue_Uploads.md
onnxruntime/core/providers/webgpu/buffer_manager.cc
onnxruntime/test/providers/webgpu/data_transfer_test.cc
onnxruntime/test/providers/webgpu/webgpu_context_test.cc
👤 xgbtxy📅 Created: 10/22/2026
🤖 AI 摘要

该改动修复 ONNX Runtime 图优化器 ReshapeFusion 在空输入场景下的语义问题:例如将 [batch, 20, 30, 40] 到 [batch, 20, 1200] 的 reshape 改写为 [0, 0, -1] 后,batch 为 0 会导致推断维度无法确定。关键实现是在用 -1 替换形状计算前,要求所有复制的维度都能静态确定为正数,否则保留原始形状计算;原有字面量 -1 的处理保持不变,静态安全的情况仍可融合。修改位于通用图优化器并新增了相关回归测试,并非 WebGPU 专用内核调整;符号维度场景可能因此减少融合机会,即使运行时输入非空也会保留形状计算,但具体性能影响尚无数据支持。该修复旨在保持空与非空输入的执行兼容性,不过提供的验证信息仅说明修复前新回归测试失败、其余 25 项测试通过,未给出修复后的测试结果或 WebGPU 验证数据。

📁 Changed Files (2 files, 209 changes: +209/-0)
onnxruntime/core/optimizer/reshape_fusion.cc
onnxruntime/test/optimizer/graph_transform_test.cc