Log config only on rank zero at `torchtune/recipes/full_finetune_distributed.py`
Context
What is the purpose of this PR? Is it to
- fix a bug This PR ensures that log_config is only called on rank zero in distributed runs to avoid redundant logging across devices.
Address: #2700
Please link to any issues this PR addresses.
Changelog
What are the changes made in this PR? - Added a rank check to only log config on rank zero
Test plan
Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.
- [ ] run pre-commit hooks and linters (make sure you've first installed via
pre-commit install) - [ ] add unit tests for any new functionality
- [ ] update docstrings for any new or updated methods or classes
- [ ] run unit tests via
pytest tests - [ ] run recipe tests via
pytest tests -m integration_test - [ ] manually run any new or modified recipes with sufficient proof of correctness
- [ ] include relevant commands and any other artifacts in this summary (pastes of loss curves, eval results, etc.)
UX
If your function changed a public API, please add a dummy example of what the user experience will look like when calling it. Here is a docstring example and a tutorial example
- I did not change any public API
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2711
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:x: 1 New Failure
As of commit 6ace7c26302f0b4c8411ecf68602bc7ee63805da with merge base e5ee1b2fcd25a411a4d0889849c1528189d56616 ():
NEW FAILURE - The following job has failed:
- Lint / lint (3.10) (gh)
Process completed with exit code 1.
This comment was automatically generated by Dr. CI and updates every 15 minutes.
Hey @SalmanMohammadi @ebsmothers — just to confirm, should config.log_config() be moved to setup()?
Hey @SalmanMohammadi @ebsmothers — just to confirm, should
config.log_config()be moved to setup()?
Correct!