onnxruntime
529f3baa - [WebGPU EP] Support int64 Clip via a dedicated ClipInt64 kernel (#29834)

Commit
84 days ago
[WebGPU EP] Support int64 Clip via a dedicated ClipInt64 kernel (#29834) Add a ClipInt64 kernel/shader for opsets 12-12 and 13, so int64 Clip stops falling back to the CPU EP (which aborts session init under the compile-only flow). int64 (like all integer types) is only a valid Clip element type from opset 12 on -- the opset-11 Clip schema constrains T to float types -- so there is no 11-11 registration. The WebNN-inserted index Clip before ArgMax in the SD-Turbo text encoder is int64. The 4-byte templated Clip cannot cover it (sizeof(T)==sizeof(float) static_assert). WebGPU has no native 64-bit integer type; the EP stores int64 as vec2<u32> and operates on the truncated low 32 bits as i32 (shader_variable.cc GetByOffset/SetByOffset). Because Clip is monotonic, ClipInt64 clamps that i32 value (min/max saturated into the i32 range) and sign-extends on write, consistent with the EP's existing int64 semantics. This is a split CL from https://github.com/microsoft/onnxruntime/pull/29682 to fix part of https://github.com/microsoft/onnxruntime/issues/29756
Author
Parents
Loading