Skip to content

torchx/runner: log events to torch.monitor #379

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

Closed
wants to merge 1 commit into from

Conversation

d4l3k
Copy link
Member

@d4l3k d4l3k commented Feb 1, 2022

Summary:
This logs the torchx.runner.events.Events to torch.monitor as well as the existing event handlers. Once monitor is stable the existing ones will be removed entirely in favor of the new interface.

torch.monitor is only available with pytorch 1.11 (or main) so it's a no-op if it's not available.

Differential Revision: D33928333

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Feb 1, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D33928333

@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #379 (0f156ae) into main (787bb8f) will decrease coverage by 0.10%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
- Coverage   94.83%   94.73%   -0.11%     
==========================================
  Files          63       63              
  Lines        3347     3359      +12     
==========================================
+ Hits         3174     3182       +8     
- Misses        173      177       +4     
Impacted Files Coverage Δ
torchx/runner/events/api.py 64.10% <57.14%> (-2.57%) ⬇️
torchx/runner/events/__init__.py 97.22% <83.33%> (-2.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787bb8f...0f156ae. Read the comment docs.

Summary:
This logs the `torchx.runner.events.Events` to `torch.monitor` as well as the existing event handlers. Once monitor is stable the existing ones will be removed entirely in favor of the new interface.

`torch.monitor` is only available with pytorch 1.11 (or main) so it's a no-op if it's not available.

Differential Revision: D33928333

fbshipit-source-id: 632a7e096f46e5c1946932d4a765be179e1e53a8
Copy link

@edward-io edward-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will leave it to torchx people to do the final review.

@@ -59,6 +59,15 @@ def _get_or_create_logger(destination: str = "null") -> logging.Logger:
def record(event: TorchxEvent, destination: str = "null") -> None:
_get_or_create_logger(destination).info(event.serialize())

if destination != "console":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to have a console event handler, so we don't need this check?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure we use console anywhere, this is mostly just to be safe. Easy enough to remove it if people need it.

@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

d4l3k added a commit that referenced this pull request Jun 24, 2022
d4l3k added a commit that referenced this pull request Jun 24, 2022
d4l3k added a commit that referenced this pull request Jun 24, 2022
d4l3k added a commit that referenced this pull request Jun 24, 2022
Summary:
This reverts commit 4b989d5.

Importing torch.monitor adds a pretty large dependency on torch which hugely slows down load time in OSS.

This accounts for about 340ms of load time.

Pull Request resolved: #536

Test Plan: This isn't being used anywhere AFAIK so should be safe to land. Internal has a custom handler.

Reviewed By: priyaramani, kurman

Differential Revision: D37432126

Pulled By: d4l3k

fbshipit-source-id: f38a89a7a4dbbd69e9ba43c130bd31b084c0bb00
d4l3k added a commit that referenced this pull request Jun 25, 2022
Summary:
This reverts commit 4b989d5.

Importing torch.monitor adds a pretty large dependency on torch which hugely slows down load time in OSS.

This accounts for about 340ms of load time.

Pull Request resolved: #536

Test Plan: This isn't being used anywhere AFAIK so should be safe to land. Internal has a custom handler.

Reviewed By: priyaramani, kurman

Differential Revision: D37432126

Pulled By: d4l3k

fbshipit-source-id: 410e25744ad26706e35eee8e10f90ef8f94514ee
facebook-github-bot pushed a commit that referenced this pull request Jun 27, 2022
Summary:
This reverts commit 4b989d5.

Importing torch.monitor adds a pretty large dependency on torch which hugely slows down load time in OSS.

This accounts for about 340ms of load time.

Pull Request resolved: #536

Test Plan: This isn't being used anywhere AFAIK so should be safe to land. Internal has a custom handler.

Reviewed By: priyaramani, kurman

Differential Revision: D37432126

Pulled By: d4l3k

fbshipit-source-id: 6ad6c3b93ed2622f8d931b5c906841858646c2f0
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. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants