Skip to content

[Documentation] WebGPU docs show Conv supports 11+, but JS EP only matches opset 11 (Conv‑22 fails) #27231

@sharwell

Description

@sharwell

Hi team — I ran into a mismatch between WebGPU operator docs and actual kernel matching for Conv in onnxruntime‑web.

What I observed

  • The generated docs js/web/docs/webgpu-operators.md show:

    | Conv | ai.onnx(1-10,11+); com.ms.internal.nhwc(1-10,11+) | need perf optimization; conv3d is not supported; need implementing activation |

  • But in practice, Conv‑22 nodes fail on WebGPU with “kernel not found” (falls back to CPU execution).

  • Re‑exporting the model to opset 21 makes it run (uses Conv-11 which is the version preceding Conv-22).

Why this happens

The WebGPU docs are generated by js/web/script/generate-webgpu-operator-md.ts by parsing kernel registrations in:

  • onnxruntime/core/providers/js/js_execution_provider.cc
  • onnxruntime/core/providers/js/operators/conv.cc

In those files, Conv is registered as:

  • 1-10 via ONNX_OPERATOR_VERSIONED_KERNEL_EX
  • 11 via ONNX_OPERATOR_KERNEL_EX

In ORT kernel matching, ONNX_OPERATOR_KERNEL_EX(..., 11, ...) sets SinceVersion(11) without an end version (leaving the default value INT_MAX), and kernel matching only treats it as exactly 11, not “11+”. This is enforced in onnxruntime/core/framework/kernel_registry.cc:

bool valid_version =
// exact match. typical usage.
kernel_start_version == since_ver ||
// allow match if the kernel def has an end version. if it does not, all we know is that the kernel supported
// the start version when it was created, and not whether a new version of the operator was added since then
// that the kernel doesn't support.
(kernel_end_version != INT_MAX &&
kernel_start_version <= since_ver && kernel_end_version >= since_ver);

So Conv‑22 does not match the “11” kernel and fails.

Impact

  • Docs say 11+, but the WebGPU EP rejects Conv‑22.
  • This is confusing for users and leads to unexpected runtime failures.

Suggested fixes

Either:

  1. Update the docs generator to avoid showing 11+ for ONNX_OPERATOR_KERNEL_CLASS_NAME(..., 11, ...) unless a version range is registered, or
  2. Register Conv explicitly for 11–21 and 22 (matching native WebGPU EP style), so the docs become true.

Repro

  • Any model with opset import 22 and a Conv node fails on onnxruntime-web WebGPU.
  • The same model converted to opset 11 runs.

I’m happy to submit a PR if desired — just confirm the preferred direction (doc fix vs. kernel registration).

Thanks!

Page / URL

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationimprovements or additions to documentation; typically submitted using templateep:WebGPUort-web webgpu providerplatform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions