Skip to content

Conversation

@finbarrtimbers
Copy link
Collaborator

We ran into issues on Olmo 3 where we were supposedly checkpointing, but the checkpoints weren't happening. This validates that the artifacts (checkpoints, rollouts) actually exist.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @finbarrtimbers, 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 introduces a critical set of artifact verification mechanisms to prevent silent failures during model training and saving. By adding explicit checks for the existence and integrity of model checkpoints, DeepSpeed state checkpoints, and rollout traces, it ensures that saved artifacts are valid and complete. This directly addresses past issues where checkpointing was reported as successful but the artifacts were found to be missing or corrupted, thereby improving the reliability of the training process.

Highlights

  • Artifact Verification Functions: Introduced new functions (verify_model_checkpoint, verify_deepspeed_state_checkpoint, verify_traces) to validate the integrity and existence of saved model checkpoints, DeepSpeed state checkpoints, and rollout traces.
  • Integrated Verification: Integrated these verification checks into the model saving (maybe_save_checkpoint, save_final_model) and DeepSpeed checkpointing workflows to ensure artifacts are valid upon creation.
  • Verification Logging: Added a log_verification function to output verification results to the console and optionally to Weights & Biases (wandb) for better monitoring.
  • Wandb Tag Handling: Adjusted the setup_experiment_tracking function to correctly handle args.exp_name as an optional tag for wandb, preventing potential errors when exp_name is not provided.
  • Type Hint Refinement: Refined the type hint for loss_denominator in ExperimentConfig from str | float to str and added a type ignore comment to address a type checking issue.

🧠 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.

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 introduces validation for artifacts like model checkpoints, DeepSpeed states, and training traces to ensure they are created correctly. The changes look good and address the problem described. I've provided a few suggestions to improve the conciseness and readability of the new verification functions. Additionally, I've identified a type hint inconsistency in grpo_utils.py that should be corrected.

Comment on lines 187 to 196
rollouts_path = pathlib.Path(rollouts_save_path)
if not rollouts_path.exists():
return False

metadata_file = rollouts_path / f"{run_name}_metadata.jsonl"
if not metadata_file.exists():
return False

rollout_files = list(rollouts_path.glob(f"{run_name}_rollouts_*.jsonl"))
return len(rollout_files) > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This function can be simplified for better readability and efficiency.

  1. The check for rollouts_path.exists() is redundant because metadata_file.exists() implicitly checks for the parent directory's existence.
  2. Using any() with a generator expression is more memory-efficient than creating a list with glob() and checking its length, as any() will stop at the first match.
    rollouts_path = pathlib.Path(rollouts_save_path)
    metadata_file = rollouts_path / f'{run_name}_metadata.jsonl'
    if not metadata_file.exists():
        return False

    return any(rollouts_path.glob(f'{run_name}_rollouts_*.jsonl'))

"use_vllm_logprobs sets old_logprobs to vLLM logprobs, making importance sampling pointless."
)
self.loss_denominator = utils.get_denominator(self.loss_denominator)
self.loss_denominator = utils.get_denominator(self.loss_denominator) # type: ignore[assignment]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This type: ignore is only necessary because the type hint for loss_denominator was incorrectly changed to str. If you restore the type hint to str | float as suggested in the other comment, this ignore comment can be removed.

Suggested change
self.loss_denominator = utils.get_denominator(self.loss_denominator) # type: ignore[assignment]
self.loss_denominator = utils.get_denominator(self.loss_denominator)

@finbarrtimbers finbarrtimbers force-pushed the finbarr/validate-artifacts branch from 226ad6d to 727e909 Compare January 21, 2026 16:38
finbarrtimbers and others added 8 commits January 21, 2026 11:59
The `str | float` union type caused HfArgumentParser to incorrectly
parse the CLI argument as float, failing when "token" was passed.
Changed to `str` since values are always parsed as strings from CLI
and converted in __post_init__.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1. Fix wandb tags validation error when exp_name is None by
   conditionally including it in the tags list
2. Update tool_grpo_fast.sh to use the new tool configuration format:
   - Change --tools code search to --tools python serper_search
   - Add --tool_call_names code search
   - Replace deprecated --search_api_endpoint and --code_tool_api_endpoint
     with --tool_configs JSON format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add verification functions that check checkpoint integrity and log results
to console (✓/✗) and wandb. Verifications run after model checkpoints,
DeepSpeed state checkpoints, and at end of training.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Filter out None exp_name before passing to wandb.init tags to avoid
pydantic validation error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@finbarrtimbers finbarrtimbers force-pushed the finbarr/validate-artifacts branch from 727e909 to ace5505 Compare January 21, 2026 19:11
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