Skip to content

Conversation

tgaddair
Copy link
Collaborator

No description provided.

@tgaddair tgaddair changed the base branch from master to tf-to-torch October 28, 2021 18:52
@github-actions
Copy link

github-actions bot commented Oct 28, 2021

Unit Test Results

       3 files  +       1         3 suites  +1   51m 4s ⏱️ + 13m 0s
2 846 tests ±       0  2 143 ✔️ ±       0  16 💤 ±  0     685 ±    0  2 🔥 ±0 
8 538 runs  +2 846  6 429 ✔️ +2 143  48 💤 +16  2 055 +685  6 🔥 +2 

For more details on these failures and errors, see this check.

Results for commit 432812b. ± Comparison against base commit 7a1b82c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@ShreyaR ShreyaR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Added a small question -- feel free to merge otherwise.

self.optimizer.synchronize()

# Clip gradients
self.clipper.clip_grads(variables)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question: Why do you want to perform gradient clipping on the parameter values before they were synced?

Copy link
Collaborator Author

@tgaddair tgaddair Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case it's after they are synced, but before applying the updates. So the ordering is:

optimizer.synchronize(). # waits for allreduce to complete
cliipser.clip_grads()  # clips aggregated gradients
optimizer.step()  # applies gradients

@tgaddair tgaddair merged commit c37b5e3 into tf-to-torch Oct 28, 2021
@tgaddair tgaddair deleted the hvd-torch branch October 28, 2021 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants