Train PyTorch models with Differential Privacy
Maintained. Last release 7 months ago, commits in 4 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install opacusOpacus is a library that enables training PyTorch models with differential privacy. It supports training with minimal code changes required on the client, has little impact on training performance, and allows the client to online track the privacy budget expended at any given moment.
Target audience
This code release is aimed at two target audiences:
- ML practitioners will find this to be a gentle introduction to training a model with differential privacy as it requires minimal code changes.
- Differential Privacy researchers will find this easy to experiment and tinker with, allowing them to focus on what matters.
Latest updates
2024-12-18: We updated this tutorial to show how LoRA and peft library could be used in conjuncture with DP-SGD.
2024-08-20: We introduced Fast Gradient Clipping and Ghost Clipping(https://arxiv.org/abs/2110.05679) to Opacus, significantly reducing the memory requirements of DP-SGD. Please refer to our blogpost for more information.