torchtune icon indicating copy to clipboard operation
torchtune copied to clipboard

Log config only on rank zero at `torchtune/recipes/full_finetune_distributed.py`

Open kabir2505 opened this issue 7 months ago • 3 comments

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

kabir2505 avatar May 09 '25 04:05 kabir2505

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2711

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 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar May 09 '25 04:05 pytorch-bot[bot]

Hey @SalmanMohammadi @ebsmothers — just to confirm, should config.log_config() be moved to setup()?

kabir2505 avatar May 12 '25 08:05 kabir2505

Hey @SalmanMohammadi @ebsmothers — just to confirm, should config.log_config() be moved to setup()?

Correct!

joecummings avatar May 13 '25 14:05 joecummings