[WebGPU EP] Gate int64 Clip kernel behind enable_int64 - #29918
Conversation
The int64 Clip kernel was registered unconditionally via the static kernel table, unlike every other int64 kernel (Cast, Expand, Equal, Sub, Where, ReduceSum, Reshape, Unsqueeze, Range), which register their int64 variant only when the enable_int64 option is set. As a result an int64 Clip node was claimed by the EP even when int64 support was left disabled. Remove the int64 Clip entries from the static kernel table and register the dedicated ClipInt64 kernels conditionally in RegisterKernels, gated on enable_int64. The int64 Clip WebGPU tests now build the EP with the option enabled.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
@hariharans29, PTAL, thanks! |
There was a problem hiding this comment.
Pull request overview
This PR fixes WebGPU EP kernel registration so that the dedicated int64 Clip kernels are only registered when the WebGPU provider is created with enableInt64 enabled, aligning Clip with the existing behavior of other int64-gated WebGPU kernels (Cast, Expand, Range, etc.). This prevents WebGPU from claiming int64 Clip nodes when int64 support is disabled.
Changes:
- Remove int64 Clip entries from the static WebGPU kernel create-info table and register them conditionally at
RegisterKernels(...)time. - Introduce
RegisterClipInt64Kernels(...)in the unary elementwise ops module and invoke it from the WebGPU EP registry setup. - Update WebGPU int64 Clip unit tests to construct the EP with
kEnableInt64=1.
Show a summary per file
| File | Description |
|---|---|
| onnxruntime/test/providers/cpu/math/clip_test.cc | Updates WebGPU int64 Clip tests to enable kEnableInt64 when creating the WebGPU EP. |
| onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc | Removes unconditional int64 Clip from the static table and conditionally registers it during RegisterKernels. |
| onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.h | Declares RegisterClipInt64Kernels(...) for conditional registration. |
| onnxruntime/core/providers/webgpu/math/unary_elementwise_ops.cc | Implements RegisterClipInt64Kernels(...) and performs gated registration for opset 12 and 13+. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Low
Review: PR #29918 — [WebGPU EP] Gate int64 Clip kernel behind enable_int64 (head
|
The int64 Clip kernel was registered unconditionally via the static kernel table, unlike every other int64 kernel (Cast, Expand, Equal, Sub, Where, ReduceSum, Reshape, Unsqueeze, Range), which register their int64 variant only when the enable_int64 option is set. As a result an int64 Clip node was claimed by the EP even when int64 support was left disabled.
Remove the int64 Clip entries from the static kernel table and register the dedicated ClipInt64 kernels conditionally in RegisterKernels, gated on enable_int64. The int64 Clip WebGPU tests now build the EP with the option enabled.
This is an enhancement for landed PR #29834