Skip to content

Fix multi-line string usage - #244

Merged
gnadathur merged 5 commits into
mainfrom
cmd_fix
Apr 16, 2024
Merged

gnadathur merged 5 commits into
mainfrom
cmd_fix

Conversation

@gnadathur

Copy link
Copy Markdown
Contributor

Summary: use """ for multi-line strings instead of tuple syntax which breaks arg parse.

Test Plan: ```
============================= test session starts ============================== platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 -- /home/gnadathur/local/a/pytorch-env/bin/python cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/data/users/gnadathur/a/torchtitan/.hypothesis/examples')) benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) rootdir: /data/users/gnadathur/a/torchtitan
configfile: pyproject.toml
plugins: hypothesis-6.100.1, benchmark-4.0.0, typeguard-4.2.1, cov-5.0.0, hydra-core-1.3.2 collecting ... collected 6 items

test/test_job_config.py::TestJobConfig::test_command_line_args PASSED [ 16%]
test/test_job_config.py::TestJobConfig::test_job_config_file PASSED [ 33%]
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist PASSED [ 50%]
test/test_job_config.py::TestJobConfig::test_empty_config_file PASSED [ 66%]
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides PASSED [ 83%]
test/test_job_config.py::TestJobConfig::test_print_help PASSED [100%]

---------- coverage: platform linux, python 3.10.14-final-0 ---------- Coverage XML written to file coverage.xml

============================= slowest 20 durations =============================
0.00s call test/test_job_config.py::TestJobConfig::test_print_help
0.00s call test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s call test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s call test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s call test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s call test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s setup test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s setup test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s setup test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s teardown test/test_job_config.py::TestJobConfig::test_print_help
0.00s setup test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s setup test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s setup test/test_job_config.py::TestJobConfig::test_print_help
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s teardown test/test_job_config.py::TestJobConfig::test_empty_config_file
============================== 6 passed in 0.19s ===============================

Summary: use `"""` for multi-line strings instead of tuple syntax which breaks arg parse.

Test Plan: ```
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0 -- /home/gnadathur/local/a/pytorch-env/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/data/users/gnadathur/a/torchtitan/.hypothesis/examples'))
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /data/users/gnadathur/a/torchtitan
configfile: pyproject.toml
plugins: hypothesis-6.100.1, benchmark-4.0.0, typeguard-4.2.1, cov-5.0.0, hydra-core-1.3.2
collecting ... collected 6 items

test/test_job_config.py::TestJobConfig::test_command_line_args PASSED    [ 16%]
test/test_job_config.py::TestJobConfig::test_job_config_file PASSED      [ 33%]
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist PASSED [ 50%]
test/test_job_config.py::TestJobConfig::test_empty_config_file PASSED    [ 66%]
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides PASSED [ 83%]
test/test_job_config.py::TestJobConfig::test_print_help PASSED           [100%]

---------- coverage: platform linux, python 3.10.14-final-0 ----------
Coverage XML written to file coverage.xml


============================= slowest 20 durations =============================
0.00s call     test/test_job_config.py::TestJobConfig::test_print_help
0.00s call     test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s call     test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s call     test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s call     test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s call     test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s setup    test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s setup    test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s setup    test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s teardown test/test_job_config.py::TestJobConfig::test_print_help
0.00s setup    test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s setup    test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s setup    test/test_job_config.py::TestJobConfig::test_print_help
0.00s teardown test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s teardown test/test_job_config.py::TestJobConfig::test_empty_config_file
============================== 6 passed in 0.19s ===============================
```
@gnadathur
gnadathur requested a review from tianyu-l April 16, 2024 17:59
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 16, 2024
Comment thread torchtitan/config_manager.py Resolved

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fast fix! Had some nit comments inline.

Comment thread torchtitan/config_manager.py Resolved
Comment thread torchtitan/config_manager.py Resolved
@gnadathur
gnadathur merged commit 241ae6f into main Apr 16, 2024
@gnadathur
gnadathur deleted the cmd_fix branch April 16, 2024 18:31
lessw2020 pushed a commit that referenced this pull request Apr 18, 2024
Summary: use `"""` for multi-line strings instead of tuple syntax which
breaks arg parse.

Test Plan: ```
============================= test session starts
============================== platform linux -- Python 3.10.14,
pytest-8.1.1, pluggy-1.4.0 --
/home/gnadathur/local/a/pytorch-env/bin/python cachedir: .pytest_cache
hypothesis profile 'default' ->
database=DirectoryBasedExampleDatabase(PosixPath('/data/users/gnadathur/a/torchtitan/.hypothesis/examples'))
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False
min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10
warmup=False warmup_iterations=100000) rootdir:
/data/users/gnadathur/a/torchtitan
configfile: pyproject.toml
plugins: hypothesis-6.100.1, benchmark-4.0.0, typeguard-4.2.1,
cov-5.0.0, hydra-core-1.3.2 collecting ... collected 6 items

test/test_job_config.py::TestJobConfig::test_command_line_args PASSED [
16%]
test/test_job_config.py::TestJobConfig::test_job_config_file PASSED [
33%]
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
PASSED [ 50%]
test/test_job_config.py::TestJobConfig::test_empty_config_file PASSED [
66%]

test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
PASSED [ 83%]
test/test_job_config.py::TestJobConfig::test_print_help PASSED [100%]

---------- coverage: platform linux, python 3.10.14-final-0 ----------
Coverage XML written to file coverage.xml


============================= slowest 20 durations
=============================
0.00s call     test/test_job_config.py::TestJobConfig::test_print_help
0.00s call
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s call test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s call
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s call
test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s call
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s setup
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s setup
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s setup test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s teardown test/test_job_config.py::TestJobConfig::test_print_help
0.00s setup
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s setup
test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s setup    test/test_job_config.py::TestJobConfig::test_print_help
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s teardown
test/test_job_config.py::TestJobConfig::test_empty_config_file
============================== 6 passed in 0.19s
===============================
```
philippguevorguian pushed a commit to YerevaNN/YNNtitan that referenced this pull request Aug 17, 2024
Summary: use `"""` for multi-line strings instead of tuple syntax which
breaks arg parse.

Test Plan: ```
============================= test session starts
============================== platform linux -- Python 3.10.14,
pytest-8.1.1, pluggy-1.4.0 --
/home/gnadathur/local/a/pytorch-env/bin/python cachedir: .pytest_cache
hypothesis profile 'default' ->
database=DirectoryBasedExampleDatabase(PosixPath('/data/users/gnadathur/a/torchtitan/.hypothesis/examples'))
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False
min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10
warmup=False warmup_iterations=100000) rootdir:
/data/users/gnadathur/a/torchtitan
configfile: pyproject.toml
plugins: hypothesis-6.100.1, benchmark-4.0.0, typeguard-4.2.1,
cov-5.0.0, hydra-core-1.3.2 collecting ... collected 6 items

test/test_job_config.py::TestJobConfig::test_command_line_args PASSED [
16%]
test/test_job_config.py::TestJobConfig::test_job_config_file PASSED [
33%]
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
PASSED [ 50%]
test/test_job_config.py::TestJobConfig::test_empty_config_file PASSED [
66%]

test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
PASSED [ 83%]
test/test_job_config.py::TestJobConfig::test_print_help PASSED [100%]

---------- coverage: platform linux, python 3.10.14-final-0 ----------
Coverage XML written to file coverage.xml


============================= slowest 20 durations
=============================
0.00s call     test/test_job_config.py::TestJobConfig::test_print_help
0.00s call
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s call test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s call
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s call
test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s call
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s setup
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown
test/test_job_config.py::TestJobConfig::test_command_line_args
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s setup
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s setup test/test_job_config.py::TestJobConfig::test_job_config_file
0.00s teardown test/test_job_config.py::TestJobConfig::test_print_help
0.00s setup
test/test_job_config.py::TestJobConfig::test_job_file_does_not_exist
0.00s setup
test/test_job_config.py::TestJobConfig::test_empty_config_file
0.00s setup    test/test_job_config.py::TestJobConfig::test_print_help
0.00s teardown
test/test_job_config.py::TestJobConfig::test_job_config_file_cmd_overrides
0.00s teardown
test/test_job_config.py::TestJobConfig::test_empty_config_file
============================== 6 passed in 0.19s
===============================
```
saforem2 added a commit to saforem2/torchtitan that referenced this pull request Sep 16, 2026
Six instances in two days of one error shape -- a check that returns the
same answer whether or not the thing works: imports passing while 0/14
flavors build, a #181519 probe matching the raise the patch removes, a
chain-depth monitor reading healthy through 79h of zero progress, an
[ -x ] interpreter check from a login node, one of three soname call
sites patched, and Exit_status=0 on jobs that died before running Python.

Records what shipped (soname glob, bmm_nodrop dtype, the 80B guard
placement, ezpz pytorch#244/pytorch#245), what was withdrawn (aurora_sycl three times,
the #181519 PRESENT verdict, the MKLROOT-off-default claim), and the
rule that covers the whole probe-failure class: 114/122 PBS scripts here
use --login, so start from an existing submit script.
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 Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants