Skip to content
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

[logger] added flush to DiskLogger #1078

Merged
merged 1 commit into from
Jun 12, 2024
Merged

[logger] added flush to DiskLogger #1078

merged 1 commit into from
Jun 12, 2024

Conversation

felipemello1
Copy link
Contributor

@felipemello1 felipemello1 commented Jun 11, 2024

Context

issue: #1040

What is the purpose of this PR? Is it to

  • add a new feature
  • fix a bug
  • update tests and/or documentation
  • other (please add here)

If some part of the pipeline breaks, the logger may not have a chance to flush whats in the buffer. By adding flush after every .log, we can avoid it. A better solution would be to try to gracefully shutdown if something breaks, and then call .flush there, but this should be more complex.

It does increase latency by a few ms, but it shouldn't be a problem if we are only logging a few times per step:

without flush: 0.00066
with flush: 0.0051

Changelog

Just added .flush

Test plan

pytest

image
  • 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.)

@felipemello1 felipemello1 requested a review from ebsmothers June 11, 2024 16:53
Copy link

pytorch-bot bot commented Jun 11, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1078

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit d0473a7 with merge base dceaf05 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 11, 2024
@ebsmothers ebsmothers merged commit a1fa0fd into main Jun 12, 2024
29 checks passed
@joecummings joecummings deleted the add_flush_to_logging branch June 13, 2024 13:24
maximegmd pushed a commit to maximegmd/torchtune that referenced this pull request Jul 13, 2024
Co-authored-by: Felipe Mello <felipemello@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants