We may earn an affiliate commission when you visit our partners.
Course image
Younes Belkada and Marc Sun

In Quantization in Depth you will build model quantization methods to shrink model weights to ¼ their original size, and apply methods to maintain the compressed model’s performance. Your ability to quantize your models can make them more accessible, and also faster at inference time.

Implement and customize linear quantization from scratch so that you can study the tradeoff between space and performance, and then build a general-purpose quantizer in PyTorch that can quantize any open source model. You’ll implement techniques to compress model weights from 32 bits to 8 bits and even 2 bits.

Read more

In Quantization in Depth you will build model quantization methods to shrink model weights to ¼ their original size, and apply methods to maintain the compressed model’s performance. Your ability to quantize your models can make them more accessible, and also faster at inference time.

Implement and customize linear quantization from scratch so that you can study the tradeoff between space and performance, and then build a general-purpose quantizer in PyTorch that can quantize any open source model. You’ll implement techniques to compress model weights from 32 bits to 8 bits and even 2 bits.

Join this course to:

1. Build and customize linear quantization functions, choosing between two “modes”: asymmetric and symmetric; and three granularities: per-tensor, per-channel, and per-group quantization.

2. Measure the quantization error of each of these options as you balance the performance and space tradeoffs for each option.

3. Build your own quantizer in PyTorch, to quantize any open source model’s dense layers from 32 bits to 8 bits.

4. Go beyond 8 bits, and pack four 2-bit weights into one 8-bit integer.

Quantization in Depth lets you build and customize your own linear quantizer from scratch, going beyond standard open source libraries such as PyTorch and Quanto, which are covered in the short course Quantization Fundamentals, also by Hugging Face.

This course gives you the foundation to study more advanced quantization methods, some of which are recommended at the end of the course.

Enroll now

What's inside

Syllabus

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Focuses on techniques for model efficiency to minimize cost
Teaches advanced topics in machine learning, such as quantization and lossy compression
Taught by industry professionals with expertise in deep learning optimization
Practical skills and knowledge applicable to real-world ML projects

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Build custom quantizers with pytorch

According to students, this course provides an in-depth exploration of model quantization, focusing on building custom quantizers from scratch in PyTorch. Many highlight the practical, hands-on implementation of techniques to shrink model weights and maintain performance. Learners appreciate the detailed coverage of concepts like asymmetric and symmetric modes and various granularities. While the course is praised for its rigor and ability to equip professionals with valuable skills for model deployment, a notable portion found it challenging, indicating that prerequisites are higher than expected, especially for those without prior advanced ML or strong mathematical foundations. Overall, it's considered a highly valuable resource for those seeking to master quantization beyond standard libraries.
Concepts are generally well-explained, but some advanced sections can be dense.
"The explanations of asymmetric vs. symmetric modes were crystal clear. Highly recommend for ML engineers!"
"Some parts, especially the 2-bit packing, were quite challenging and required rewatching lectures, but the effort was worth it."
"Some explanations were a bit dense, and I had to pause frequently to research external materials."
Logically organized progression, though pacing may be quick for some learners.
"The course is well-structured and the examples are practical."
"The course flow was excellent, each section built well on the previous one... well-paced for someone with a solid ML background."
"While excellent, I think the course assumes more prior knowledge than 'Quantization Fundamentals' provides. Labs were okay, but sometimes the explanations felt too fast."
Equips learners with highly relevant skills for optimizing and deploying ML models.
"Absolutely invaluable for my work! I now feel confident in applying quantization techniques to shrink my models for faster inference."
"The techniques taught here are directly applicable to my work in optimizing large language models for production."
"I can immediately apply these quantization methods to make my models faster and more accessible."
Offers profound insights and practical experience in building custom quantizers.
"This course is a masterpiece for anyone serious about model deployment optimization. Building the PyTorch quantizer from scratch was incredibly rewarding."
"Absolutely invaluable for my work! The focus on implementing from scratch rather than just using libraries really gives you a deep understanding."
"Hands-on, deep, and incredibly relevant. This course taught me not just how to use quantization, but how it actually works under the hood."
Requires a solid background in deep learning, math, and PyTorch for optimal learning.
"The content is good and 'in depth' as promised, but the prerequisites were understated. I struggled a lot without a stronger background in linear algebra."
"Found this course extremely difficult. I spent more time debugging than understanding. This feels more for researchers or highly specialized engineers."
"Good course if you already have a very strong foundation. It's not for those just dabbling. The 2-bit section was particularly opaque."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Quantization in Depth with these activities:
Review Python Basics
Reinforce your understanding of Python basics, which will provide a solid foundation for the course.
Browse courses on Python Basics
Show steps
  • Review Python data types, operators, and control flow.
  • Practice writing and running simple Python programs.
  • Review object-oriented programming concepts in Python.
