-
Notifications
You must be signed in to change notification settings - Fork 129
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
Conversation
This pull request was exported from Phabricator. Differential Revision: D33928333 |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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
5cfd066
to
0f156ae
Compare
There was a problem hiding this 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": |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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
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
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
Summary:
This logs the
torchx.runner.events.Events
totorch.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