-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
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.mdshow:| 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.cconnxruntime/core/providers/js/operators/conv.cc
In those files, Conv is registered as:
1-10viaONNX_OPERATOR_VERSIONED_KERNEL_EX11viaONNX_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:
onnxruntime/onnxruntime/core/framework/kernel_registry.cc
Lines 126 to 133 in 25a6fdc
| 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:
- Update the docs generator to avoid showing
11+forONNX_OPERATOR_KERNEL_CLASS_NAME(..., 11, ...)unless a version range is registered, or - Register Conv explicitly for
11–21and22(matching native WebGPU EP style), so the docs become true.
Repro
- Any model with opset import 22 and a
Convnode fails ononnxruntime-webWebGPU. - 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