Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions vec_inf/client/_slurm_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,15 @@ class SlurmScriptTemplate(TypedDict):
],
"write_to_json": [
'\njson_path="{log_dir}/{model_name}.$SLURM_JOB_ID/{model_name}.$SLURM_JOB_ID.json"',
'jq --arg server_addr "$server_address" \\',
" '. + {{\"server_address\": $server_addr}}' \\",
' "$json_path" > temp.json \\',
' && mv temp.json "$json_path"',
'tmp_json="${{json_path}}.tmp.$$"',
"for _attempt in 1 2 3 4 5; do",
' jq --arg server_addr "$server_address" \\',
" '. + {{\"server_address\": $server_addr}}' \\",
' "$json_path" > "$tmp_json" \\',
' && mv "$tmp_json" "$json_path" \\',
" && break",
" sleep 2",
"done",
],
"launch_cmd": {
"vllm": [
Expand Down Expand Up @@ -303,10 +308,15 @@ class BatchModelLaunchScriptTemplate(TypedDict):
"write_to_json": [
"het_job_id=$(($SLURM_JOB_ID+{het_group_id}))",
'json_path="{log_dir}/{slurm_job_name}.$het_job_id/{model_name}.$het_job_id.json"',
'jq --arg server_addr "$server_address" \\',
" '. + {{\"server_address\": $server_addr}}' \\",
' "$json_path" > temp_{model_name}.json \\',
' && mv temp_{model_name}.json "$json_path"\n',
'tmp_json="${{json_path}}.tmp.$$"',
"for _attempt in 1 2 3 4 5; do",
' jq --arg server_addr "$server_address" \\',
" '. + {{\"server_address\": $server_addr}}' \\",
' "$json_path" > "$tmp_json" \\',
' && mv "$tmp_json" "$json_path" \\',
" && break",
" sleep 2",
"done\n",
],
"container_command": f"{CONTAINER_MODULE_NAME} exec --nv --containall {{image_path}} \\",
"launch_cmd": {
Expand Down