Shortcuts

ComposableQATQuantizer

class torchao.quantization.qat.ComposableQATQuantizer(quantizers: List[TwoStepQuantizer])[source]

Composable quantizer that users can use to apply multiple QAT quantizers easily. Quantizers will be applied in the order they are specified in the constructor.

Note: the quantizers provided must apply to different modules in the model, e.g. nn.Linear and nn.Embedding, otherwise the behavior will be undefined.

Example usage:

my_quantizer = ComposableQATQuantizer([
    QATQuantizer1(),
    QATQuantizer2(),
    QATQuantizer3(),
])
model = my_quantizer.prepare(model)
train(model)
model = my_quantizer.convert(model)

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources