Closed tudorcebere closed 11 months ago
Thanks for flagging. I would recommend to use functorch for this use case (i.e. grad_sample_mode='no_op'
and use vmap to compute gradients, see https://github.com/pytorch/opacus/blob/main/examples/cifar10.py for an eaxmple).
I'm trying to use fmodel for my usecase in a similar fashion as in the cifar10.py example but I'm getting the following error when trying to run predictions = fmodel(params, batch)
AttributeError: 'Tensor' object has no attribute '_forward_counter'
@alexandresablayrolles @HuanyuZhang have there been any recent updates that is breaking the code?
🚀 Feature
Firstly, thanks for the awesome tool!
Torch 2.0 is around the corner and I was curios if opacus will support compiled models, so we can benefit from the awesome speedups. Is this sometimething on the roadmap of the library?
Colab to show the error: https://colab.research.google.com/drive/1fmwrgg1NR1qII7TWPZeyGJddUickxudQ?usp=sharing