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

[PoC] Typed JobConfig #767

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tiktoken
blobfile
tabulate
wandb
tyro
16 changes: 7 additions & 9 deletions tests/unit_tests/test_job_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ def test_job_config_file_cmd_overrides(self):
def test_parse_pp_split_points(self):

toml_splits = ["layers.2", "layers.4", "layers.6"]
toml_split_str = ",".join(toml_splits)
cmdline_splits = ["layers.1", "layers.3", "layers.5"]
cmdline_split_str = ",".join(cmdline_splits)
# no split points specified
config = JobConfig()
config.parse_args(
[
Expand All @@ -68,7 +65,7 @@ def test_parse_pp_split_points(self):
"--job.config_file",
"./train_configs/debug_model.toml",
"--experimental.pipeline_parallel_split_points",
f"{cmdline_split_str}",
*cmdline_splits,
]
)
assert (
Expand All @@ -81,7 +78,7 @@ def test_parse_pp_split_points(self):
tomli_w.dump(
{
"experimental": {
"pipeline_parallel_split_points": toml_split_str,
"pipeline_parallel_split_points": toml_splits,
}
},
f,
Expand All @@ -98,7 +95,7 @@ def test_parse_pp_split_points(self):
tomli_w.dump(
{
"experimental": {
"pipeline_parallel_split_points": toml_split_str,
"pipeline_parallel_split_points": toml_splits,
}
},
f,
Expand All @@ -109,14 +106,15 @@ def test_parse_pp_split_points(self):
"--job.config_file",
fp.name,
"--experimental.pipeline_parallel_split_points",
f"{cmdline_split_str}",
*cmdline_splits,
]
)
assert (
config.experimental.pipeline_parallel_split_points == cmdline_splits
), config.experimental.pipeline_parallel_split_points

def test_print_help(self):
config = JobConfig()
parser = config.parser
from tyro.extras import get_parser

parser = get_parser(JobConfig)
parser.print_help()
Loading