-
Notifications
You must be signed in to change notification settings - Fork 132
fix data processing + resume training #390
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?
Conversation
Summary of ChangesHello @Dogacel, 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 significantly enhances the robustness and reliability of the training pipeline by addressing several critical issues. It introduces comprehensive checkpoint loading capabilities, ensuring seamless resumption of training from any saved state. Furthermore, it resolves a potential memory leak during metric logging to Weights & Biases and improves data quality by filtering out problematic conversational data points. These changes collectively aim to provide a more stable and efficient training experience. 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 significant changes to the training pipeline, primarily focusing on enabling robust training resumption from checkpoints in scripts/train_eagle3.py. A new load_checkpoint function was added to retrieve the starting epoch, global step, and optimizer state, which are then used to initialize the training loop and load the optimizer's state. The build_draft_model function was refactored to accept the last checkpoint path, and the main training loop was updated to correctly resume iteration within an epoch by calculating target_batch_idx. Additionally, changes were made to scripts/prepare_data.py to skip entire conversations that start with an 'assistant' message, and specforge/tracker.py was updated to log draft model configuration and save the config file to WandB. The checkpoint naming convention in specforge/utils.py was also updated to include step information. Review comments pointed out a potential IndexError in scripts/prepare_data.py when accessing conversation data without checking for an empty list, noted a regression in scripts/train_eagle3.py where the --ckpt-dir functionality for fine-tuning from a base model was removed, and raised a security concern regarding weights_only=False when loading checkpoints, though acknowledging its necessity for optimizer state.
I am having trouble creating individual review comments. Click here to see my feedback.
scripts/prepare_data.py (196)
Accessing row["conversations"][0] without checking if row["conversations"] is empty can lead to an IndexError, which would crash the data preparation script. It's safer to check for an empty list first.
if row["conversations"] and row["conversations"][0]["role"] == "assistant":
scripts/prepare_data.py (210)
Accessing row["conversations"][0] without checking if row["conversations"] is empty can lead to an IndexError, which would crash the data preparation script. It's safer to check for an empty list first. This is the same issue as in the loop for the training set.
if row["conversations"] and row["conversations"][0]["role"] == "assistant":
scripts/train_eagle3.py (346-363)
The logic to handle --ckpt-dir for starting fine-tuning from a specific base model checkpoint has been removed. This appears to be a regression, as the command-line argument still exists but is no longer used. Was this removal intentional? If not, this functionality should be restored. The previous logic could conflict with --resume, so you might want to rethink how they interact (e.g., make them mutually exclusive or have a clear precedence).
scripts/train_eagle3.py (337)
Loading checkpoints with weights_only=False can be a security vulnerability, as it may lead to arbitrary code execution if the checkpoint file is compromised. Since you are loading optimizer state which requires this setting, it's acceptable, but it's crucial to ensure that you only load checkpoints from a trusted source.
|
Hi @Dogacel , can you apply code formatting via pre-commit? |
Got it! The link in PR description is dead, but I assume it is this one -> https://pre-commit.com/#install I've run |
|
Gentle ping @FrankLeeeee |
Motivation
Modifications
Related Issues
Accuracy Test
Benchmark & Profiling
Checklist