Add wandb logging callback for Trainer#173
Open
zywilliamli wants to merge 4 commits intomagic-wmdp-attributionfrom
Open
Add wandb logging callback for Trainer#173zywilliamli wants to merge 4 commits intomagic-wmdp-attributionfrom
zywilliamli wants to merge 4 commits intomagic-wmdp-attributionfrom
Conversation
- Add bergson/utils/logging.py with wandb_log_fn() factory - Wire into magic_wmdp.py with --wandb_project flag (default: "magic-wmdp") - Logs per-step training loss on rank 0, set --wandb_project "" to disable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7822c63 to
fe53803
Compare
for more information, see https://pre-commit.ci
Stores per-step loss on the Trainer instance during step() and calls the optional log_fn(step, loss) callback after each training step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
@claude could you please fix the pre-commit issues |
|
Claude encountered an error —— View job Fixing pre-commit issues
|
|
Claude encountered an error —— View job Fixing pre-commit issues
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
you probably want to merge this into the main magic branch |
Collaborator
|
@zywilliamli this can merge into main now |
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.

Summary
bergson/utils/logging.pywith awandb_log_fn()factory that creates alog_fncallback compatible withTrainer.train()scripts/reconstruct_loss.pyfor optional loss logging during checkpoint reconstructionTest plan
from bergson.utils.logging import wandb_log_fnimports cleanlywandb_log_fn("test-project")as thelog_fn🤖 Generated with Claude Code