The FC Quantization package provides a comprehensive solution for model compression through quantization techniques. Integrated with federated learning frameworks and built upon the capabilities of PyTorch's quantization functionalities, this package facilitates efficient distributed training suitable for various machine learning tasks.
-
Configure Quantization:
- Set up initial quantization settings.
self.configure_quant(model, backend, quant_typ)
- Set up initial quantization settings.
-
Train Local Model:
-
If using post-static quantization:
- Train the model.
- Prepare for post-static quantization.
prep_post_static_quant(model, train_loader, backend)
-
Else:
- Prepare for quantization-aware training.
pf.prepare_qat(model,backend)
- Train the prepared model.
-
-
Reconfigure Quantization:
- Update quantization settings for the trained model.
self.configure_quant(prepared_model, backend, quant_typ)
-
Send Data to Coordinator:
- Send the prepared model data to the coordinator.