Skip to content

Commit 22d90f2

Browse files
committed
Add --account slurm argument for launch
1 parent 7a0d03c commit 22d90f2

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

vec_inf/cli/_cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ def cli() -> None:
6262
type=int,
6363
help="Number of GPUs/node to use, default to suggested resource allocation for model",
6464
)
65+
@click.option(
66+
"--account",
67+
type=str,
68+
help="Charge resources used by this job to specified account.",
69+
)
6570
@click.option(
6671
"--qos",
6772
type=str,

vec_inf/client/_client_vars.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
SLURM_JOB_CONFIG_ARGS = {
5757
"job-name": "model_name",
5858
"partition": "partition",
59+
"account": "account",
5960
"qos": "qos",
6061
"time": "time",
6162
"nodes": "num_nodes",

vec_inf/client/_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def _get_launch_params(self) -> dict[str, Any]:
175175
If required fields are missing or tensor parallel size is not specified
176176
when using multiple GPUs
177177
"""
178-
params = self.model_config.model_dump()
178+
params = self.model_config.model_dump(exclude_none=True)
179179

180180
# Override config defaults with CLI arguments
181181
if self.kwargs.get("vllm_args"):

vec_inf/client/_slurm_script_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def _generate_shebang(self) -> str:
6868
"""
6969
shebang = [SLURM_SCRIPT_TEMPLATE["shebang"]["base"]]
7070
for arg, value in SLURM_JOB_CONFIG_ARGS.items():
71-
shebang.append(f"#SBATCH --{arg}={self.params[value]}")
71+
if self.params.get(value):
72+
shebang.append(f"#SBATCH --{arg}={self.params[value]}")
7273
if self.is_multinode:
7374
shebang += SLURM_SCRIPT_TEMPLATE["shebang"]["multinode"]
7475
return "\n".join(shebang)

vec_inf/client/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class ModelConfig(BaseModel):
4747
Memory allocation per node in GB format (e.g., '32G')
4848
vocab_size : int
4949
Size of the model's vocabulary (1-1,000,000)
50+
account : Optional[str], optional
51+
Charge resources used by this job to specified account.
5052
qos : Union[QOS, str], optional
5153
Quality of Service tier for job scheduling
5254
time : str, optional
@@ -92,6 +94,9 @@ class ModelConfig(BaseModel):
9294
description="Memory per node",
9395
)
9496
vocab_size: int = Field(..., gt=0, le=1_000_000)
97+
account: Optional[str] = Field(
98+
default=None, description="Account name for job scheduling"
99+
)
95100
qos: Union[QOS, str] = Field(
96101
default=cast(str, DEFAULT_ARGS["qos"]), description="Quality of Service tier"
97102
)

vec_inf/client/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ class LaunchOptions:
164164
Number of nodes to allocate
165165
gpus_per_node : int, optional
166166
Number of GPUs per node
167+
account : str, optional
168+
Account name for job scheduling
167169
qos : str, optional
168170
Quality of Service level
169171
time : str, optional
@@ -187,6 +189,7 @@ class LaunchOptions:
187189
partition: Optional[str] = None
188190
num_nodes: Optional[int] = None
189191
gpus_per_node: Optional[int] = None
192+
account: Optional[str] = None
190193
qos: Optional[str] = None
191194
time: Optional[str] = None
192195
vocab_size: Optional[int] = None

0 commit comments

Comments
 (0)