File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff 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" : [
Original file line number Diff line number Diff line change 3737)
3838from 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.
Original file line number Diff line number Diff line change 1212 SLURM_JOB_CONFIG_ARGS ,
1313 SLURM_SCRIPT_TEMPLATE ,
1414)
15+ from vec_inf .client .slurm_vars import SINGULARITY_IMAGE
1516
1617
1718class 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 )
You can’t perform that action at this time.
0 commit comments