-
Notifications
You must be signed in to change notification settings - Fork 35
Add DDLB workload #711
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
Open
nsarka
wants to merge
16
commits into
NVIDIA:main
Choose a base branch
from
nsarka:nsarka/ddlb-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add DDLB workload #711
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8ac4b6c
Add DDLB workload
nsarka ef4256c
Update copyright, remove comments
nsarka 2bf56e4
Greptile feedback
nsarka eda5d0e
Add mpirun
nsarka 920a023
Revert "Add mpirun"
nsarka 8a16a45
Use new CLI args
nsarka 940d57b
Merge branch 'NVIDIA:main' into nsarka/ddlb-integration
nsarka e5f2e61
Move to experimental, sbatch acceptance test
nsarka aa01c79
Update src/cloudai/workloads/ddlb/slurm_command_gen_strategy.py
nsarka e307fda
Add docs
7bbf993
Update src/cloudai/workloads/ddlb/ddlb.py
nsarka 04b385d
Readd import
nsarka 2df0d98
Linter
nsarka 20ffb5f
Linter
nsarka 2068f5f
Update conf/experimental/test/ddlb_test.toml
nsarka 1f1e6cd
Move test_scenario/ddlb_test.toml to experimental
nsarka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name = "ddlb_test" | ||
| description = "DDLB test configuration" | ||
| test_template_name = "DDLBTest" | ||
|
|
||
| [cmd_args] | ||
| docker_image_url = "gitlab-master.nvidia.com/nsarkauskas/ddlb:latest" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name = "ddlb-test" | ||
|
|
||
| [[Tests]] | ||
| id = "Tests.ddlb" | ||
| test_name = "ddlb_test" | ||
| num_nodes = 1 | ||
| time_limit = "00:30:00" |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from .ddlb import DDLBCmdArgs, DDLBTestDefinition | ||
| from .slurm_command_gen_strategy import DDLBTestSlurmCommandGenStrategy | ||
|
|
||
| __all__ = [ | ||
| "DDLBCmdArgs", | ||
| "DDLBTestDefinition", | ||
| "DDLBTestSlurmCommandGenStrategy", | ||
| ] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from typing import Literal, Optional, Union | ||
nsarka marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| from cloudai.core import DockerImage, Installable, JobStatusResult, TestRun | ||
| from cloudai.models.workload import CmdArgs, TestDefinition | ||
|
|
||
|
|
||
| class DDLBCmdArgs(CmdArgs): | ||
| """DDLB test command arguments.""" | ||
|
|
||
| docker_image_url: str | ||
|
|
||
nsarka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| class DDLBTestDefinition(TestDefinition): | ||
| """Test object for DDLB.""" | ||
|
|
||
| cmd_args: DDLBCmdArgs | ||
| _docker_image: Optional[DockerImage] = None | ||
|
|
||
| @property | ||
| def extra_args_str(self) -> str: | ||
| parts = [] | ||
| for k, v in self.extra_cmd_args.items(): | ||
| parts.append(f"{k} {v}" if v else k) | ||
| return " ".join(parts) | ||
|
|
||
| @property | ||
| def docker_image(self) -> DockerImage: | ||
| if not self._docker_image: | ||
| self._docker_image = DockerImage(url=self.cmd_args.docker_image_url) | ||
| return self._docker_image | ||
|
|
||
| @property | ||
| def installables(self) -> list[Installable]: | ||
| return [self.docker_image] | ||
|
|
||
| def was_run_successful(self, tr: TestRun) -> JobStatusResult: | ||
| stdout_path = tr.output_path / "stdout.txt" | ||
| if stdout_path.is_file(): | ||
| with stdout_path.open("r") as file: | ||
| content = file.read() | ||
|
|
||
| # Check for specific error patterns | ||
| if "Error" in content: | ||
nsarka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return JobStatusResult( | ||
| is_successful=False, | ||
| error_message=( | ||
| f"DDLB test failure detected in {stdout_path}. " | ||
| "Possible reasons include network errors or remote process exits. " | ||
| "Please review the DDLB test output and errors in the file first. " | ||
| "If the issue persists, contact the system administrator." | ||
| ), | ||
| ) | ||
|
|
||
| # Identify missing success indicators | ||
| if "Benchmark Results" not in content: | ||
| error_message = ( | ||
| f"Missing success indicators in {stdout_path}: 'Benchmark Results'. " | ||
| "These keywords are expected to be present in stdout.txt, usually towards the end of the file. " | ||
| "Please review the DDLB test output and errors in the file. " | ||
| "Ensure the DDLB test ran to completion. You can run the generated sbatch script manually " | ||
| f"and check if {stdout_path} is created and contains the expected keywords. " | ||
| "If the issue persists, contact the system administrator." | ||
| ) | ||
|
|
||
| return JobStatusResult(is_successful=False, error_message=error_message) | ||
|
|
||
| return JobStatusResult(is_successful=True) | ||
|
|
||
| return JobStatusResult( | ||
| is_successful=False, | ||
| error_message=( | ||
| f"stdout.txt file not found in the specified output directory {tr.output_path}. " | ||
| "This file is expected to be created as a result of the DDLB test run. " | ||
| "Please ensure the DDLB test was executed properly and that stdout.txt is generated. " | ||
| f"You can run the generated DDLB test command manually and verify the creation of {stdout_path}. " | ||
| "If the issue persists, contact the system administrator." | ||
| ), | ||
| ) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from typing import List, cast | ||
|
|
||
| from cloudai.systems.slurm import SlurmCommandGenStrategy | ||
|
|
||
| from .ddlb import DDLBTestDefinition | ||
|
|
||
|
|
||
| class DDLBTestSlurmCommandGenStrategy(SlurmCommandGenStrategy): | ||
| """Command generation strategy for DDLB tests on Slurm systems.""" | ||
|
|
||
| def _container_mounts(self) -> List[str]: | ||
| return [] | ||
|
|
||
| def image_path(self) -> str | None: | ||
| tdef: DDLBTestDefinition = cast(DDLBTestDefinition, self.test_run.test.test_definition) | ||
| return str(tdef.docker_image.installed_path) | ||
amaslenn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| def generate_test_command(self) -> List[str]: | ||
| tdef: DDLBTestDefinition = cast(DDLBTestDefinition, self.test_run.test.test_definition) | ||
| return ["python scripts/run_benchmark.py"] | ||
|
|
||
| def gen_srun_success_check(self) -> str: | ||
| output_file = self.test_run.output_path / "stdout.txt" | ||
| return f'grep -q "Benchmark Results" {output_file} && echo 1 || echo 0' | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.