ONNX Runtime WebGPU PR Monitor

Last Updated: 09/23/2026, 09:15 PM | Total: 533 PRs

Showing 1-10 of 104 PRs
Page 1 of 11
👤 eserscor📅 Created: 09/23/2026
🤖 AI 摘要

此次改动针对 Windows 平台的 WebGPU CI 工作流,目的是将构建与测试阶段拆分,调整自动化验证流程,而非修改 ONNX Runtime 的 WebGPU 算子或 GPU 执行逻辑。修改集中在 .github/workflows/windows_webgpu.yml,但 PR 描述为空且未提供具体差异,因此无法确认阶段间的构建产物传递方式、任务依赖及测试覆盖范围。此类拆分有助于明确构建失败与测试失败的边界,但是否支持复用构建产物、独立重跑测试或缩短 CI 耗时,仍缺少配置依据。现有信息不能证明该改动会提升 WebGPU 推理性能或扩大硬件、驱动及浏览器兼容性。

📁 Changed Files (1 files, 141 changes: +132/-9)
.github/workflows/windows_webgpu.yml
👤 prathikr📅 Created: 09/23/2026
🤖 AI 摘要

该 PR 为 WebGPU EP 的 GatedDeltaNet 增加 state_update_capacity 支持,满足 DFlash2 设置为 7 的需求,使 GenAI Engine 能按实际接受的草稿 token 数精确提交循环状态。改动涉及 WebGPU 算子实现、接口及 WGSL 着色器,并引入 CUDA 已采用的紧凑状态更新输出约定,同时调整算子定义与相关测试。此举使 WebGPU 的状态更新输出能力与 CUDA 对齐,为 DFlash2 的推测解码流程提供所需的状态提交支持。现有信息未提供具体输出布局、测试结果或性能基准,因此无法确认跨后端数值一致性,也不能量化延迟或显存收益。

📁 Changed Files (5 files, 194 changes: +170/-24)
onnxruntime/contrib_ops/webgpu/bert/gated_delta_net.cc
onnxruntime/contrib_ops/webgpu/bert/gated_delta_net.h
onnxruntime/contrib_ops/webgpu/bert/gated_delta_net.wgsl.template
onnxruntime/core/graph/contrib_ops/bert_defs.cc
onnxruntime/test/contrib_ops/gated_delta_net_op_test.cc
👤 eserscor📅 Created: 09/23/2026
🤖 AI 摘要

此次改动针对 ONNX Runtime WebGPU 的 CI 执行环境,将相关构建迁回带有交互模式标记的专用代理池,以满足 Chromium 发现 WebGPU 测试的环境要求。从修改路径看,调整涉及 npm 打包阶段的流水线配置和共享 Web CI 模板,属于任务调度配置变更,而非 WebGPU 算子或 GPU 推理实现的修改。预期影响是让 WebGPU 测试在合适的浏览器运行环境中被发现,不代表推理性能提升或运行时兼容性扩展。现有信息未提供具体配置差异及测试结果,因此无法确认代理池名称、模板中删除的配置项或测试是否已恢复正常。

📁 Changed Files (2 files, 6 changes: +2/-4)
tools/ci_build/github/azure-pipelines/stages/npm-packaging-stage.yml
tools/ci_build/github/azure-pipelines/templates/web-ci.yml
👤 aciddelgado📅 Created: 09/23/2026
🤖 AI 摘要

该 PR 为 WebGPU EP 的 com.microsoft::PagedAttention 启用 is_causal=0 且 local_window_size<=0 的非因果注意力,使 DFlash2 等块式推测生成模型中同一查询块的所有 token 能双向访问完整的有效上下文。实现上保存并传递 is_causal 属性,将其接入现有 FlashAttention 的 is_unidirectional 着色器特化,替代此前对非因果配置的拒绝及硬编码的因果行为。原有因果注意力和因果局部窗口行为保持不变,非因果模式与正值局部窗口的组合仍被拒绝,因为相对查询位置的左窗口掩码不在本次支持范围内。测试侧扩展了 C++ 参考实现以区分因果前缀可见性和非因果全上下文可见性,并调整了 C++ 与 Python 测试;此次改动主要扩展 WebGPU 的模型兼容性,现有信息未提供性能基准,无法判断吞吐或延迟变化。

📁 Changed Files (5 files, 104 changes: +87/-17)
onnxruntime/contrib_ops/webgpu/bert/attention_common.h
onnxruntime/contrib_ops/webgpu/bert/paged_attention.cc
onnxruntime/contrib_ops/webgpu/bert/paged_attention.h
onnxruntime/test/contrib_ops/paged_attention_op_test.cc
onnxruntime/test/python/transformers/test_paged_attention.py
🤖 AI 摘要

该 PR 修复了 WebGPU 执行提供程序对一维 blocked DequantizeLinear 的分类错误,避免指定 block_size 的输入被误按逐轴反量化处理,导致无报错但输出错误。核心改动位于 WebGPU 量化算子的分类逻辑,并在公共算子测试文件中新增带 zero-point 的一维 int8 分块反量化回归用例。相关 DequantizeLinearOp21BlockedTest 测试共 37 项全部通过,包括新增用例,且构建和 lint 检查通过。此次修复改善了 WebGPU 对该反量化模式的语义兼容性与数值正确性;现有信息未提供性能基准,无法判断其对推理速度的影响。

📁 Changed Files (2 files, 14 changes: +12/-2)
onnxruntime/core/providers/webgpu/quantization/quantize_linear.cc
onnxruntime/test/providers/cpu/tensor/quantize_linear_test.cc
🤖 AI 摘要

该 PR 修复了 ONNX Runtime Web 的 JSEP WebGPU GatherND 实现中,对 vec4 打包 uniform 的索引访问错误,避免在输入秩不小于 5 时生成非法的 `i32(vec4<u32>)` 转换,导致 Tint 拒绝着色器模块。关键改动位于 `computeSliceOffsets` 的打包数据访问逻辑,使输入维度和切片步长的索引读取符合标量计算要求,并新增覆盖 rank-5 输入维度及打包切片步长的回归测试。直接调用测试运行器后,Chrome WebGPU 上全部 7 个 GatherND 用例通过,TypeScript 检查及相关格式、静态检查也通过;最初的 npm 测试失败涉及参数传递和缺少 JSEP WASM 产物,已由后续运行替代验证。该修复主要恢复受影响 GatherND 场景的 WebGPU 可用性与着色器编译兼容性,现有信息未提供性能基准或跨浏览器验证结果,不能据此推断性能提升或其他浏览器的兼容性。

📁 Changed Files (2 files, 80 changes: +69/-11)
js/web/lib/wasm/jsep/webgpu/ops/gather-nd.ts
js/web/test/data/ops/gather-nd.jsonc
👤 gyagp📅 Created: 09/22/2026
🤖 AI 摘要

该 PR 将混杂在 CPU 测试目录中的 85 个 WebGPU 测试定义迁移到 WebGPU 对应算子目录,使测试及其算子专用依赖自包含,降低对共享 CPU 测试代码和外部模型文件的耦合。实现上,GRU 和 Pow/Cast 直接构建模型,MatMul/Gemm 改用本地参考计算,PRelu 和 GridSample 使用独立的 WebGPU 测试套件,并通过递归收集纳入重组后的测试,同时保留原有 WebGPU 启用且 EP API adapters 禁用的构建条件。六个 WebGPU FP16 Conv 测试移除了继承自 CPU/CoreML 的门控,避免其受不相关后端条件限制。整体属于测试组织与可维护性改进;现有信息未显示推理内核变更,也未提供性能基准或跨平台测试结果,因此不能据此认定推理性能或运行时兼容性有所提升。

📁 Changed Files (30 files, 5419 changes: +2985/-2434)
cmake/onnxruntime_unittests.cmake
onnxruntime/test/providers/cpu/activation/activation_op_test.cc
onnxruntime/test/providers/cpu/llm/rotary_embedding_op_test.cc
onnxruntime/test/providers/cpu/math/clip_test.cc
onnxruntime/test/providers/cpu/math/cumsum_test.cc
onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc
onnxruntime/test/providers/cpu/math/gemm_test.cc
onnxruntime/test/providers/cpu/math/matmul_test.cc
onnxruntime/test/providers/cpu/math/softmax_test.cc
onnxruntime/test/providers/cpu/nn/conv_fp16_test.cc
onnxruntime/test/providers/cpu/nn/instance_norm_op_test.cc
onnxruntime/test/providers/cpu/nn/pool_op_test.cc
onnxruntime/test/providers/cpu/reduction/reduction_ops_test.cc
onnxruntime/test/providers/cpu/rnn/deep_cpu_gru_op_test.cc
onnxruntime/test/providers/cpu/tensor/cast_op_test.cc
onnxruntime/test/providers/cpu/tensor/concat_op_test.cc
onnxruntime/test/providers/cpu/tensor/expand_test.cc
onnxruntime/test/providers/cpu/tensor/gather_op_test.cc
onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc
onnxruntime/test/providers/cpu/tensor/pad_test.cc
onnxruntime/test/providers/cpu/tensor/space_depth_ops_test.cc
onnxruntime/test/providers/cpu/tensor/tensor_op_test.cc
onnxruntime/test/providers/cpu/tensor/tile_op_test.cc
onnxruntime/test/providers/cpu/tensor/trilu_op_test.cc
onnxruntime/test/providers/cpu/tensor/unsqueeze_op_test.cc
onnxruntime/test/providers/cpu/tensor/where_op_test.cc
onnxruntime/test/providers/webgpu/activation/activation_op_test.cc
onnxruntime/test/providers/webgpu/gemm_large_test.cc
onnxruntime/test/providers/webgpu/llm/rotary_embedding_op_test.cc
onnxruntime/test/providers/webgpu/math/clip_test.cc
👤 chilo-ms📅 Created: 09/21/2026
🤖 AI 摘要

