ONNX Runtime WebGPU PR Monitor

Last Updated: 10/28/2026, 10:25 PM | Total: 712 PRs

Showing 1-10 of 128 PRs
Page 1 of 13
👤 justinchuby📅 Created: 10/28/2026
🤖 AI 摘要

该 PR 为 com.microsoft::QMoE v1 增加显式启用的 fp8_execution_profile="fp16_compatible",在 FP8 量化路径中真正使用 tile-local FP16 MMA,而非原生 FP8 计算;默认仍为 native,既有原生 FP8、W8A16 和整数路径的数学行为保持不变。新配置定义了明确的数值执行契约,包括 FP32 softmax、top-8 选择与源数据归一化、类型舍入前后的运算顺序、第二次 FP8 量化前的 FP32 SiLU/乘积计算,以及 FP32 加权输出累加和 VT4 最终归约。实现将 GPU 专家映射构建逻辑拆分至独立 CUDA 模块,复用 ORT 的流感知分配器与临时存储,并补充算子定义、形状推断和 CUDA 测试,不引入主机排序或 CPU 同步。初始支持范围限定于 Hopper SM90、真正的 FP16/BF16 激活及路由和输出、256 个专家、归一化 top-8 路由与独立 gate/up;WebGPU 仅列出头文件小幅修改,不能据此认定其支持该执行配置,且缺少性能基准,无法判断吞吐或延迟变化。

📁 Changed Files (17 files, 2045 changes: +1433/-612)
cmake/onnxruntime_unittests.cmake
docs/ContribOperators.md
docs/OperatorKernels.md
onnxruntime/contrib_ops/cpu/moe/moe_quantization_cpu.cc
onnxruntime/contrib_ops/cuda/llm/moe_gemm/moe_expert_maps.cu
onnxruntime/contrib_ops/cuda/llm/moe_gemm/moe_expert_maps.h
onnxruntime/contrib_ops/cuda/llm/moe_gemm/moe_kernels.cu
onnxruntime/contrib_ops/cuda/llm/moe_gemm/moe_util_kernels.h
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
👤 adrastogi📅 Created: 10/28/2026
🤖 AI 摘要

该 PR 将原生 WebGPU 执行提供程序(EP)纳入现有 CPU/CUDA/DirectML 算子文档 CI,使文档覆盖构建出的 WebGPU 插件所注册的内核,而非修改推理内核本身。构建流程从同一源码检出构建插件与 Python 运行时,保留完整 Protobuf 文档配置,并在安装生成的 wheel 后统一生成文档;插件查询启用软件适配器发现,对参数格式错误、加载或查询失败、空注册表及非预期提供程序显式报错,避免静默遗漏支持信息。生成器在查询和渲染全部完成后才替换已有内核文档,成功生成后无论受版本控制的文档是否过期,都会发布包含两份 Markdown 文档及源码提交、版本、选项、计数和哈希等溯源信息的 updated-docs 产物,同时保留文档过期时的校验失败行为。配套改动补充了不依赖 GPU 的针对性测试及文档再生成、产物使用说明,主要提升 WebGPU 算子支持信息的完整性与可追溯性;现有信息未提供性能基准或算子实现变更,不能据此推断推理性能提升或兼容性范围扩大。

📁 Changed Files (6 files, 559 changes: +508/-51)
.github/skills/ort-ci/SKILL.md
.github/workflows/windows_gpu_doc_gen.yml
docs/How_To_Update_ONNX_Dev_Notes.md
tools/ci_build/build.py
tools/ci_build/test_generate_documentation.py
tools/python/gen_opkernel_doc.py
👤 edgchen1📅 Created: 10/28/2026
🤖 AI 摘要

该改动收紧了 ONNX Runtime 夜间 WebGPU shader 验证流水线的测试产物范围,避免无关测试 DLL 的 BinSkim 问题导致流水线失败。具体是在 Azure Pipelines 阶段配置中,为 provider 和 core 测试套件设置显式产物白名单,并将各测试可执行文件拆分到独立步骤运行,不再暂存此项检查不需要的 onnxruntime_telemetry_shutdown_test 相关二进制文件。该方案通过排除无关产物解除验证阻塞,并未修复遥测测试库本身的 BinSkim 问题,后者仍需另行处理。改动仅涉及 CI 配置,没有证据表明会改变 WebGPU shader 实现、GPU 推理性能或运行时兼容性;由于未提供具体白名单和测试参数,无法进一步确认实际覆盖的测试用例范围。

