Skip to content

[WANDB] add tracking for tokens#382

Merged
mayank31398 merged 15 commits intomainfrom
wandb
Feb 23, 2026
Merged

[WANDB] add tracking for tokens#382
mayank31398 merged 15 commits intomainfrom
wandb

Conversation

@mayank31398
Copy link
Collaborator

No description provided.

Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mayank31398, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the experiment tracking capabilities by introducing token-based progress metrics throughout the training and evaluation cycles. It also refines the logging of model parameters by caching their calculation and including them in the initial experiment arguments, providing richer metadata for each run.

Highlights

  • Token Tracking Integration: Introduced a new global_step_in_tokens variable to track training progress by the number of processed tokens, integrating it into the train, evaluate, track_metrics, and track_val_metrics functions across the codebase.
  • Model Parameter Caching and Logging: Modified the calculate_num_parameters method in base.py to cache computed parameter metadata and allow returning it as a dictionary. This metadata is now logged with experiment arguments via experiments_tracker.log_args.
  • Enhanced Experiment Logging: Updated experiment tracking functions to display and log the global_step_in_tokens alongside the traditional global_step, providing a more comprehensive view of training progress in terms of tokens.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lm_engine/model_wrapper/base.py
    • Modified calculate_num_parameters to cache parameter counts and accept a return_dict argument for flexible output.
  • lm_engine/pretrain.py
    • Added global_step_in_tokens to track_val_metrics, train, and evaluate function signatures and calls.
    • Initialized and updated global_step_in_tokens within the main training loop.
    • Included global_step_in_tokens in the metrics_tracker before logging.
    • Updated experiments_tracker.log_args call to include model parameter metadata.
  • lm_engine/train_utils.py
    • Updated track_metrics function signature to accept global_step_in_tokens.
    • Modified the logging message in track_metrics to display global_step_in_tokens.
  • lm_engine/utils/tracking.py
    • Extended ExperimentsTracker.log_args to accept arbitrary extra_metadata for logging additional arguments, including a check for duplicate keys.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds token tracking for W&B. The changes are generally well-implemented. I've left a couple of comments regarding a type hint that needs updating for correctness and a parameter name that could be improved for code clarity.

mayank31398 and others added 4 commits February 23, 2026 12:09
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Signed-off-by: Mayank Mishra <mayank31398@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mayank31398 mayank31398 merged commit 6fdcad5 into main Feb 23, 2026
@mayank31398 mayank31398 deleted the wandb branch February 23, 2026 20:24
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.

1 participant