-
Notifications
You must be signed in to change notification settings - Fork 491
Validates artifacts #1407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Validates artifacts #1407
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello @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
🧠 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 AssistThe 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
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 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
|
There was a problem hiding this 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.
open_instruct/grpo_fast.py
Outdated
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be simplified for better readability and efficiency.
- The check for
rollouts_path.exists()is redundant becausemetadata_file.exists()implicitly checks for the parent directory's existence. - Using
any()with a generator expression is more memory-efficient than creating a list withglob()and checking its length, asany()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'))
open_instruct/grpo_utils.py
Outdated
| "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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| self.loss_denominator = utils.get_denominator(self.loss_denominator) # type: ignore[assignment] | |
| self.loss_denominator = utils.get_denominator(self.loss_denominator) |
226ad6d to
727e909
Compare
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>
727e909 to
ace5505
Compare
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.