Closed lberrada closed 3 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
ℹ️ Googlers: Go here for more info.
Hi, sorry for the late reply, I was on vacation.
I have tried to address all comments, let me know if this is fine or if there is anything else to change.
NB: I have squashed all commits into a single one.
@shs037 thanks for the review! It now looks like a test is failing in a part of the code that is independent of this PR? Let me know if there is something that I can do on my end
Sorry we're trying to fix it and will let you know asap.
@lberrada please sync with master and this will solve the problem with failing tests
Done, thanks!
This PR implements a two-phase algorithm for per-sample gradient clipping with the goal of improving memory efficiency for the training of private deep models. The two steps are: (1) accumulate the norms of the gradient per sample and (2) use those norm values to perform a weighted backward pass that is equivalent to per-sample clipping. The user can choose whether to use this new algorithm or the currently implemented one through a boolean argument.
The unit-tests have been adapted to check results for both algorithms.
Let me know if this fits well!