-
Notifications
You must be signed in to change notification settings - Fork 39
Distributed unit tests, newer transformers and trainer fixes #387
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -379,6 +379,9 @@ def test_save_and_load_in_parallel(run_distributed_script, run_test_script_base_ | |
| # TODO: Test beyond 2 gpu configs? | ||
| import tests.models.distributed_test_checkpoint | ||
|
|
||
| if torch.cuda.device_count() < 2: | ||
| pytest.skip(f"Not enough GPUs: {torch.cuda.device_count()} < 2") | ||
|
|
||
| script = [ | ||
| "-m", | ||
| tests.models.distributed_test_checkpoint.__name__, | ||
|
|
@@ -405,6 +408,7 @@ def reference_distributed_shard(get_convert_path) -> torch.Tensor | None: | |
|
|
||
|
|
||
| @requires_cuda | ||
| # NOTE: Should it depend on test_model_distributed instead? | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we can't have dependencies between
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it needs to depend on |
||
| @pytest.mark.depends_on(on=["test_load_pretrained[{model_testing_config}]"]) | ||
| @pytest.mark.model_testing_group(ModelTestingGroup.convert, ModelTestingGroup.distributed) | ||
| def test_load_parallel_checkpoint_in_single_gpu( | ||
|
|
@@ -425,6 +429,10 @@ def test_load_parallel_checkpoint_in_single_gpu( | |
| distributed_save_load_config = distributed_save_load_config.resolve( | ||
| base_path=run_test_script_base_path, model_testing_config=model_testing_config | ||
| ) | ||
| if torch.cuda.device_count() < distributed_save_load_config.num_gpus: | ||
| pytest.skip( | ||
| f"Not enough GPUs to run dependency: {torch.cuda.device_count()} < {distributed_save_load_config.num_gpus}" | ||
| ) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't that already handled elsewhere? |
||
| report_subtest(distributed_save_load_config.save_path, distributed_save_load_config.num_gpus) | ||
| load_and_compare_checkpoints( | ||
| DistributedCheckpointFormat, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -637,7 +637,8 @@ def _update_and_add_testing_config( | |
| groups={ | ||
| ModelTestingGroup.basic: ModelTestingGroupAction.normal, | ||
| ModelTestingGroup.checkpoint: ModelTestingGroupAction.normal, | ||
| ModelTestingGroup.convert: ModelTestingGroupAction.normal, | ||
| # TODO: Fix and bring back to `testing_groups` | ||
| ModelTestingGroup.convert: ModelTestingGroupAction.broken, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this because of some weird triton or cuda errors? that's a version conflict... |
||
| ModelTestingGroup.generate: ModelTestingGroupAction.not_implemented, | ||
| ModelTestingGroup.megatron: ModelTestingGroupAction.not_implemented, | ||
| ModelTestingGroup.distributed: ModelTestingGroupAction.normal, | ||
|
|
@@ -650,7 +651,7 @@ def _update_and_add_testing_config( | |
| ), # "pp","dp", "ce","16", "bf", "df", "stp"), | ||
| ) | ||
|
|
||
|
|
||
| # TODO: remove obsolete model | ||
| _update_and_add_testing_config( | ||
| # Tests hybrid discrete Mamba 2. | ||
| "llama", | ||
|
|
@@ -682,7 +683,7 @@ def _update_and_add_testing_config( | |
| groups={ | ||
| ModelTestingGroup.basic: ModelTestingGroupAction.normal, | ||
| ModelTestingGroup.checkpoint: ModelTestingGroupAction.normal, | ||
| ModelTestingGroup.convert: ModelTestingGroupAction.normal, | ||
| ModelTestingGroup.convert: ModelTestingGroupAction.broken, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this because of some weird triton or cuda errors? that's a version conflict...
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one was broken already, let's just drop the whole config since we don't need it. |
||
| ModelTestingGroup.generate: ModelTestingGroupAction.not_implemented, | ||
| ModelTestingGroup.megatron: ModelTestingGroupAction.not_implemented, | ||
| # TODO: Implement | ||
|
|
||
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.
isn't that already handled elsewhere?
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.
Not this part, there is an equivalent in
test_model_distributedbut we need it here too