schedulers,cli: persist newline breaks in log_iter#425
Closed
Conversation
Contributor
|
@d4l3k has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Codecov Report
@@ Coverage Diff @@
## main #425 +/- ##
=======================================
Coverage ? 94.52%
=======================================
Files ? 64
Lines ? 3782
Branches ? 0
=======================================
Hits ? 3575
Misses ? 207
Partials ? 0
Continue to review full report at Codecov.
|
d4l3k
added a commit
that referenced
this pull request
Mar 22, 2022
Summary: This resolves #424 This makes it so the torchx scheduler `log_iter` method keeps the line breaks so downstream log streams can handle them gracefully. The current solution strips all `\n` characters and always adds them so it makes it impossible to do streaming visualizations of progress bars which use `\r` without a new line break. WARNING: This is a change in the log_iter interface and all schedulers/downstream consumers will need to be updated. If someone is logging from multiple workers this gets dangerous since the progress bar `\r` lines can clobber each other. Pull Request resolved: #425 Test Plan: (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_docker --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:42 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:42 INFO Building workspace: file:///home/tristanr/Developer/torchx-proj for role[0]: python, image: ghcr.io/pytorch/torchx:0.1.2 dev0 torchx 2022-03-15 14:26:43 INFO Done building workspace torchx 2022-03-15 14:26:43 INFO New image: sha256:9cfaf70f7143b4caef383b46c23635eaf001cbd3d9ff55335aa1ff8c5e236388 built from workspace local_docker://torchx/torchx_utils_python-bprr9rb4k764nd torchx 2022-03-15 14:26:44 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:48 INFO Job finished: SUCCEEDED (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_cwd --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:52 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:52 INFO Log files located in: /tmp/torchx_0nqvqm1d/torchx/torchx_utils_python-x217jjqhbkkrgd/python/0 local_cwd://torchx/torchx_utils_python-x217jjqhbkkrgd torchx 2022-03-15 14:26:52 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:56 INFO Job finished: SUCCEEDED Differential Revision: D34907682 Pulled By: d4l3k fbshipit-source-id: 2c2619b05366074870434444acf1e0b02787fb77
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D34907682 |
d4l3k
added a commit
that referenced
this pull request
Mar 23, 2022
Summary: This resolves #424 This makes it so the torchx scheduler `log_iter` method keeps the line breaks so downstream log streams can handle them gracefully. The current solution strips all `\n` characters and always adds them so it makes it impossible to do streaming visualizations of progress bars which use `\r` without a new line break. WARNING: This is a change in the log_iter interface and all schedulers/downstream consumers will need to be updated. If someone is logging from multiple workers this gets dangerous since the progress bar `\r` lines can clobber each other. Pull Request resolved: #425 Test Plan: (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_docker --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:42 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:42 INFO Building workspace: file:///home/tristanr/Developer/torchx-proj for role[0]: python, image: ghcr.io/pytorch/torchx:0.1.2 dev0 torchx 2022-03-15 14:26:43 INFO Done building workspace torchx 2022-03-15 14:26:43 INFO New image: sha256:9cfaf70f7143b4caef383b46c23635eaf001cbd3d9ff55335aa1ff8c5e236388 built from workspace local_docker://torchx/torchx_utils_python-bprr9rb4k764nd torchx 2022-03-15 14:26:44 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:48 INFO Job finished: SUCCEEDED (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_cwd --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:52 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:52 INFO Log files located in: /tmp/torchx_0nqvqm1d/torchx/torchx_utils_python-x217jjqhbkkrgd/python/0 local_cwd://torchx/torchx_utils_python-x217jjqhbkkrgd torchx 2022-03-15 14:26:52 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:56 INFO Job finished: SUCCEEDED Reviewed By: kiukchung Differential Revision: D34907682 Pulled By: d4l3k fbshipit-source-id: 1750a301ca7c8319df4fbeca35fa8eb29b8ecaae
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D34907682 |
Summary: This resolves #424 This makes it so the torchx scheduler `log_iter` method keeps the line breaks so downstream log streams can handle them gracefully. The current solution strips all `\n` characters and always adds them so it makes it impossible to do streaming visualizations of progress bars which use `\r` without a new line break. WARNING: This is a change in the log_iter interface and all schedulers/downstream consumers will need to be updated. If someone is logging from multiple workers this gets dangerous since the progress bar `\r` lines can clobber each other. Pull Request resolved: #425 Test Plan: (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_docker --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:42 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:42 INFO Building workspace: file:///home/tristanr/Developer/torchx-proj for role[0]: python, image: ghcr.io/pytorch/torchx:0.1.2 dev0 torchx 2022-03-15 14:26:43 INFO Done building workspace torchx 2022-03-15 14:26:43 INFO New image: sha256:9cfaf70f7143b4caef383b46c23635eaf001cbd3d9ff55335aa1ff8c5e236388 built from workspace local_docker://torchx/torchx_utils_python-bprr9rb4k764nd torchx 2022-03-15 14:26:44 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:48 INFO Job finished: SUCCEEDED (torchx-3.10.2) tristanr@tristanr-arch2 ~/D/torchx-proj> torchx run --scheduler local_cwd --wait --log utils.python --script test_tqdm.py torchx 2022-03-15 14:26:52 INFO loaded configs from /home/tristanr/Developer/torchx-proj/.torchxconfig torchx 2022-03-15 14:26:52 INFO Log files located in: /tmp/torchx_0nqvqm1d/torchx/torchx_utils_python-x217jjqhbkkrgd/python/0 local_cwd://torchx/torchx_utils_python-x217jjqhbkkrgd torchx 2022-03-15 14:26:52 INFO Waiting for the app to finish... python/0 100%|██████████| 100/100 [00:03<00:00, 32.95it/s] torchx 2022-03-15 14:26:56 INFO Job finished: SUCCEEDED Reviewed By: kiukchung Differential Revision: D34907682 Pulled By: d4l3k fbshipit-source-id: c87f7931be3d90cf006080d3cb1e54b17016e930
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D34907682 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves #424
This makes it so the torchx scheduler
log_itermethod keeps the line breaks so downstream log streams can handle them gracefully. The current solution strips all\ncharacters and always adds them so it makes it impossible to do streaming visualizations of progress bars which use\rwithout a new line break.WARNING: This is a change in the log_iter interface and all schedulers/downstream consumers will need to be updated.
If someone is logging from multiple workers this gets dangerous since the progress bar
\rlines can clobber each other.Test plan: