calcualte some of norm on raw gradient#1
Open
rakkit wants to merge 1 commit into
Open
Conversation
rakkit
commented
Jan 9, 2026
| for ep_idx in range(u.shape[0]): | ||
| update_norms = calculate_norm( | ||
| u[ep_idx], self.norms_to_log, transpose=transpose | ||
| -lr * u[ep_idx], |
Collaborator
Author
There was a problem hiding this comment.
bugs in old code, should mul. -lr
rakkit
commented
Jan 9, 2026
| import torch | ||
| from torch.distributed.tensor import DTensor | ||
|
|
||
| DONT_TRACK_RAW_GRADIENT = os.getenv("DONT_TRACK_RAW_GRADIENT", "1") == "1" |
Collaborator
Author
There was a problem hiding this comment.
we can set export DONT_TRACK_RAW_GRADIENT=1 as enviroment varible to disble all of these new changes in case we want to reproduce smth
rakkit
commented
Jan 9, 2026
|
|
||
|
|
||
| @torch.no_grad() | ||
| def rank(W): |
Collaborator
Author
There was a problem hiding this comment.
This is the actual "rank" on (raw) gradient
ofivite
requested changes
Jan 13, 2026
ofivite
left a comment
Member
There was a problem hiding this comment.
lgtm, just need to change the name of metrics from track_update_{norm_name} to track_raw_grad_{norm_name} for those metrics in METRICS_ON_RAW_GRADIENT when DONT_TRACK_RAW_GRADIENT = False
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.