📁 Changed Files (1 files, 46 changes: +19/-27)
tools/ci_build/github/azure-pipelines/stages/nightly-webgpu-shader-validation-stage.yml
👤 adrastogi📅 Created: 10/28/2026
🤖 AI 摘要

该 PR 补齐 WebGPU EP 的量化与类型转换能力,新增 QuantizeLinear 内核和 Cast 的 int8 支持,解决 W3C WebNN 一致性测试在禁用 CPU 回退时暴露的功能缺口。QuantizeLinear 支持 f32/f16 输入及 int8/uint8 输出,覆盖 opset 10–24;由于内核使用 f32 执行除法,opset 23/24 仅注册 f32 类型的 y_scale,并同步调整内置与插件 EP 的能力判定。底层着色器输出逻辑修复了超过 maxStorageBufferBindingSize 时分段写入的字节通道打包问题,保障此类输出的数据正确性。测试侧扩展了量化与 Cast 覆盖,并补充一维分块 uint8 DequantizeLinear 回归用例,覆盖 f32/f16 scale 以及显式和推断的 block_size=2。整体改动提升了量化模型在 WebGPU 上的算子覆盖与兼容性,但提供的信息没有性能基准,不能据此量化推理加速收益。

📁 Changed Files (9 files, 1002 changes: +933/-69)
onnxruntime/core/providers/webgpu/ep/ep.cc
onnxruntime/core/providers/webgpu/quantization/quantize_linear.cc
onnxruntime/core/providers/webgpu/quantization/quantize_linear.h
onnxruntime/core/providers/webgpu/shader_variable.cc
onnxruntime/core/providers/webgpu/tensor/cast.cc
onnxruntime/core/providers/webgpu/tensor/cast.h
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/test/providers/webgpu/tensor/cast_op_test.cc
onnxruntime/test/providers/webgpu/tensor/quantize_linear_test.cc
🤖 AI 摘要

该 PR 针对 W3C WebNN 一致性测试暴露的 ONNX Runtime WebGPU EP 精度与溢出问题进行修复,重点是在 float16 推理中使用 f32 完成关键中间计算。归约实现将共享内存路径的累加器和工作组数组提升为 f32,并让朴素路径的 ReduceSumSquare、ReduceL2 在 f32 中执行平方;ReduceLogSumExp 则采用减去最大值的稳定算法,分别通过共享路径的两阶段计算和朴素路径的在线计算实现,同时对齐 CPU 内核对无穷值的处理。InstanceNormalization 的每通道中间 scale/shift 保持为 f32,Erf、Exp、Tan 的计算也调整为 f32,相关改动还涉及 BiasGelu 和 BiasSplitGelu 对公共实现的调用。新增的 WebGPU 专用回归测试禁用 CPU EP 回退,以确保验证的是 GPU 实现;这些调整旨在改善数值稳定性和一致性,但提供的信息不包含性能基准,无法判断额外的 f32 运算及存储对吞吐和延迟的具体影响。

📁 Changed Files (11 files, 598 changes: +550/-48)
onnxruntime/contrib_ops/webgpu/bert/bias_gelu.cc
onnxruntime/contrib_ops/webgpu/bert/bias_split_gelu.cc
onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc
onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.h
onnxruntime/core/providers/webgpu/nn/instance_norm.cc
onnxruntime/core/providers/webgpu/reduction/reduction_ops.cc
onnxruntime/test/providers/webgpu/math/erf_test.cc
onnxruntime/test/providers/webgpu/math/exp_test.cc
onnxruntime/test/providers/webgpu/math/tan_test.cc
onnxruntime/test/providers/webgpu/nn/instance_norm_op_test.cc
onnxruntime/test/providers/webgpu/reduction/reduction_ops_test.cc
👤 justinchuby📅 Created: 10/28/2026
🤖 AI 摘要

该 PR 在 ONNX Runtime 中新增内部融合目标 com.microsoft.Log1p,并为 CUDA 和原生 WebGPU EP 实现对应内核,将标准 ONNX 的 Log(Add(x, 1)) 或 Log(Add(1, x)) 融合为直接接收原始 x 的计算,避免先加一导致微小值丢失。融合在 EP 分配后的 Level2(EXTENDED/ALL)优化阶段执行,要求 Add 与 Log 属于同一受支持 EP,且常量为类型匹配、不可覆盖、精确等于 1 的初始化器,广播不能扩展输入秩;Add 存在其他消费者或作为图输出时则保留原图。此前的 FP32 Exp 仍作为独立节点和舍入边界,不会被合并为更大的计算表达式;CPU、已弃用的 JSEP 及其他 EP,以及关闭优化或仅启用 BASIC 的配置均不受此次融合影响。该改动有望减少 CUDA/WebGPU 上的算子调度和中间张量开销,但未提供性能基准;导出模型仍使用标准 ONNX 表达,无需新增标准算子、升级 opset 或调整依赖,并补充了融合及算子测试与文档。

