Learning about quantization. Coding samples from HuggingFace quantization courses.
SOTA Papers:
Finished Courses:
- HF Quantization Fundamentals: [https://www.deeplearning.ai/short-courses/quantization-fundamentals-with-hugging-face/]
- Basic quantization techniques in PyTorch
- PyTorch types (int8, float, bfloat16...) --> review these
- using "quanto"
- HF Quantization in Depth: [https://www.deeplearning.ai/short-courses/quantization-in-depth/]
- Linear quantization
- Asymmetric Linear: r = s(q - z); q = int(round(r/s + z))
- trade-off: more complex, memory to save zero point: but better use of quantization range
- Symmetric Linear: q = int(round(r/s)); s = rmax/qmax (no zero point)
- Per-channel, per-group options
- Building 8-bit quantizer (8W16A)
- Replace PyTorch linear layers with quantized layer
- Quantizing open-source models
- Weights packing algorithm
(These Medium articles are basically the HF tutorial with some extra explanation)
-
Intel neural compressor: [https://github.com/intel/neural-compressor/blob/master/docs/source/quantization.md]
-
HF Chart: [https://huggingface.co/docs/transformers/v4.45.2/quantization/overview]
-
PyTorch Basics (Review): [https://pytorch.org/blog/quantization-in-practice/]
-
GPTQ: [https://arxiv.org/abs/2210.17323]
Next to go through:
AMD Docs:
- AMD Quark: [https://quark.docs.amd.com]
- AMD ROCm: [https://rocm.docs.amd.com/en/latest]
Other Docs:
- PyTorch Quantization: [https://pytorch.org/docs/stable/quantization.html]
- intel/neural-compressor: [https://github.com/intel/neural-compressor/tree/master]
- huggingface/optimum-quanto: [https://github.com/huggingface/optimum-quanto]
- NVIDIA/TensorRT-Model-Optimizer: [https://github.com/NVIDIA/TensorRT-Model-Optimizer/]
- vllm-project/vllm: [https://github.com/vllm-project/vllm]
Research blogs in similar areas:
- HF blog
- PyTorch blog
- PyTorch dev forum
- NVIDIA blog
- AI research from Intel
- AI research from Qualcomm