Quantized ONNX models on IREE with Vulkan backend
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 47
Description
I am interested in quantizing a YOLO-NAS model to run on an embedded GPU with a vulkan backend. To achieve better performance, I've performed Post-Training Quantization on the model, using a small calibration dataset.
I am starting with an ONNX format, which I import with _iree-import-onnx_ into a *.mlir format.
I notice that, on the MLIR file, most of the operands have been kept on a float 32 bits data type (Possibly ignored on quantization pass).
Then, I use the following to compile:
` iree-compile YOLO_NAS.mlir --iree-hal-target-device=vulkan --iree-vulkan-target=architecture_name --output-format=vm-bytecode -o YOLO_NAS.vmfb`
I saw there are some flags that can be used for compiling considering quantization, such as:
--iree-global-opt-enable-quantized-matmul-reassociation
--iree-input-demote-f32-to-f16
--iree-input-demote-i64-to-i32
--Iree-global-opt-enable-demote-contraction-inputs-to-bf16=all
However, even with those flags, the model still performs poorly on the GPU, taking too long to realize inferences.
Is there a preferred way on IREE to deal with quantized models that should increase performance? Especially for Vulkan backends.
Thanks for the support.
Contributor guide
Assessment
This issue has not been assessed yet.