-
Notifications
You must be signed in to change notification settings - Fork 12
Support for Float16 in JS & WASM environments #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Quite possibly. Machine Learning is growing in popularity especially the last 3 years and I believe it will touch every industry in the future. Being able to support this will enable to reduce the size of ML models in the future and the amount of memory they take up when being executed - which in some cases can be very large. As the JS community get more confident in creating ML models, no matter what framework they choose to use, having this would help in such situations where quantisation is desired. Adding @pyu10055 @dsmilkov @nsthorat @annxingyuan @tafsiri @lina128 for any thoughts related to this topic too (TF.js team) and for visibility. |
It feels like reducing the size of the model (e.g. for transport) via FP16 is not as difficult of a problem than having proper type support. (While wasteful, one can cast a half precision model to full and run it as full.) There is also the question of the newer types, which definitely step into non-standard territory. |
float16 is pretty important in the context of ML performance on NVIDIA tensor core. So having the native data type support in JS would be very handy. Typically quantization to float16 can be done more readily than int8 quantization. Int8 would be important too in the future as its support in the native GPU platform is becoming more common. |
related discussion on WASI-NN |
While |
bfloat16 is not a standard format, which makes it rather difficult to adopt into a W3C spec. |
@cynthia Well, given the current industry adoption and hardware support behind it, a standard is bound to happen at some point. |
It's fine that bfloat16 is not a standard yet. The field is constantly innovating, and not having a formal standard probably helps them move faster. But it does make it hard to adopt in a W3C standard. Besides, the benefits seem to mostly for training accelerators; and the current scope (correct me if I am wrong) doesn't include support for backward passes.
This would likely result in an unpleasant surprise for those who have to look it up later. We have enough cases of "it's in that spec because of legacy reasons" and continuing that antipattern is the last thing we should be promoting. |
see webmachinelearning/webnn#373 for an update on this topic |
@jasonmayes mentions the lack of support for float16 in JS and WASM environments as problematic for quantized models.
I see there was some discussion in JS land to add support for float16, but with no clear update in the past 2 years. Would this use case help give more momentum to the proposal?
There is a short discussion in the WebAssembly CG in the context of SIMD. Can anyone more involved in WebAssembly comment on this (@huningxin maybe?)
The text was updated successfully, but these errors were encountered: