Skip to content

Commit a9c207d

Browse files
committed
Remove SINGULARITY_IMAGE env var as it breaks reproducibility
1 parent 618e18f commit a9c207d

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

vec_inf/client/_client_vars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ class SlurmScriptTemplate(TypedDict):
144144
},
145145
"singularity_setup": [
146146
SINGULARITY_LOAD_CMD,
147-
"singularity exec $SINGULARITY_IMAGE ray stop",
147+
"singularity exec {singularity_image} ray stop",
148148
],
149149
"imports": "source {src_dir}/find_port.sh",
150-
"singularity_command": "singularity exec --nv --bind {model_weights_path}:{model_weights_path} --containall $SINGULARITY_IMAGE",
150+
"singularity_command": "singularity exec --nv --bind {model_weights_path}:{model_weights_path} --containall {singularity_image}",
151151
"activate_venv": "source {venv}/bin/activate",
152152
"server_setup": {
153153
"single_node": [

vec_inf/client/_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
)
3838
from vec_inf.client.slurm_vars import (
3939
LD_LIBRARY_PATH,
40-
SINGULARITY_IMAGE,
4140
VLLM_NCCL_SO_PATH,
4241
)
4342

@@ -229,7 +228,6 @@ def _set_env_vars(self) -> None:
229228
"""Set environment variables for the launch command."""
230229
os.environ["LD_LIBRARY_PATH"] = LD_LIBRARY_PATH
231230
os.environ["VLLM_NCCL_SO_PATH"] = VLLM_NCCL_SO_PATH
232-
os.environ["SINGULARITY_IMAGE"] = SINGULARITY_IMAGE
233231

234232
def _build_launch_command(self) -> str:
235233
"""Generate the slurm script and construct the launch command.

vec_inf/client/_slurm_script_generator.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
SLURM_JOB_CONFIG_ARGS,
1313
SLURM_SCRIPT_TEMPLATE,
1414
)
15+
from vec_inf.client.slurm_vars import SINGULARITY_IMAGE
1516

1617

1718
class SlurmScriptGenerator:
@@ -85,7 +86,11 @@ def _generate_server_setup(self) -> str:
8586
"""
8687
server_script = ["\n"]
8788
if self.use_singularity:
88-
server_script.append("\n".join(SLURM_SCRIPT_TEMPLATE["singularity_setup"]))
89+
server_script.append(
90+
"\n".join(SLURM_SCRIPT_TEMPLATE["singularity_setup"]).format(
91+
singularity_image=SINGULARITY_IMAGE,
92+
)
93+
)
8994
server_script.append(
9095
SLURM_SCRIPT_TEMPLATE["imports"].format(src_dir=self.params["src_dir"])
9196
)
@@ -97,7 +102,8 @@ def _generate_server_setup(self) -> str:
97102
server_setup_str = server_setup_str.replace(
98103
"SINGULARITY_PLACEHOLDER",
99104
SLURM_SCRIPT_TEMPLATE["singularity_command"].format(
100-
model_weights_path=self.model_weights_path
105+
model_weights_path=self.model_weights_path,
106+
singularity_image=SINGULARITY_IMAGE,
101107
),
102108
)
103109
else:
@@ -128,7 +134,8 @@ def _generate_launch_cmd(self) -> str:
128134
if self.use_singularity:
129135
launcher_script.append(
130136
SLURM_SCRIPT_TEMPLATE["singularity_command"].format(
131-
model_weights_path=self.model_weights_path
137+
model_weights_path=self.model_weights_path,
138+
singularity_image=SINGULARITY_IMAGE,
132139
)
133140
+ " \\"
134141
)

0 commit comments

Comments
 (0)