Registry / ai-ml / mct-quantizers

mct-quantizers

JSON →
library1.7.0pypypiunverified

MCT Quantizers is a Python library that provides infrastructure for supporting neural network compression through quantization-aware training and post-training quantization. It is part of the Model Compression Toolkit (MCT) ecosystem. Version 1.7.0 requires Python >=3.10. The library is actively maintained with regular releases.

pip install mct-quantizers
INSTALL
IMPORT
SIG · MCT-QUANTIZERS
M
mct-quantizers
ai-mlpythonv1.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QuantizationConfig
from mct_quantizers import QuantizationConfig
from mct.quantizers import QuantizationConfig
MCT Quantizers uses underscore in package name, not dot.
PostTrainingQuantization
from mct_quantizers.pytorch import PostTrainingQuantization
from mct_quantizers import PostTrainingQuantization
PostTrainingQuantization is under framework-specific submodule.
Logger
from mct_quantizers.logger import Logger
import mct_quantizers.logger
Logger is a class, must be imported explicitly.

Basic usage: quantize a PyTorch model with post-training quantization.

import torch from mct_quantizers.pytorch import QuantizationConfig, PostTrainingQuantization # Create a simple model model = torch.nn.Sequential(torch.nn.Linear(10, 5), torch.nn.ReLU()) # Define quantization configuration config = QuantizationConfig(n_bits=8, per_channel=True) # Apply post-training quantization ptq = PostTrainingQuantization(model, config) quantized_model = ptq.quantize() # Save the quantized model torch.save(quantized_model.state_dict(), 'quantized_model.pth')
Debug
Known issues
breakingIn version 1.5.0, the import path for QuantizationConfig changed from mct_quantizers.quantization to mct_quantizers. Old code will break.
fix
Update imports: replace 'from mct_quantizers.quantization import QuantizationConfig' with 'from mct_quantizers import QuantizationConfig'.
affects: <1.5.0
deprecatedPostTrainingQuantization for TensorFlow models is deprecated since version 1.6.0 and will be removed in future releases. Use PyTorch or ONNX variants instead.
fix
If using TensorFlow, migrate your pipeline to PyTorch or use mct-quantizers with ONNX backend.
affects: ≥1.6.0
gotchaWhen using multi-GPU, the quantization process may fail if the model is not properly wrapped with DataParallel. This is not automatically handled.
fix
Wrap your model with torch.nn.DataParallel before passing to PostTrainingQuantization.
affects: all
Upgrade
Version history
1.7.0latest on PyPI · released Mar 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mct-quantizers — pip install mct-quantizers · libregistry