📁 Changed Files (17 files, 638 changes: +636/-2)
docs/ContribOperators.md
docs/Log1p_Fusion.md
docs/OperatorKernels.md
onnxruntime/contrib_ops/cuda/activation/activations.cc
onnxruntime/contrib_ops/cuda/activation/activations.h
onnxruntime/contrib_ops/cuda/activation/activations_impl.cu
onnxruntime/contrib_ops/cuda/activation/activations_impl.h
onnxruntime/contrib_ops/cuda/cuda_contrib_kernels.cc
onnxruntime/contrib_ops/webgpu/math/log1p.cc
onnxruntime/contrib_ops/webgpu/webgpu_contrib_kernels.cc
onnxruntime/core/graph/contrib_ops/contrib_defs.cc
onnxruntime/core/graph/contrib_ops/ms_opset.h
onnxruntime/core/optimizer/graph_transformer_utils.cc
onnxruntime/core/optimizer/log1p_fusion.cc
onnxruntime/core/optimizer/log1p_fusion.h
onnxruntime/test/contrib_ops/log1p_op_test.cc
onnxruntime/test/optimizer/log1p_fusion_test.cc
🤖 AI 摘要

该 PR 补齐 W3C WebNN 一致性测试转换为 ONNX 后所需的 WebGPU 算子与整数类型支持,解决禁用 CPU EP 回退时因缺少内核而导致的图构建失败。逻辑运算新增 bool 类型的 Or/Xor,其中 Xor 使用 WGSL 的 != 实现,以适配 vec4<bool> 不支持 ^ 的限制,并测试标量、向量尾部及多种广播路径。IsNaN/IsInf 通过原始 IEEE-754 位模式判断特殊值,避免 WGSL 在假设浮点数有限时优化掉常规 NaN 检测,同时直接从原始字拆分 f16 分量而不转为 f32。文件路径还表明改动涉及其他一元逐元素运算、Slice 的类型适配,以及 Round、Sign、Softsign、Abs、Neg 等测试,但描述被截断,无法确认这些算子新增支持的具体整数类型与完整版本范围。各提交均配有固定使用 WebGPU 且禁用 CPU 回退的单元测试,主要提升 WebNN 到 ONNX 执行链路的兼容性与 GPU 算子覆盖率,现有信息未提供性能收益数据。

📁 Changed Files (10 files, 719 changes: +698/-21)
onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.cc
onnxruntime/core/providers/webgpu/math/binary_elementwise_ops.h
onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc
onnxruntime/core/providers/webgpu/tensor/slice.cc
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/test/providers/webgpu/math/abs_neg_test.cc
onnxruntime/test/providers/webgpu/math/element_wise_ops_test.cc
onnxruntime/test/providers/webgpu/math/is_nan_inf_test.cc
onnxruntime/test/providers/webgpu/math/round_sign_softsign_test.cc
onnxruntime/test/providers/webgpu/tensor/slice_op_test.cc
👤 adrastogi📅 Created: 10/28/2026
🤖 AI 摘要

该 PR 钥对 W3C WebNN 一致性测试暴露的 ONNX Runtime WebGPU EP 能力缺口,修复 channels-last 布局的双线性 Resize,并新增 LpPool 和 GlobalLpPool 内核支持。Resize 双线性程序改为显式接收高、宽轴:对满足 scales[1] != 1 的四维输入插值第 1、2 维,否则仍插值最后两维,同时将布局纳入程序缓存键,避免不同布局错误复用程序。池化相关实现、接口和 EP 内核注册均有扩展,并新增池化测试;Resize 则增加 f32、f16 channels-last 上采样测试,禁用 CPU EP 回退以验证 WebGPU 路径。这些改动提升了 WebNN 模型在 WebGPU 上执行的正确性和算子覆盖度,但所给描述缺少 LpPool 的具体参数、类型支持范围及性能测量,无法据此断言完整兼容性或量化加速收益。

📁 Changed Files (7 files, 406 changes: +368/-38)
onnxruntime/core/providers/webgpu/nn/pool.cc
onnxruntime/core/providers/webgpu/nn/pool.h
onnxruntime/core/providers/webgpu/tensor/resize_impl.cc
onnxruntime/core/providers/webgpu/tensor/resize_impl.h
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc
onnxruntime/test/providers/webgpu/nn/pool_op_test.cc
onnxruntime/test/providers/webgpu/tensor/resize_op_test.cc
👤 adrastogi📅 Created: 10/28/2026
🤖 AI 摘要

此次改动为 ONNX Runtime 的 WebGPU 执行提供程序中 opset 7–13 和 14 的 GRU、LSTM 注册 float16 类型支持,使这些算子能够接受半精度输入。门控计算沿用着色器中的 f32 加载与累加逻辑,同时将循环隐藏状态、LSTM 单元状态及 GRU 的更新门和重置门暂存数据保留为 f32,避免每个时间步都舍入到 f16 导致误差累积。状态复制着色器通过 dst_element_t(...) 显式转换目标类型,并让从 f32 状态写出图输出的程序将输出类型纳入着色器缓存键,避免不同输出类型错误复用缓存。新增测试固定使用 WebGPU 并禁用 CPU EP 回退,以验证原生执行路径;这一改动扩展了半精度模型的兼容性,但未提供性能基准,不能据此认定推理速度或显存占用有所改善。

📁 Changed Files (3 files, 532 changes: +509/-23)
onnxruntime/core/providers/webgpu/rnn/gru.cc
onnxruntime/core/providers/webgpu/rnn/lstm.cc
onnxruntime/test/providers/webgpu/rnn/rnn_float16_test.cc
🤖 AI 摘要

该 PR 针对 ONNX Runtime 原生 WebGPU 执行提供程序的正确性审计问题,修复合法模型在可选输入缺失、空张量及边界形状下的崩溃、错误结果和无效 WGSL 生成。关键改动涵盖 Slice 反向坐标、Einsum 省略号与广播索引、Resize 的秩及 ROI 处理、布尔 Where 存储访问和整数运算,并纠正 Attention 可选缓存输出及不同 key/value 头宽度的处理,使历史缓存的读取不再依赖是否请求缓存输出。数值方面,半精度 Softmax、平均池化、混合类型 BatchNorm 和反量化采用 FP32 中间计算,归一化算子引入补偿均值与中心化方差计算,以降低累加误差和消减误差。执行提供程序还修复了图捕获失败后的回滚,避免将失败推理缓存为可成功重放的图;整体主要提升模型兼容性、数值可靠性与运行稳定性,但现有信息未提供性能基准,无法判断对吞吐或延迟的具体影响。

📁 Changed Files (30 files, 2585 changes: +1834/-751)
cmake/onnxruntime_unittests.cmake
onnxruntime/contrib_ops/webgpu/bert/attention.cc
onnxruntime/contrib_ops/webgpu/bert/bias_split_gelu.cc
onnxruntime/contrib_ops/webgpu/bert/multihead_attention.cc
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.cc
onnxruntime/contrib_ops/webgpu/bert/skip_layer_norm.h
onnxruntime/contrib_ops/webgpu/diffusion/group_norm.cc
onnxruntime/contrib_ops/webgpu/diffusion/group_norm.h
onnxruntime/core/providers/webgpu/generator/range.cc
onnxruntime/core/providers/webgpu/math/einsum.cc
onnxruntime/core/providers/webgpu/math/softmax.cc
onnxruntime/core/providers/webgpu/math/top_k.cc
onnxruntime/core/providers/webgpu/nn/batch_norm.cc
onnxruntime/core/providers/webgpu/nn/conv.cc
onnxruntime/core/providers/webgpu/nn/conv_transpose.cc
onnxruntime/core/providers/webgpu/nn/im2col_matmul.cc
onnxruntime/core/providers/webgpu/nn/instance_norm.cc
onnxruntime/core/providers/webgpu/nn/instance_norm.h
onnxruntime/core/providers/webgpu/nn/normalization_utils.h
onnxruntime/core/providers/webgpu/nn/pool.cc
onnxruntime/core/providers/webgpu/nn/rms_norm.cc
onnxruntime/core/providers/webgpu/quantization/quantize_linear.cc
onnxruntime/core/providers/webgpu/reduction/reduction_ops.cc
onnxruntime/core/providers/webgpu/reduction/reduction_ops.h
onnxruntime/core/providers/webgpu/tensor/concat.cc
onnxruntime/core/providers/webgpu/tensor/resize_impl.cc
onnxruntime/core/providers/webgpu/tensor/slice.cc
onnxruntime/core/providers/webgpu/tensor/trilu.cc
onnxruntime/core/providers/webgpu/tensor/where.cc
onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc