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

Add --test option to specify test to run #368

Merged
merged 3 commits into from
May 30, 2024
Merged

Add --test option to specify test to run #368

merged 3 commits into from
May 30, 2024

Conversation

kwen2501
Copy link
Contributor

Usage:
--test <test_id>

Acceptable values: test_id in build_test_list (default: all)

Example:

rm -rf outputs && python test_runner.py outputs --test pp_gpipe

@kwen2501 kwen2501 requested a review from wconstab May 29, 2024 01:24
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 29, 2024
@kwen2501 kwen2501 requested a review from wanchaol May 29, 2024 01:25
Copy link
Contributor

@wanchaol wanchaol left a comment

Choose a reason for hiding this comment

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

sgtm, have 3 comments inlined

test_runner.py Outdated
@@ -29,11 +29,12 @@ class OverrideDefinitions:

override_args: Sequence[Sequence[str]] = tuple(tuple(" "))
test_descr: str = "default"
test_id: str = "default"
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like a test_name rather than test_id? could we rename to test_name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed 👍

@@ -244,7 +240,7 @@ def run_test(test_flavor: OverrideDefinitions, full_path: str):


def run_tests(args):
integration_tests_flavors = build_test_list(args)
integration_tests_flavors = build_test_list()
Copy link
Contributor

Choose a reason for hiding this comment

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

why we remove the args here, is it not getting used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's right.

@@ -255,13 +251,19 @@ def run_tests(args):
)
if is_integration_test:
for test_flavor in integration_tests_flavors[config_file]:
run_test(test_flavor, full_path)
if args.test == "all" or test_flavor.test_id == args.test:
run_test(test_flavor, full_path, args.output_dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should still assert the output_dir specified, otherwise we should error out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

output_dir is a required argument to the python program:

parser.add_argument("output_dir")

If not provided, the program entry would fail:

usage: test_runner.py [-h] [--config_dir CONFIG_DIR] [--test TEST] output_dir
test_runner.py: error: the following arguments are required: output_dir

@kwen2501 kwen2501 merged commit 3343d1d into main May 30, 2024
4 checks passed
tianyu-l pushed a commit to tianyu-l/torchtitan_intern24 that referenced this pull request Aug 16, 2024
Usage:
`--test <test_id>`

Acceptable values: `test_id` in `build_test_list` (default: all)

Example:
```
rm -rf outputs && python test_runner.py outputs --test pp_gpipe
```
philippguevorguian pushed a commit to YerevaNN/YNNtitan that referenced this pull request Aug 17, 2024
Usage:
`--test <test_id>`

Acceptable values: `test_id` in `build_test_list` (default: all)

Example:
```
rm -rf outputs && python test_runner.py outputs --test pp_gpipe
```
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.

3 participants