qd8-f16 quantization in xnnpack
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
I've recently read this tf-lite blogpost about faster inference with xnnpack, and would like to try it out in executorch.
I can see that there are qd8-f16 (and -f32) kernels being compiled when I compile xnnpack, but I'm not quite sure how to quantize my model with that config.
I guess that I would need a QuantizationSpec for activations that specifies the dtype. Is it enough to simply make a QuantizationSpec(dtype=torch.float16) and then use the other code from get_symmetric_quantization_config (torch.ao./../.xnnpack_quantizer) with is_dynamic=True?
cc @digantdesai @mcr229
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the QuantizationSpec usage and the get_symmetric_quantization_config and xnnpack_quantizer entry points mentioned in the issue, including how is_dynamic is handled. Determine whether qd8-f16 quantization is currently exposed by executorch and identify the expected configuration and validation path. Done should include a documented, working way to quantize a model with this configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100