wonnx icon indicating copy to clipboard operation
wonnx copied to clipboard

`f16` support

Open SludgePhD opened this issue 2 years ago • 2 comments
trafficstars

Network weights can be stored as f16 floats, halving the size of the network, which is often very desirable.

It would be nice if wonnx could support loading networks that do that. WebGPU has native support for f16 "half-precision" floats, so all GPU buffers could store them natively. Rust does not, however, so all network inputs and outputs would have to be converted.

SludgePhD avatar Jun 04 '23 13:06 SludgePhD

Network weights can be stored as f16 floats, halving the size of the network, which is often very desirable.

It would be nice if wonnx could support loading networks that do that. WebGPU has native support for f16 "half-precision" floats, so all GPU buffers could store them natively. Rust does not, however, so all network inputs and outputs would have to be converted.

F16 is not supported in Naga yet: https://github.com/gfx-rs/wgpu/issues/4384 Also not shipped in Chrome yet: https://bugs.chromium.org/p/dawn/issues/detail?id=1775&q=f16&can=2

FL33TW00D avatar Jun 05 '23 08:06 FL33TW00D

Ah, that's unfortunate. In that case, wonnx could still upconvert these values to f32 when loading these models to make them work.

SludgePhD avatar Jun 05 '23 16:06 SludgePhD