awslabs / fast-differential-privacy

Fast, memory-efficient, scalable optimization of deep learning with differential privacy
Apache License 2.0
83 stars 11 forks source link

Fix missing "set_to_none" when using transformers==4.29 #35

Closed jyhong836 closed 1 month ago

jyhong836 commented 1 month ago

Issue #, if available:

zero_grad_DP_stage3(set_grads_to_None=True) in transformers==4.29 is changed to zero_grad_DP_stage3(set_to_none=True)

Description of changes:

I add an ad-hoc fixture to the arg.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.