From 31c2299ac37a93c39b296ecf311219732cf132ee Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 5 Jan 2026 11:17:29 +0200 Subject: [PATCH 1/4] Remove hardcoded --distribution=arbitrary --- src/cloudai/systems/slurm/slurm_command_gen_strategy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py index 7d187a186..5fae9419a 100644 --- a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py +++ b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py @@ -404,7 +404,6 @@ def _append_nodes_related_directives(self, content: List[str]) -> Optional[Path] num_nodes, node_list = self.get_cached_nodes_spec() if node_list: - content.append("#SBATCH --distribution=arbitrary") content.append(f"#SBATCH --nodelist={','.join(node_list)}") hostfile = (self.test_run.output_path / "hostfile.txt").absolute() From c8d33c4bf7393557e6c44574bebbb734bf8ecaa5 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 5 Jan 2026 12:12:45 +0200 Subject: [PATCH 2/4] Fix tests --- .../test_common_slurm_command_gen_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py b/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py index f79141cbd..cd84ebcb4 100644 --- a/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py +++ b/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py @@ -342,7 +342,7 @@ def test_append_distribution_and_hostfile_with_nodes(slurm_system: SlurmSystem, content: List[str] = [] strategy._append_nodes_related_directives(content) - assert "#SBATCH --distribution=arbitrary" in content + assert "#SBATCH --distribution=block" in content assert "#SBATCH --nodelist=node1,node2" in content hostfile_path = strategy.test_run.output_path / "hostfile.txt" From 8fcc20a87c7b4ffaf8ca8f557427c1bf416fa02c Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 5 Jan 2026 13:41:28 +0200 Subject: [PATCH 3/4] Fix tests --- src/cloudai/systems/slurm/slurm_command_gen_strategy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py index 5fae9419a..c91489434 100644 --- a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py +++ b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py @@ -403,6 +403,9 @@ def _append_sbatch_directives(self, batch_script_content: List[str]) -> None: def _append_nodes_related_directives(self, content: List[str]) -> Optional[Path]: num_nodes, node_list = self.get_cached_nodes_spec() + if self.system.distribution: + content.append(f"#SBATCH --distribution={self.system.distribution}") + if node_list: content.append(f"#SBATCH --nodelist={','.join(node_list)}") @@ -416,8 +419,6 @@ def _append_nodes_related_directives(self, content: List[str]) -> Optional[Path] return hostfile content.append(f"#SBATCH -N {num_nodes}") - if self.system.distribution: - content.append(f"#SBATCH --distribution={self.system.distribution}") return None From 812cf11df0dd5f03e7b87bece76ecfb23bf1eb16 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Mon, 5 Jan 2026 14:45:26 +0200 Subject: [PATCH 4/4] Update copyright year --- src/cloudai/systems/slurm/slurm_command_gen_strategy.py | 2 +- .../test_common_slurm_command_gen_strategy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py index c91489434..65fae14f0 100644 --- a/src/cloudai/systems/slurm/slurm_command_gen_strategy.py +++ b/src/cloudai/systems/slurm/slurm_command_gen_strategy.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES -# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py b/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py index cd84ebcb4..e18fdf5ed 100644 --- a/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py +++ b/tests/slurm_command_gen_strategy/test_common_slurm_command_gen_strategy.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES -# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License");