refactor: rename thread_count to files_per_rank#67
refactor: rename thread_count to files_per_rank#67ronaldw07 wants to merge 15 commits intogoogle:mainfrom
Conversation
Summary of ChangesHello, 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 refactors the checkpointing mechanism by renaming the 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. Changelog
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.
Code Review
This pull request is a great refactoring that renames thread_count to files_per_rank. The new name is much more descriptive and transparent about what the parameter controls, avoiding confusion with other thread-related concepts in the codebase. The changes are applied consistently across documentation, source code, and tests. I've found one minor issue in a test docstring, which I've commented on.
Renames all occurrences of thread_count (and write_thread_count at the user-facing API level) to files_per_rank / write_files_per_rank for transparency. The parameter controls how many files each rank writes to, not a concurrency thread count, which is a separate concept in the codebase. Closes google#66 # Conflicts: # src/ml_flashpoint/adapter/megatron/save_strategies.py # src/ml_flashpoint/adapter/nemo/wrapper_util.py # src/ml_flashpoint/adapter/pytorch/memory_storage_writer.py # tests/adapter/megatron/test_save_strategies.py
128e11a to
f291c11
Compare
- Update outdated docstring in test_validation_invalid_write_files_per_rank - Fix E501 line-too-long errors introduced by the thread_count -> files_per_rank rename
|
Fixed the outdated docstring flagged in the review — updated it to refer to |
…ename-thread-count-to-files-per-rank
|
Resolved the merge conflict in |
…ename-thread-count-to-files-per-rank
8eeb937 to
bce6888
Compare
Python Code Coverage Summary
Minimum allowed line rate is |
C++ Code Coverage Summary
Minimum allowed line rate is |
…-rank' into rename-thread-count-to-files-per-rank
|
please make sure to always run the linter locally and the tests you are writing/modifying. right now looks like ruff check is failing |
- Fix missed write_thread_count reference in wrapper_util.py - Rename thread_count property to files_per_rank in save_strategies.py - Update _thread_count to _files_per_rank in test_wrapper_util.py - Update thread_count to files_per_rank in test_checkpoint_io.py - Merge upstream/main to resolve conflict in wrapper_util.py
What
Renames all
thread_countparameters (andwrite_thread_countat the user-facing API level) tofiles_per_rank/write_files_per_rankfor transparency.Why
The parameter controls how many files each rank writes to during checkpointing — not a concurrency thread count. There is a separate, unrelated thread count concept in the codebase (
torch_thread_count), which made the old name confusing. The new name makes the intent immediately clear.Changes
thread_count→files_per_rankinMemoryStorageWriter,DefaultMLFlashpointCheckpointSaver.write_data(), andMLFlashpointCheckpointSaver.write_data()(abstract)write_thread_count→write_files_per_rankinwrapper_util.pyuser-facing APIself._thread_count→self._files_per_rankinstance variable inMemoryStorageWriterCloses #66