该 PR 将规划好的工作区表示为“执行提供程序原生缓冲区、字节偏移和可用大小”,使 WebGPU 能使用预分配缓冲区中的区域作为算子临时存储,同时保留适用于可寻址分配的指针返回接口。关键实现包括在张量视图、绑定组、分段绑定、数据传输、间接调度及计算图捕获与重放中保留缓冲区偏移,并在禁用普通激活内存模式时单独缓存工作区规划,支持每个内核独立跟踪多个工作区槽位。WebGPU MatMulNBits 的 DP4A 激活与缩放因子临时存储,以及条件启用的 subgroup 激活预打包临时存储,被接入规划区域并保留动态分配回退,旨在减少运行时临时分配,但未提供性能基准,无法量化收益。当前差异还包含前置 PR #32071 的执行框架、BFC arena 及 CUDA MatMulNBits、GroupQueryAttention 工作区规划相关改动,不能全部归为 WebGPU 专属实现;该 PR 面向 main,需先合入前置依赖。

📁 Changed Files (30 files, 10216 changes: +9832/-384)
cmake/onnxruntime_unittests.cmake
docs/annotated_partitioning/attention_workspace_estimation.md
include/onnxruntime/core/framework/op_kernel.h
include/onnxruntime/core/framework/op_kernel_context.h
include/onnxruntime/core/framework/tensor.h
include/onnxruntime/core/framework/workspace_requirement.h
include/onnxruntime/core/session/onnxruntime_c_api.h
include/onnxruntime/core/session/onnxruntime_experimental_c_api.inc
include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h
onnxruntime/contrib_ops/cuda/bert/group_query_attention.cc
onnxruntime/contrib_ops/cuda/bert/group_query_attention.h
onnxruntime/contrib_ops/cuda/bert/group_query_attention_workspace_bounds.cc
onnxruntime/contrib_ops/cuda/bert/group_query_attention_workspace_bounds.h
onnxruntime/contrib_ops/cuda/bert/group_query_attention_workspace_estimate.cc
onnxruntime/contrib_ops/cuda/bert/group_query_attention_workspace_estimate.h
onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemm_profiler.cc
onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemm_profiler.h
onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.h
onnxruntime/contrib_ops/cuda/quantization/matmul_nbits_legacy_workspace.h
onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits.h
onnxruntime/contrib_ops/webgpu/quantization/matmul_nbits_common.h
onnxruntime/contrib_ops/webgpu/quantization/subgroup_matrix_matmul_nbits.cc
onnxruntime/contrib_ops/webgpu/quantization/subgroup_matrix_matmul_nbits.h
onnxruntime/core/framework/allocator_stats.h
onnxruntime/core/framework/bfc_arena.cc
onnxruntime/core/framework/bfc_arena.h
onnxruntime/core/framework/execution_frame.cc
👤 ykhrustalev📅 Created: 09/21/2026
🤖 AI 摘要

该改动修复了 GroupQueryAttention 在 KV 缓存增长时的形状推断错误:过去序列长度为符号维度时,不再将该符号复制给 present,而是让 present 的序列维度保持动态,避免内存规划器误判两者等长并复用容量不足的缓冲区。固定长度缓存仍沿用原有推断方式,WebGPU 的 MayInplace 声明也予以保留,使合法的原地复用继续生效;该修复同时覆盖 WebGPU/CUDA 的别名复用路径及包括 CPU 在内的各 EP 空闲缓冲区复用路径。SparseAttention 的最大缓存模式和采用独立形状推断的 PagedAttention 不受影响,新增的增长缓存回归测试用于验证相关场景,但现有信息未提供性能测量结果。另一项改动改善了 WebGPU 融合 Conv 遇到无法解析的 activation 时的报错,并新增相应测试;由于描述末尾截断,无法确认具体错误文本,但没有证据表明其扩展了支持的激活函数范围。

📁 Changed Files (6 files, 371 changes: +366/-5)
onnxruntime/contrib_ops/webgpu/fused_conv.cc
onnxruntime/core/graph/contrib_ops/bert_defs.cc
onnxruntime/core/providers/webgpu/nn/conv.h
onnxruntime/core/providers/webgpu/nn/fuse_utils.cc
onnxruntime/test/contrib_ops/conv_unknown_activation_test.cc
onnxruntime/test/contrib_ops/group_query_attention_growing_cache_test.cc
🤖 AI 摘要

该改动修复通用图优化器 DivMulFusion 在将 1 / x1 * x2 改写为 x2 / x1 时,仅替换输入定义却未连接 x2 生产者与 Div 的问题。关键是在替换 Mul 的输入后补建生产者到 Div 的边,避免 Mul 被删除后,后续 Level1 规则移除或重连生产者时漏掉 Div,留下引用已失效中间值的无效图。改动同时在图优化测试文件中新增测试,针对这类融合与后续重写之间的图连接正确性提供回归保障。该修复位于共享优化层,并非 WebGPU 专属优化;它有助于避免使用该优化路径的后端遇到无效图,但现有信息没有提供 WebGPU 实测或性能数据,无法确认具体性能收益或兼容性覆盖范围。

📁 Changed Files (2 files, 180 changes: +179/-1)
onnxruntime/core/optimizer/div_mul_fusion.cc
onnxruntime/test/optimizer/graph_transform_test.cc