Linear Quantization Exercises
Enhance your understanding of linear quantization by completing a series of exercises.
Show steps
  • Implement linear quantization functions with different modes and granularities.
  • Measure the quantization error of each option.
  • Analyze the performance and space trade-offs for each option.
Custom PyTorch Quantizer
Deepen your understanding of quantization by building a custom PyTorch quantizer.
Show steps
  • Design and implement a general-purpose quantizer in PyTorch.
  • Quantize a specific open source model using your custom quantizer.
  • Validate the accuracy and performance of the quantized model.
One other activity
Expand to see all activities and additional details
Show all four activities
Quantization Blog Post
Solidify your understanding of quantization by writing a blog post explaining the concepts.
Browse courses on Quantization
Show steps
  • Research and summarize the key principles of quantization.
  • Discuss the benefits and limitations of quantization.
  • Share your insights and learnings with others.

Career center

Learners who complete Quantization in Depth will develop knowledge and skills that may be useful to these careers:

Reading list

We've selected 50 books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Quantization in Depth.
The definitive mathematical canon of modern deep learning, establishing foundational theory across numerical computation, backpropagation optimization, autoencoders, and generative modeling.
The premier applied machine learning masterwork, taking practitioners through intuitive concept breakdowns, production-grade Scikit-Learn workflows, and deep neural architecture implementations.
Gersho and Gray wrote the definitive bible on scalar and vector quantization, rate-distortion theory, Lloyd-Max quantizers, and codebook design. Both classical multimedia compression and modern neural network weight quantization trace their mathematical algorithms directly to this landmark reference.
A timeless mathematical masterpiece that provides an uncompromising Bayesian and probabilistic foundation for linear classifiers, graphical models, kernel methods, and sampling algorithms.
Sayood devotes extensive, intuition-rich chapters to uniform and non-uniform scalar quantization, companding, pdf-optimized quantizers, and structured vector quantization. Concrete audio, image, and speech coding examples demonstrate how quantization error interacts with entropy coding.
Provides a comprehensive view of system performance analysis and tuning across various operating systems and environments, including enterprise systems and cloud platforms. It is highly regarded in the field and is valuable as a reference for understanding the methodologies and tools used in performance optimization. It delves into the internals of systems, making it suitable for those seeking a deeper understanding beyond basic tuning techniques. This book is commonly used by industry professionals.
The definitive mathematical and theoretical canon of statistical learning, establishing the rigorous analytical foundations of regularized regression, tree ensembles, and high-dimensional inference.
Guides deep learning practitioners step-by-step through implementing transformer self-attention, token embeddings, and multi-layer perceptrons in pure PyTorch without relying on high-level wrappers.
A distilled practitioner field guide outlining best practices for the entire machine learning lifecycle, from problem formulation and feature engineering to model deployment and monitoring.
Provides an essential hands-on manual for fine-tuning pre-trained transformer representations, covering transfer learning workflows, tokenizer optimizations, and production pipeline deployment.
Delivers an end-to-end systems architecture guide for building reliable production ML systems, addressing data engineering trade-offs, real-time feature computation, and model drift mitigation.
Illuminates modern generative neural architectures through celebrated visual diagrams and code workflows, covering contrastive embeddings, semantic search, and retrieval-augmented generation.
Widrow and Kollár develop a rigorous statistical theory of quantization by modeling roundoff and analog-to-digital conversion as an additive white noise source via characteristic functions. Engineers designing fixed-point DSP filters and floating-point arithmetic systems gain deep analytical tools.
Bridges linear algebra, multivariable calculus, vector geometry, and probability directly to fundamental machine learning algorithms like PCA, Gaussian mixture models, and support vector machines.
An updated edition of the popular 'Deep Learning with PyTorch', this book includes new content on transformers and generative AI models, reflecting contemporary advancements in the field. It builds upon the foundational knowledge of the first edition, making it valuable for those seeking to stay current with PyTorch and deep learning.
Examines production-grade engineering patterns for training and serving large language models, addressing distributed GPU training, synthetic data pipelines, and quantitative model evaluations.
A definitive guide for Java developers, this book provides detailed insights into tuning and optimizing Java applications. It covers JVM internals, garbage collection, and threading, offering practical advice and techniques. It is considered a must-read for Java professionals and is often referenced for its in-depth coverage of Java-specific performance issues.
Delivers an interactive, comprehensive curriculum teaching multi-layer perceptrons, convolutional neural networks, attention mechanisms, and optimization math with runnable multi-framework code.
Focusing on database performance, this book must-read for anyone working with MySQL. It covers essential techniques for optimizing MySQL databases, including query tuning, schema design, and leveraging features for scalability. It widely recognized resource in the database community.
Oppenheim and Schafer provide the gold-standard treatment of periodic sampling, A/D quantization error analysis, oversampled noise shaping, and finite-word-length effects in digital filters. Every signal processing engineer relies on these chapters to prevent limit cycles and coefficient degradation.
Takes a top-down approach, focusing on practical applications of deep learning using the fastai library, which is built on PyTorch. It quickly gets readers building models for computer vision, natural language processing, and tabular data, while also covering underlying concepts. It's highly recommended for those who want to get hands-on with PyTorch quickly and see it applied to real-world problems.
Instructs data scientists on applied model evaluation, cross-validation, hyperparameter tuning, and pipeline construction through Scikit-Learn maintainers Andreas Müller and Sarah Guido.
High-resolution audio and wireless receivers rely on oversampling and delta-sigma modulation to push coarse 1-bit quantization noise out of the signal band. Pavan, Schreier, and Temes walk hardware and DSP designers through noise transfer functions, decimation filters, and circuit trade-offs.
A guide for C++ developers, this book focuses on optimizing the performance of C++ applications. It covers identifying bottlenecks, measuring performance, optimizing data structures and algorithms, and utilizing multi-core processors. It practical resource for C++ programmers aiming to improve code efficiency.
Deploying modern machine learning models onto microcontrollers and edge DSPs requires quantizing 32-bit floating-point weights and activations down to 8-bit or 4-bit integers. Situnayake and Plunkett explain post-training quantization and quantization-aware training in practical production workflows.
Save
Offers a technical deep dive into Java performance, analyzing code at the bytecode level and providing practical optimization techniques for JVM applications. It complements Scott Oaks' book by offering a slightly different perspective and more code-centric examples. It valuable resource for experienced Java developers seeking to fine-tune their applications.
Details battle-tested infrastructure patterns for deploying deep reasoning models, addressing memory bandwidth limits, continuous GPU batching, semantic caching, and operational latency minimization.
Investigates the engineering realities of running automated ML pipelines in production, addressing data drift detection, automated retraining loops, telemetry infrastructure, and continuous validation.
Deploying deep neural networks on edge hardware depends on aggressive parameter quantization, binary/ternary weight representations, and low-bitwidth training. Zhang and colleagues analyze how quantization-aware optimization preserves representational capacity under tight memory budgets.
Focuses on token segmentation, attention context preservation, and hierarchical chunking, giving deep learning engineers targeted techniques to maximize transformer retrieval accuracy.
Details cloud-native DevOps architectures for orchestrating automated machine learning lifecycles, integrating CI/CD triggers, model registry synchronization, and automated hyperparameter sweep workers.
Analyzes edge-inference architectures for open-weights neural models, tackling parameter quantization, GGUF execution, KV cache memory bottlenecks, and efficient desktop serving.
This highly-regarded book provides essential guidelines and best practices for programming in Java. Many of the recommendations contribute to writing more efficient and performant Java code. It must-read for serious Java developers and serves as an excellent reference for writing high-quality, performant Java applications.
Demonstrates how to leverage PyTorch 2.0 compiler optimizations and torch.compile to accelerate transformer training, attention layer fusion, and distributed model parallelism.
Delves into the performance aspects of computer networking, particularly in the context of web browsers. It covers topics like TCP, UDP, and HTTP, explaining how network protocols impact web performance. It is essential reading for anyone involved in optimizing the delivery of web content.
Provides a foundational understanding of performance engineering principles, covering the entire software development lifecycle. It discusses performance modeling, requirements, testing, and scalability. It useful resource for gaining a broad understanding of performance engineering as a discipline.
Delves into more advanced PyTorch techniques for building and deploying complex deep learning models, including CNNs, RNNs, transformers, and generative models. It covers topics like optimizing training with multiple GPUs and deploying models to production, making it suitable for those looking to deepen their understanding and apply PyTorch in a professional setting.
Razavi examines the physical and architectural mechanisms that turn continuous analog voltages into discrete digital codes across flash, folding, pipelined, and successive-approximation converters. Detailed analyses of differential nonlinearity and aperture jitter ground quantization in silicon reality.
Presents the foundational treatise on Markov decision processes, temporal-difference learning, and policy gradient methods that underpin autonomous decision-making and modern post-training alignment.
Teaches computer vision fundamentals through concrete deep learning examples, from object detection and image segmentation to face recognition and generative vision architectures.
Similar to the NLP book, this resource provides practical recipes and solutions for computer vision problems using PyTorch. It covers tasks like image classification, object detection, and segmentation with clear code examples. It's a go-to guide for anyone applying PyTorch to computer vision.
Vetterli, Kovačević, and Goyal unify Hilbert-space signal representations with sampling and quantization theory for modern digital communications. Clear geometric explanations clarify how subspace projections interact with finite-rate quantization in transform coding.
Connects computational linguistics theory to modern neural NLP architectures, demonstrating how vector embeddings, recurrent networks, and self-attention capture semantic nuances.
Considered a classic in the field of Software Performance Engineering (SPE), this book lays out the foundational principles and practices for building performance into software systems from the outset. While an older publication, its methodologies are still highly relevant for understanding the SPE process. It is more valuable for its foundational concepts than as a current reference for specific technologies.
Bridges technical interview theory and practical research insights, answering 30 crucial conceptual questions about neural architectures, gradient dynamics, and model evaluation.
Focuses on building generative AI applications using Python and PyTorch. It covers modern topics like LLMs, Transformers, GANs, and diffusion models with hands-on projects. It's highly relevant for those interested in the latest advancements in generative AI and their implementation in PyTorch.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Quantization in Depth.
AI with Python: Apply & Implement ML Models
Most relevant
Deep Learning with PyTorch : GradCAM
Most relevant
Quantization Fundamentals with Hugging Face
Most relevant
Programming Generative AI: Unit 1
Most relevant
Applied Natural Language Processing in Engineering Part 2
Most relevant
Build Basic Generative Adversarial Networks (GANs)
Most relevant
PyTorch: Advanced Architectures and Deployment
Most relevant
Foundations and Core Concepts of PyTorch
Most relevant
Facial Keypoint Detection with PyTorch
Most relevant

Coursera Buyer Protection & Guarantee

Verified partner policies & purchase protections

Accredited University Partner
Free Trial & Audit

7-Day Free Trial & Free Audit

7-day free trial on monthly Coursera Plus subscriptions; free audit option available on most individual courses to explore video lectures and readings at no charge.

Return & Refund Policy

14-Day Refund Guarantee

14-day refund window on annual Coursera Plus subscriptions and single-course purchases prior to certificate issuance. Monthly subscriptions do not offer refunds once billed.

Buyer Protections

Verified Academic & Industry Partner

Accredited university and industry certifications (e.g. Stanford, Google, IBM, Yale), secure SSL payment processing, and verifiable digital certificate links.

Key Purchase Protections
14-day refund window on annual Coursera Plus and single courses
7-day free trial on monthly Coursera Plus subscriptions
Free course audit option for lectures and readings
Verified certificates from top universities & companies
OpenCourser Verified Partner Policy details last reviewed: 2026-10-22
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser