77from typing import TypedDict
88
99from vec_inf .client ._slurm_vars import (
10- SINGULARITY_IMAGE ,
11- SINGULARITY_LOAD_CMD ,
12- SINGULARITY_MODULE_NAME ,
10+ CONTAINER_LOAD_CMD ,
11+ CONTAINER_MODULE_NAME ,
12+ IMAGE_PATH ,
1313)
1414
1515
16- SINGULARITY_MODULE_NAME_UPPER = SINGULARITY_MODULE_NAME .upper ()
16+ CONTAINER_MODULE_NAME_UPPER = CONTAINER_MODULE_NAME .upper ()
1717
1818
1919class ShebangConfig (TypedDict ):
@@ -53,12 +53,12 @@ class SlurmScriptTemplate(TypedDict):
5353 ----------
5454 shebang : ShebangConfig
5555 Shebang and SLURM directive configuration
56- singularity_setup : list[str]
57- Commands for Singularity container setup
56+ container_setup : list[str]
57+ Commands for container setup
5858 imports : str
5959 Import statements and source commands
60- singularity_command : str
61- Template for Singularity execution command
60+ container_command : str
61+ Template for container execution command
6262 activate_venv : str
6363 Template for virtual environment activation
6464 server_setup : ServerSetupConfig
@@ -72,10 +72,10 @@ class SlurmScriptTemplate(TypedDict):
7272 """
7373
7474 shebang : ShebangConfig
75- singularity_setup : list [str ]
75+ container_setup : list [str ]
7676 imports : str
7777 env_vars : list [str ]
78- singularity_command : str
78+ container_command : str
7979 activate_venv : str
8080 server_setup : ServerSetupConfig
8181 find_vllm_port : list [str ]
@@ -91,15 +91,15 @@ class SlurmScriptTemplate(TypedDict):
9191 "#SBATCH --tasks-per-node=1" ,
9292 ],
9393 },
94- "singularity_setup " : [
95- SINGULARITY_LOAD_CMD ,
96- f"{ SINGULARITY_MODULE_NAME } exec { SINGULARITY_IMAGE } ray stop" ,
94+ "container_setup " : [
95+ CONTAINER_LOAD_CMD ,
96+ f"{ CONTAINER_MODULE_NAME } exec { IMAGE_PATH } ray stop" ,
9797 ],
9898 "imports" : "source {src_dir}/find_port.sh" ,
9999 "env_vars" : [
100- f"export { SINGULARITY_MODULE_NAME } _BINDPATH=${ SINGULARITY_MODULE_NAME } _BINDPATH,$(echo /dev/infiniband* | sed -e 's/ /,/g')"
100+ f"export { CONTAINER_MODULE_NAME } _BINDPATH=${ CONTAINER_MODULE_NAME } _BINDPATH,$(echo /dev/infiniband* | sed -e 's/ /,/g')"
101101 ],
102- "singularity_command " : f"{ SINGULARITY_MODULE_NAME } exec --nv --bind {{model_weights_path}}{{additional_binds}} --containall { SINGULARITY_IMAGE } \\ " ,
102+ "container_command " : f"{ CONTAINER_MODULE_NAME } exec --nv --bind {{model_weights_path}}{{additional_binds}} --containall { IMAGE_PATH } \\ " ,
103103 "activate_venv" : "source {venv}/bin/activate" ,
104104 "server_setup" : {
105105 "single_node" : [
@@ -118,7 +118,7 @@ class SlurmScriptTemplate(TypedDict):
118118 'echo "Ray Head IP: $ray_head"' ,
119119 'echo "Starting HEAD at $head_node"' ,
120120 'srun --nodes=1 --ntasks=1 -w "$head_node" \\ ' ,
121- " SINGULARITY_PLACEHOLDER " ,
121+ " CONTAINER_PLACEHOLDER " ,
122122 ' ray start --head --node-ip-address="$head_node_ip" --port=$head_node_port \\ ' ,
123123 ' --num-cpus "$SLURM_CPUS_PER_TASK" --num-gpus {gpus_per_node} --block &' ,
124124 "sleep 10" ,
@@ -128,7 +128,7 @@ class SlurmScriptTemplate(TypedDict):
128128 " node_i=${{nodes_array[$i]}}" ,
129129 ' echo "Starting WORKER $i at $node_i"' ,
130130 ' srun --nodes=1 --ntasks=1 -w "$node_i" \\ ' ,
131- " SINGULARITY_PLACEHOLDER " ,
131+ " CONTAINER_PLACEHOLDER " ,
132132 ' ray start --address "$ray_head" \\ ' ,
133133 ' --num-cpus "$SLURM_CPUS_PER_TASK" --num-gpus {gpus_per_node} --block &' ,
134134 " sleep 5" ,
@@ -196,32 +196,32 @@ class BatchModelLaunchScriptTemplate(TypedDict):
196196 ----------
197197 shebang : str
198198 Shebang line for the script
199- singularity_setup : list[str]
200- Commands for Singularity container setup
199+ container_setup : list[str]
200+ Commands for container setup
201201 env_vars : list[str]
202202 Environment variables to set
203203 server_address_setup : list[str]
204204 Commands to setup the server address
205205 launch_cmd : list[str]
206206 Commands to launch the vLLM server
207- singularity_command : str
208- Commands to setup the singularity command
207+ container_command : str
208+ Commands to setup the container command
209209 """
210210
211211 shebang : str
212- singularity_setup : str
212+ container_setup : str
213213 env_vars : list [str ]
214214 server_address_setup : list [str ]
215215 write_to_json : list [str ]
216216 launch_cmd : list [str ]
217- singularity_command : str
217+ container_command : str
218218
219219
220220BATCH_MODEL_LAUNCH_SCRIPT_TEMPLATE : BatchModelLaunchScriptTemplate = {
221221 "shebang" : "#!/bin/bash\n " ,
222- "singularity_setup " : f"{ SINGULARITY_LOAD_CMD } \n " ,
222+ "container_setup " : f"{ CONTAINER_LOAD_CMD } \n " ,
223223 "env_vars" : [
224- f"export { SINGULARITY_MODULE_NAME } _BINDPATH=${ SINGULARITY_MODULE_NAME } _BINDPATH,$(echo /dev/infiniband* | sed -e 's/ /,/g')"
224+ f"export { CONTAINER_MODULE_NAME } _BINDPATH=${ CONTAINER_MODULE_NAME } _BINDPATH,$(echo /dev/infiniband* | sed -e 's/ /,/g')"
225225 ],
226226 "server_address_setup" : [
227227 "source {src_dir}/find_port.sh" ,
@@ -238,7 +238,7 @@ class BatchModelLaunchScriptTemplate(TypedDict):
238238 ' "$json_path" > temp_{model_name}.json \\ ' ,
239239 ' && mv temp_{model_name}.json "$json_path"\n ' ,
240240 ],
241- "singularity_command " : f"{ SINGULARITY_MODULE_NAME } exec --nv --bind {{model_weights_path}}{{additional_binds}} --containall { SINGULARITY_IMAGE } \\ " ,
241+ "container_command " : f"{ CONTAINER_MODULE_NAME } exec --nv --bind {{model_weights_path}}{{additional_binds}} --containall { IMAGE_PATH } \\ " ,
242242 "launch_cmd" : [
243243 "vllm serve {model_weights_path} \\ " ,
244244 " --served-model-name {model_name} \\ " ,
0 commit comments