onnxruntime
31137265 - WebGPU: Support int32 and uint32 for CumSum (#31702)

Commit
82 days ago
WebGPU: Support int32 and uint32 for CumSum (#31702) ### Description Adds int32 and uint32 data type support to the Cumsum operator in the WebGPU execution provider. The op is used by [Phi-4-mini](https://huggingface.co/webnn/Phi-4-mini-instruct-onnx-webnn/blob/main/onnx/model.onnx) (GQA decomposition). CumSum's WebGPU kernel only advertised float types (float16/float32), so int32/uint32 inputs silently fell back to the CPU EP. Widen the T type constraint to WebGpuSupportedNumberTypes() (adds int32/uint32). ### Motivation and Context No shader or C++ dispatch change is needed. The kernel is not templated and the shader is written entirely against the generic value-type alias (output_value_t): the accumulator is `var sum : output_value_t = 0` and the reduction is a plain `sum = sum + ...`. WGSL resolves the `0` literal and `+` for i32/u32 exactly as for the float case (integer add wraps, matching the CPU CumSum reference), and the loop bounds/indices are already i32/u32 and independent of the element type. So enabling the two integer types is purely a matter of relaxing the type-constraint whitelist.
Author
Parents
Loading