Hi everyone!
The problem reported by @James_M is fixed in this pull request 4. You can now add PrivacyEngine to LightningModel (see the demo in examples/mnist_lightning.py).
As we are working on the new API in experimental_v1.0 branch, I’m exploring ways to implement tighter (ideally seamless) integration between PyTorch Lightning and Opacus. In this RFC 1 I’ve shared some thoughts on how this integration can be implemented. Feedback and comments are much appreciated. Actually, I need help there.
@NiWaRe Many thanks for your prototype!
In LitModelDP we now can use automatic_optimization=True.
In my demos I simply put all the DP parameters in LightningModule.init so that we can enable DP and configure it via --model.xxx cmdline args. Extending LightningCLI is indeed a good next step.