Deprecation warning with latest torch and opacus

With the latest versions:

opacus==0.14.0
torch==1.9.0

I’m getting the following deprecation warnings when running the CIFAR10 example:

/local_disk0/.ephemeral_nfs/envs/pythonEnv-4ed4226e-cb69-4f21-bbff-ba9e9ab8fc55/lib/python3.7/site-packages/torch/nn/modules/module.py:974: UserWarning: Using a non-full backward hook when the forward contains multiple autograd Nodes is deprecated and will be removed in future versions. This hook will be missing some grad_input. Please use register_full_backward_hook to get the documented behavior.
  warnings.warn("Using a non-full backward hook when the forward contains multiple autograd Nodes "

Is this the expected behavior? Should I be concerned with the warning saying This hook will be missing some grad_input?

Thank you!

Hi!
Yeah, that’s somewhat expected - we never migrated to register_full_backward_hook since it was released in PyTorch 1.8.
We’ll fix that soon (thanks for raising this!). But in the meantime, as far as I’m aware, this shouldn’t create any problems (at least with 1.9) - all our tests are passing and we never received any reports of this causing any issues

2 Likes

I got the same warning message with Pytorch 1.10