pytorch / opacus

Training PyTorch models with differential privacy
https://opacus.ai
Apache License 2.0
1.67k stars 332 forks source link

EmbeddingBag with offsets is not supported on Opacus #518

Closed karthikprasad closed 1 year ago

karthikprasad commented 1 year ago

🐛 Bug

Opacus only captures the first argument to a module's forward as activations in the capture_activations_hook and misses out on other args such as offsets in case of nn.EmbeddingBag

This results in an error during per-sample grad computation even with functorch.

COLAB: https://drive.google.com/file/d/1wvfO3roibmYxtHV_SBcdW3PjkrkCxalW/view?usp=sharing

alexandresablayrolles commented 1 year ago

Closed by #519