Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the retention for existing gradients in the Grad Acc API #8658

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

rpsilva-aws
Copy link
Collaborator

In this PR, we fix an issue in which the existing branch to check for existing gradients in the model parameters is ambiguous without explicitly adding the None comparator.

This branch was originally created to maintain the gradients if there is already preliminary computation. However, we have noticed that the time transferring to the device can also be a bottleneck. This can be mitigated by not zero'ing the gradients to None, but instead retaining them as zeros.

@rpsilva-aws rpsilva-aws marked this pull request as ready for review January 31, 2025 00:49
@rpsilva-aws rpsilva-aws merged commit 39dd795 into pytorch:master Jan 31, 2025
12 checks passed
@rpsilva-aws rpsilva-aws deleted the rpsilva_grad_acc_init_grad branch January 31, 2025 04:52
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