webmachinelearning / webnn

🧠 Web Neural Network API
https://www.w3.org/TR/webnn/
Other
392 stars 47 forks source link

Consider adding int64/uint64 data type support for some reduce operators #694

Open lisa0314 opened 5 months ago

lisa0314 commented 5 months ago

One safety checker SD model failed since 'reduceSum' which from Safety Checker requires int64 input type. And currently, WebNN spec only supports int32, uint32, float32 and float16 for reduceSum.

image

I suppose we should add int64 and uint64 data type for ReduceSum, ReduceSumSquare, ReduceProduct and ReduceL1 which is consistent with DirectML reduce operation definition: https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_reduce_operator_desc#multiply-and-sum and https://learn.microsoft.com/en-us/windows/win32/api/directml/ns-directml-dml_reduce_operator_desc#l1-and-sum_square.

anssiko commented 1 week ago

Discussed on 2024-10-31: int64/uint64 data type support to be consider together with https://github.com/webmachinelearning/webnn/labels/device%20selection to find the right abstraction.

@huningxin perhaps convert PR #695 to a draft meanwhile?