Repository navigation
Add gradient-tracking implementation (v0.2.2) for comparison - #193
Open
mbilalazam wants to merge 1 commit into
Open
mbilalazam wants to merge 1 commit into
mbilalazam wants to merge 1 commit into
Conversation
Gradient tracking implementation from my GrapPA shower study on SPINE v0.2.2, uploaded as the full manager.py exactly as it ran.
It adds an optional grad_tracker dict to initialize_train (a submodule prefix and an optional depth) and a compute_grad_norms() method. After loss.backward() and before optimizer.step(), it takes the L2 norm of each parameter's gradient, strips the submodule prefix so standalone and full-chain column names match, and adds grad_<name> and grad_total to the result, which puts them in the training CSV.
Config:
train:
grad_tracker:
submodule: grappa_shower
On a full-chain GrapPA shower run the CSV gained 160 grad_ columns, 159 parameters plus grad_total. Leaving the block out changes nothing.
mbilalazam
marked this pull request as ready for review
November 17, 2026 18:40
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.
Gradient tracking implementation from my GrapPA shower study on SPINE v0.2.2, uploaded as the full manager.py exactly as it ran.
It adds an optional
grad_trackerdict toinitialize_train(a submodule prefix and an optional depth) and acompute_grad_norms()method. Afterloss.backward()and beforeoptimizer.step(), it takes the L2 norm of each parameter's gradient, strips the submodule prefix so standalone and full-chain column names match, and addsgrad_<name>andgrad_totalto the result, which puts them in the training CSV.Config:
On a full-chain GrapPA shower run the CSV gained 160
grad_columns, 159 parameters plusgrad_total. Leaving the block out changes nothing.