From d69a34761fde545d07a4cc510211a6eb57e5453e Mon Sep 17 00:00:00 2001 From: Taekyung Heo <7621438+TaekyungHeo@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:54:02 -0400 Subject: [PATCH 1/4] Rename test definitions --- src/cloudai/test_definitions/__init__.py | 6 +++--- .../test_definitions/{chakra.py => chakra_replay.py} | 0 src/cloudai/test_definitions/{nccl.py => nccl_test.py} | 0 src/cloudai/test_definitions/{ucc.py => ucc_test.py} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/cloudai/test_definitions/{chakra.py => chakra_replay.py} (100%) rename src/cloudai/test_definitions/{nccl.py => nccl_test.py} (100%) rename src/cloudai/test_definitions/{ucc.py => ucc_test.py} (100%) diff --git a/src/cloudai/test_definitions/__init__.py b/src/cloudai/test_definitions/__init__.py index 2250820a..9c99082f 100644 --- a/src/cloudai/test_definitions/__init__.py +++ b/src/cloudai/test_definitions/__init__.py @@ -14,11 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .chakra import ChakraReplayCmdArgs, ChakraReplayTestDefinition -from .nccl import NCCLCmdArgs, NCCLTestDefinition +from .chakra_replay import ChakraReplayCmdArgs, ChakraReplayTestDefinition +from .nccl_test import NCCLCmdArgs, NCCLTestDefinition from .nemo_launcher import NeMoLauncherCmdArgs, NeMoLauncherTestDefinition from .sleep import SleepCmdArgs, SleepTestDefinition -from .ucc import UCCCmdArgs, UCCTestDefinition +from .ucc_test import UCCCmdArgs, UCCTestDefinition __all__ = [ "ChakraReplayCmdArgs", diff --git a/src/cloudai/test_definitions/chakra.py b/src/cloudai/test_definitions/chakra_replay.py similarity index 100% rename from src/cloudai/test_definitions/chakra.py rename to src/cloudai/test_definitions/chakra_replay.py diff --git a/src/cloudai/test_definitions/nccl.py b/src/cloudai/test_definitions/nccl_test.py similarity index 100% rename from src/cloudai/test_definitions/nccl.py rename to src/cloudai/test_definitions/nccl_test.py diff --git a/src/cloudai/test_definitions/ucc.py b/src/cloudai/test_definitions/ucc_test.py similarity index 100% rename from src/cloudai/test_definitions/ucc.py rename to src/cloudai/test_definitions/ucc_test.py From 1b99a241dca7885a4a54c287844165124c050d5e Mon Sep 17 00:00:00 2001 From: Taekyung Heo <7621438+TaekyungHeo@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:55:36 -0400 Subject: [PATCH 2/4] Rename UCCCmdArgs to UCCTestCmdArgs --- src/cloudai/test_definitions/__init__.py | 4 ++-- src/cloudai/test_definitions/ucc_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cloudai/test_definitions/__init__.py b/src/cloudai/test_definitions/__init__.py index 9c99082f..3bd5287a 100644 --- a/src/cloudai/test_definitions/__init__.py +++ b/src/cloudai/test_definitions/__init__.py @@ -18,7 +18,7 @@ from .nccl_test import NCCLCmdArgs, NCCLTestDefinition from .nemo_launcher import NeMoLauncherCmdArgs, NeMoLauncherTestDefinition from .sleep import SleepCmdArgs, SleepTestDefinition -from .ucc_test import UCCCmdArgs, UCCTestDefinition +from .ucc_test import UCCTestCmdArgs, UCCTestDefinition __all__ = [ "ChakraReplayCmdArgs", @@ -29,6 +29,6 @@ "NeMoLauncherTestDefinition", "SleepCmdArgs", "SleepTestDefinition", - "UCCCmdArgs", + "UCCTestCmdArgs", "UCCTestDefinition", ] diff --git a/src/cloudai/test_definitions/ucc_test.py b/src/cloudai/test_definitions/ucc_test.py index d207fb85..5696d972 100644 --- a/src/cloudai/test_definitions/ucc_test.py +++ b/src/cloudai/test_definitions/ucc_test.py @@ -19,7 +19,7 @@ from cloudai import CmdArgs, TestDefinition -class UCCCmdArgs(CmdArgs): +class UCCTestCmdArgs(CmdArgs): """UCC test command arguments.""" docker_image_url: str = "nvcr.io/nvidia/pytorch:24.02-py3" @@ -49,4 +49,4 @@ class UCCCmdArgs(CmdArgs): class UCCTestDefinition(TestDefinition): """Test object for UCC.""" - cmd_args: UCCCmdArgs + cmd_args: UCCTestCmdArgs From c8d4c08c7dd961cf9a7977a000b667cf162c2230 Mon Sep 17 00:00:00 2001 From: Taekyung Heo <7621438+TaekyungHeo@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:55:58 -0400 Subject: [PATCH 3/4] Rename NCCLCmdArgs to NCCLTestCmdArgs --- src/cloudai/test_definitions/__init__.py | 4 ++-- src/cloudai/test_definitions/nccl_test.py | 4 ++-- tests/test_test_definitions.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cloudai/test_definitions/__init__.py b/src/cloudai/test_definitions/__init__.py index 3bd5287a..fd2a8b84 100644 --- a/src/cloudai/test_definitions/__init__.py +++ b/src/cloudai/test_definitions/__init__.py @@ -15,7 +15,7 @@ # limitations under the License. from .chakra_replay import ChakraReplayCmdArgs, ChakraReplayTestDefinition -from .nccl_test import NCCLCmdArgs, NCCLTestDefinition +from .nccl_test import NCCLTestCmdArgs, NCCLTestDefinition from .nemo_launcher import NeMoLauncherCmdArgs, NeMoLauncherTestDefinition from .sleep import SleepCmdArgs, SleepTestDefinition from .ucc_test import UCCTestCmdArgs, UCCTestDefinition @@ -23,7 +23,7 @@ __all__ = [ "ChakraReplayCmdArgs", "ChakraReplayTestDefinition", - "NCCLCmdArgs", + "NCCLTestCmdArgs", "NCCLTestDefinition", "NeMoLauncherCmdArgs", "NeMoLauncherTestDefinition", diff --git a/src/cloudai/test_definitions/nccl_test.py b/src/cloudai/test_definitions/nccl_test.py index d44d372e..4b0fac2c 100644 --- a/src/cloudai/test_definitions/nccl_test.py +++ b/src/cloudai/test_definitions/nccl_test.py @@ -19,7 +19,7 @@ from cloudai import CmdArgs, TestDefinition -class NCCLCmdArgs(CmdArgs): +class NCCLTestCmdArgs(CmdArgs): """NCCL test command arguments.""" docker_image_url: str = "nvcr.io/nvidia/pytorch:24.02-py3" @@ -69,7 +69,7 @@ class NCCLCmdArgs(CmdArgs): class NCCLTestDefinition(TestDefinition): """Test object for NCCL.""" - cmd_args: NCCLCmdArgs + cmd_args: NCCLTestCmdArgs @property def extra_args_str(self) -> str: diff --git a/tests/test_test_definitions.py b/tests/test_test_definitions.py index 93839e31..96851117 100644 --- a/tests/test_test_definitions.py +++ b/tests/test_test_definitions.py @@ -19,7 +19,7 @@ import pytest import toml from cloudai import Registry, TestDefinition, TestParser -from cloudai.test_definitions import ChakraReplayCmdArgs, NCCLCmdArgs, NCCLTestDefinition +from cloudai.test_definitions import ChakraReplayCmdArgs, NCCLTestCmdArgs, NCCLTestDefinition TOML_FILES = list(Path("conf").glob("**/*.toml")) ALL_TESTS = [t for t in TOML_FILES if "test_template_name" in t.read_text()] @@ -50,7 +50,7 @@ def test_extra_args_str(input: dict, expected: str): ) def test_extra_args_str_nccl(input: dict, expected: str): t = NCCLTestDefinition( - name="test", description="test", test_template_name="test", cmd_args=NCCLCmdArgs(), extra_cmd_args=input + name="test", description="test", test_template_name="test", cmd_args=NCCLTestCmdArgs(), extra_cmd_args=input ) assert t.extra_args_str == expected From 399c57695b64c930d9a31f03da1845b9dc0573a1 Mon Sep 17 00:00:00 2001 From: Taekyung Heo <7621438+TaekyungHeo@users.noreply.github.com> Date: Tue, 8 Oct 2024 06:37:09 -0400 Subject: [PATCH 4/4] Reflect Andrei's comments --- src/cloudai/test_definitions/__init__.py | 8 ++++---- src/cloudai/test_definitions/{nccl_test.py => nccl.py} | 4 ++-- src/cloudai/test_definitions/{ucc_test.py => ucc.py} | 4 ++-- tests/test_test_definitions.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename src/cloudai/test_definitions/{nccl_test.py => nccl.py} (97%) rename src/cloudai/test_definitions/{ucc_test.py => ucc.py} (95%) diff --git a/src/cloudai/test_definitions/__init__.py b/src/cloudai/test_definitions/__init__.py index fd2a8b84..a88f418f 100644 --- a/src/cloudai/test_definitions/__init__.py +++ b/src/cloudai/test_definitions/__init__.py @@ -15,20 +15,20 @@ # limitations under the License. from .chakra_replay import ChakraReplayCmdArgs, ChakraReplayTestDefinition -from .nccl_test import NCCLTestCmdArgs, NCCLTestDefinition +from .nccl import NCCLCmdArgs, NCCLTestDefinition from .nemo_launcher import NeMoLauncherCmdArgs, NeMoLauncherTestDefinition from .sleep import SleepCmdArgs, SleepTestDefinition -from .ucc_test import UCCTestCmdArgs, UCCTestDefinition +from .ucc import UCCCmdArgs, UCCTestDefinition __all__ = [ "ChakraReplayCmdArgs", "ChakraReplayTestDefinition", - "NCCLTestCmdArgs", + "NCCLCmdArgs", "NCCLTestDefinition", "NeMoLauncherCmdArgs", "NeMoLauncherTestDefinition", "SleepCmdArgs", "SleepTestDefinition", - "UCCTestCmdArgs", + "UCCCmdArgs", "UCCTestDefinition", ] diff --git a/src/cloudai/test_definitions/nccl_test.py b/src/cloudai/test_definitions/nccl.py similarity index 97% rename from src/cloudai/test_definitions/nccl_test.py rename to src/cloudai/test_definitions/nccl.py index 4b0fac2c..d44d372e 100644 --- a/src/cloudai/test_definitions/nccl_test.py +++ b/src/cloudai/test_definitions/nccl.py @@ -19,7 +19,7 @@ from cloudai import CmdArgs, TestDefinition -class NCCLTestCmdArgs(CmdArgs): +class NCCLCmdArgs(CmdArgs): """NCCL test command arguments.""" docker_image_url: str = "nvcr.io/nvidia/pytorch:24.02-py3" @@ -69,7 +69,7 @@ class NCCLTestCmdArgs(CmdArgs): class NCCLTestDefinition(TestDefinition): """Test object for NCCL.""" - cmd_args: NCCLTestCmdArgs + cmd_args: NCCLCmdArgs @property def extra_args_str(self) -> str: diff --git a/src/cloudai/test_definitions/ucc_test.py b/src/cloudai/test_definitions/ucc.py similarity index 95% rename from src/cloudai/test_definitions/ucc_test.py rename to src/cloudai/test_definitions/ucc.py index 5696d972..d207fb85 100644 --- a/src/cloudai/test_definitions/ucc_test.py +++ b/src/cloudai/test_definitions/ucc.py @@ -19,7 +19,7 @@ from cloudai import CmdArgs, TestDefinition -class UCCTestCmdArgs(CmdArgs): +class UCCCmdArgs(CmdArgs): """UCC test command arguments.""" docker_image_url: str = "nvcr.io/nvidia/pytorch:24.02-py3" @@ -49,4 +49,4 @@ class UCCTestCmdArgs(CmdArgs): class UCCTestDefinition(TestDefinition): """Test object for UCC.""" - cmd_args: UCCTestCmdArgs + cmd_args: UCCCmdArgs diff --git a/tests/test_test_definitions.py b/tests/test_test_definitions.py index 96851117..93839e31 100644 --- a/tests/test_test_definitions.py +++ b/tests/test_test_definitions.py @@ -19,7 +19,7 @@ import pytest import toml from cloudai import Registry, TestDefinition, TestParser -from cloudai.test_definitions import ChakraReplayCmdArgs, NCCLTestCmdArgs, NCCLTestDefinition +from cloudai.test_definitions import ChakraReplayCmdArgs, NCCLCmdArgs, NCCLTestDefinition TOML_FILES = list(Path("conf").glob("**/*.toml")) ALL_TESTS = [t for t in TOML_FILES if "test_template_name" in t.read_text()] @@ -50,7 +50,7 @@ def test_extra_args_str(input: dict, expected: str): ) def test_extra_args_str_nccl(input: dict, expected: str): t = NCCLTestDefinition( - name="test", description="test", test_template_name="test", cmd_args=NCCLTestCmdArgs(), extra_cmd_args=input + name="test", description="test", test_template_name="test", cmd_args=NCCLCmdArgs(), extra_cmd_args=input ) assert t.extra_args_str == expected