-
Notifications
You must be signed in to change notification settings - Fork 51
Fix resharding bug when dataset variable is reassigned #49
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
data.py reused 'dataset' for both the dataset path string and the loaded IterableDataset. When resharding, load_dataset(path=dataset) received the dataset object instead of the path. Store the original path separately and use it for resharding.
Summary of ChangesHello @m-laprise, 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 resolves a critical bug in the data loading and resharding logic by ensuring that the original dataset path is consistently used when reloading or re-sharding datasets. The change prevents errors that occurred due to a variable being overwritten with a dataset object, thereby improving the robustness of the data pipeline. 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
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughA minimal refactor in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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 correctly fixes a bug in flame/data.py where the dataset variable was being reused, causing an error during resharding. The fix preserves the original dataset path in a new dataset_path variable. The change is correct and addresses the issue. I've added one minor suggestion related to code maintainability to consider.
| color = utils.Color | ||
| min_num_shards = dp_degree * num_workers if dp_degree else None | ||
| if len(dataset.split(',')) == 1: | ||
| dataset_path = dataset |
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.
Problem:
flame/data.pyreusesdatasetfor both the dataset path string and the loadedIterableDataset. Afterload_dataset(),datasetis no longer a string, so when resharding,load_dataset(path=dataset)receives the dataset object instead of the path, causing it to error out.Fix: Preserve the original dataset path string in
dataset_pathand passdataset_pathto resharding.Edited to add: This happens when
num_shardsis smaller thandp_degree * num_workers, e.g. for datasets likewikitext-103-v1that expose a small number of shards.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.