From 5dd5e0d57a0315bf8f0c72367711be541225ebb6 Mon Sep 17 00:00:00 2001 From: Zimin Li Date: Fri, 7 Aug 2026 22:13:31 +0800 Subject: [PATCH 1/2] fix: stage `icclrun` wrappers for remote MPI launches --- scripts/backends/mpi_base.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/backends/mpi_base.py b/scripts/backends/mpi_base.py index 3857eba..a1ec6a5 100644 --- a/scripts/backends/mpi_base.py +++ b/scripts/backends/mpi_base.py @@ -41,9 +41,14 @@ def get_launch_command(self, config, executable, user_args, launcher_obj): if not launcher_script: launcher_script = launcher_obj.ensure_launcher_exists() - # If any node-specific `dir` is given, stage the generated wrapper at one identical '/tmp' path on all nodes. - # Node-specific dirs may differ, but 'mpirun' can launch only one script path. - if any("dir" in node for node in config["nodes"]): + # Stage generated wrappers when `mpirun` needs one executable path for + # node-specific source dirs, or when a remote node would otherwise exec + # the wrapper directly from shared storage such as NFS to avoid conflicts. + should_stage_launcher = any("dir" in node for node in config["nodes"]) or any( + not launcher_obj._is_local(node["ip"]) for node in config["nodes"] + ) + + if should_stage_launcher: remote_launcher = f"/tmp/infiniccl_{os.path.basename(launcher_script)}" subprocess.run(["cp", launcher_script, remote_launcher], check=True) os.chmod(remote_launcher, 0o755) From 3ee7dee31b7114e87fd0e5db1947e41717974b72 Mon Sep 17 00:00:00 2001 From: Zimin Li Date: Mon, 10 Aug 2026 06:46:33 +0000 Subject: [PATCH 2/2] style: ruff format `scripts/backends/mpi_base.py` --- scripts/backends/mpi_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/backends/mpi_base.py b/scripts/backends/mpi_base.py index a1ec6a5..c5be9d1 100644 --- a/scripts/backends/mpi_base.py +++ b/scripts/backends/mpi_base.py @@ -44,9 +44,9 @@ def get_launch_command(self, config, executable, user_args, launcher_obj): # Stage generated wrappers when `mpirun` needs one executable path for # node-specific source dirs, or when a remote node would otherwise exec # the wrapper directly from shared storage such as NFS to avoid conflicts. - should_stage_launcher = any("dir" in node for node in config["nodes"]) or any( - not launcher_obj._is_local(node["ip"]) for node in config["nodes"] - ) + should_stage_launcher = any( + "dir" in node for node in config["nodes"] + ) or any(not launcher_obj._is_local(node["ip"]) for node in config["nodes"]) if should_stage_launcher: remote_launcher = f"/tmp/infiniccl_{os.path.basename(launcher_script)}"