Relates to webmachinelearning/webnn#252
Some accelerators use non-standard float point types (e.g. bfloat16 and TF32). They are important to achieve high performance (e.g. by using Nvidia's tensor cores), and/or reduce resource usage (e.g. FP32->FP16 reduces memory usage by half).
How could MLLoader leverage these types? Some ideas:
- Do it transparently, auto convert based on the accelerator
- Should the API allow JS code to specify acceptable quantization levels (e.g. use bf16 but not fp16)
- What if the chip doesn't support the model's declared data type (e.g. BF16 chip + FP32 model)
Relates to webmachinelearning/webnn#252
Some accelerators use non-standard float point types (e.g. bfloat16 and TF32). They are important to achieve high performance (e.g. by using Nvidia's tensor cores), and/or reduce resource usage (e.g. FP32->FP16 reduces memory usage by half).
How could MLLoader leverage these types? Some ideas: