Skip to navigation

Slurm run configuration

View as MarkdownOpen in Claude

A run file is portable intent. Cluster-specific accounts, partitions, workspace paths, GPU facts, and image-build resources belong in a profile.

Required structure

schema_version: 1
name: product-descriptions
builder:
source: builder.yaml
invocation:
num_records: 1000
dataset_name: product-descriptions
model_concurrency:
generator: 64
deployments:
- model_alias: generator
served_model_name: example/generator
model: example/generator
server:
type: vllm
image:
name: vllm
resources:
nodes: 1
topology:
tensor_parallel: 8
nodes_per_replica: 1
array_tasks:
count: 1
submission:
job_name: product-descriptions
time_limit: 03:55:00

builder accepts exactly one complete serialized Data Designer config through source or inline. Relative source paths resolve from the run file directory. invocation.run_config accepts public RunConfig fields except display_tui, which is disabled for Slurm jobs. input_bindings.seed_path and managed_assets_path accept absolute compute-visible paths.

Each builder model alias listed in deployments is served locally. Every remaining alias must reference a provider in DD’s normal model_providers.yaml settings. model_concurrency accepts any declared alias, including external models. Deployment aliases must be unique. model selects the Hugging Face model ID or absolute model path loaded by the serving container. served_model_name is the name exposed to the client and defaults to model; set it explicitly when model is a container-visible path but the builder uses a stable model name. Shard and collected output files are Parquet. Choose the destination and partition count with slurm merge after the run completes.

The client runs from the same shared Python environment as the CLI on the first allocated node. Its step requests no GPUs; local serving steps use the GPUs and their registered images. The client block is optional; client.cpus defaults to 16. It sets the client step’s CPU request and contributes to the batch allocation’s CPU request.

Use submission.partition to override the profile’s GPU partition selection for one run. It accepts a comma-separated value or a YAML list, such as:

submission:
partition: [gpu-a, gpu-b]

Slurm schedules the job in one of the selected partitions. For runs with local deployments and gpus_per_node: auto, every selected partition must report GPU resources with one consistent count.

External model providers

Configure hosted endpoints in DD’s normal provider settings on the host where you run the Slurm submission command. The default file is ~/.data-designer/model_providers.yaml.

DATA_DESIGNER_HOME is an optional environment variable that changes DD’s settings directory. If it is unset, DD uses ~/.data-designer. To use a different directory, set it before launching the Slurm CLI:

export DATA_DESIGNER_HOME="$HOME/dd-settings"
mkdir -p "$DATA_DESIGNER_HOME"

With this override, the provider file is $DATA_DESIGNER_HOME/model_providers.yaml. See Default Model Settings for more about DD’s settings files.

Add the hosted provider to the providers list in that file. Provider definitions are separate from the recipe’s model_configs and the Slurm run file:

providers:
- name: hosted
endpoint: https://models.example/v1
provider_type: openai
api_key: MODEL_API_KEY

Export MODEL_API_KEY in the submit environment. Keep its value out of configuration files. The recipe references the provider through its normal ModelConfig:

data_designer:
model_configs:
- alias: generator
model: example/generator
provider: openai
- alias: judge
model: example/hosted-judge
provider: hosted
# Keep the recipe's columns and inference parameters here.

The Slurm run deploys only generator. There is no separate hosted-provider block in the run file:

invocation:
num_records: 1000
dataset_name: judged-output
model_concurrency:
generator: 64
judge: 16

Submission captures only the required hosted providers in the resolved run inputs, using DD’s native provider representation. Later edits to submit-side settings do not change that run, and compute nodes do not need access to the submit host’s settings directory. Missing or ambiguous providers and collisions with generated names such as slurm-generator fail before submission. Only locally deployed aliases receive generated endpoints; hosted model names and inference settings stay intact. An explicit model_concurrency value overrides the selected alias’s request concurrency.

API keys must reference environment variables. Slurm forwards their values only to native client steps through runtime credential transport, including retries. Values stay out of persisted plans and generated scripts. Plaintext API keys, sensitive headers, and custom secret resolvers are not supported for hosted Slurm providers. Non-secret extra_body parameters and static headers use the normal DD provider fields.

Both local and external requests use DD’s existing async engine. Ready requests for different records and models can overlap. Async overlap does not guarantee continuous GPU utilization: slow external calls and the final judging tail can still retain an idle GPU allocation. Measure utilization against the cluster’s policy when deciding whether to use separate recipe stages.

Hosted-only CPU runs

Slurm runs require at least one explicitly configured model. Sampler-only recipes are not currently supported.

For a builder whose models all reference configured hosted providers, omit local deployments or set deployments: []. Select the cluster’s CPU partition:

schema_version: 1
name: hosted-judging
builder:
source: hosted-builder.yaml
invocation:
num_records: 1000
dataset_name: hosted-judging
client:
cpus: 4
deployments: []
submission:
partition: cpu
memory: 16G

Each array task requests one node with --gres=none and --cpus-per-task set to client.cpus. It does not discover GPUs, reserve exclusive nodes, require serving images, or start serving containers and proxies. The profile’s GPU facts and GPU memory request are unused for this run. Sharding, status, retry, resume, and collection use the same commands as local-model runs.

Set submission.memory to the memory needed per node, such as 16G. It emits --mem for generation and collection jobs and takes precedence over the profile’s mem_per_gpu request for generation. If omitted, local deployments retain the profile’s GPU memory request; otherwise Slurm’s memory default applies. Some clusters default to reserving all memory on a node, even for a small CPU-only job.

Configure vLLM

Each server supports readiness and launch controls:

server:
type: vllm
image:
name: vllm
startup_timeout: 20m
distributed_init_timeout: 10m
lead_boot_standoff: 60s
rank_launch_stagger: 5s
readiness_path: /health
queue_backpressure:
max_waiting_requests: 128
retry_after_seconds: 1
extra_args:
- --dtype
- bfloat16

distributed_init_timeout must not exceed startup_timeout. Increase both when distributed initialization legitimately needs more time.

Set server.io_processor_plugin to a registered vLLM IO processor name, such as deberta_gliner_io for GLiNER. The serving image must include the plugin and its dependencies, and the model must be prepared for that plugin. Pooling options such as --runner pooling belong in extra_args.

extra_args is a list of individual arguments, not a shell command. Options owned by the orchestrator and unsafe shell forms are rejected. Configure model identity, topology, networking, and lifecycle through their typed fields instead of passing reserved options such as --model, --served-model-name, --host, --port, --tensor-parallel-size, --pipeline-parallel-size, or distributed-launch flags. In particular, served_model_name belongs on the deployment, alongside model, not under server.extra_args.

Scale runs

Each array task gets a separate allocation containing all deployments. A deployment’s resources.nodes is its node count within one array task; different deployments use different nodes by default. For example, a run with a two-node writer and a one-node reviewer requests three nodes per array task. array_tasks.max_concurrent limits how many such allocations may run at once.

Arrays

Split the requested total into independent shards and cap the number of allocations that can run at once:

invocation:
num_records: 1000
dataset_name: sharded-run
array_tasks:
count: 5
max_concurrent: 2

This submits one Slurm job array with tasks 0 through 4 (--array=0-4%2). Each task runs the entire deployment set and plans 200 records: task 0 owns indices [0, 200), task 1 owns [200, 400), and so on through task 4 with [800, 1000). Task 2 corresponds to shard-00002. At most two tasks can run concurrently, subject to available cluster resources. Omit max_concurrent to let Slurm schedule all five as resources permit. When the total does not divide evenly, the last task gets the remainder. count cannot exceed num_records, and max_concurrent cannot exceed count.

num_records is the planned total, not a guaranteed output count. A nonempty shard can succeed with fewer records; an empty shard needs a retry. Status, retry, and collection retain each task’s shard identity and winning attempt. Array task count does not set the number of collected Parquet files: slurm merge RUN_ID --num-partitions 5 requests five files from the winning records. See Retry and collection for partial results.

After submission, inspect the managed run ID. If task 2 fails, preview a retry of only that shard:

data-designer slurm status <run-id>
data-designer slurm retry <run-id> --task-id 2 --dry-run

Runs with more than one array task do not support global processors or profilers; image, plugin, custom, or unknown column types; local-callable validators; shuffled seed input; or authored seed-selection strategies. Seeded array runs must bind the dataset through invocation.input_bindings.seed_path.

Independent replicas

Allocate multiple nodes and use all eight GPUs per node for one vLLM replica on each node:

resources:
nodes: 4
topology:
tensor_parallel: 8
nodes_per_replica: 1

In an eight-GPU profile, this deployment starts four independent eight-GPU servers. To start one server per GPU instead, use tensor_parallel: 1; with the same four nodes, that starts 32 servers. Both layouts reserve four eight-GPU nodes in a GRES profile.

resources:
nodes: 4
topology:
tensor_parallel: 1
nodes_per_replica: 1

Multi-node replicas

Use more than one node for each replica:

resources:
nodes: 4
topology:
tensor_parallel: 8
nodes_per_replica: 2
pipeline_parallel: 2

In an eight-GPU profile, this starts two replicas, each spanning two nodes with 16 GPUs total. Each replica has two pipeline stages, each using TP8. TP communication stays within each node, and intermediate activations pass between the stages across nodes.

GPU topology and replica count

One replica serves requests using a group of GPU workers. Choose how those workers cooperate:

  • Tensor parallelism (TP) splits work within model layers across GPUs. A TP group can span multiple nodes.
  • Pipeline parallelism (PP) splits model layers into sequential stages. A replica can use TP, PP, or both.
  • Independent replicas serve different requests with separate copies of the model. The planner derives their count from the GPU budget and the topology of each replica.

tensor_parallel and pipeline_parallel specify the TP and PP sizes for one replica. nodes_per_replica specifies how many nodes host that replica; it does not select the parallelism method.

pipeline_parallel defaults to 1, regardless of nodes_per_replica. Spreading a replica across nodes does not add pipeline stages. Set pipeline_parallel: 2 explicitly when you want two stages. TP and PP do not need to be equal; their product determines the GPU count per replica.

For a profile requesting four GPUs per node, this configuration runs one TP16 replica across four nodes. PP defaults to 1, and expert parallelism defaults to disabled:

resources:
nodes: 4
topology:
tensor_parallel: 16
nodes_per_replica: 4
server:
type: vllm
image:
name: my-serving-image

The serving image must support the selected model and parallel settings. The runtime starts one vLLM process on each replica node, with one API server and headless followers sharing a rendezvous.

One TP16 replica across two eight-GPU nodes

For a profile requesting eight GPUs per node, the following deployment fragment creates one replica using all 16 GPUs:

resources:
nodes: 2
topology:
tensor_parallel: 16
nodes_per_replica: 2

Node 0 hosts the API server and eight GPU workers; node 1 hosts a headless follower and eight GPU workers. Both nodes cooperate on the same requests. The native Data Designer client uses a separate CPU step and sends requests to the replica through its logical endpoint.

This topology describes GPU placement, not whether the model fits in memory. Check the serving runtime’s model, quantization, memory, and interconnect requirements separately. If you configure CPU offloading through server.extra_args, allow enough host memory and increase model request timeouts to account for the additional latency.

Optional expert parallelism

For a Mixture-of-Experts (MoE) model, server.enable_expert_parallel: true asks vLLM to distribute routed experts across its expert-parallel ranks instead of using tensor parallelism to split each expert. Attention layers still use the configured TP layout. See vLLM’s expert parallelism guide for the layer behavior and backend requirements.

EP defaults to false and is not required for a TP group to span nodes. Enabling it does not multiply the GPU count: the TP16/PP1 example still uses 16 GPUs in one replica. Choose EP based on the model, serving image, communication backend, and measured workload behavior. The planner does not create coordinated data-parallel expert groups across independent replicas.

Calculate replica counts

The planner distributes each replica’s GPU workers evenly across its nodes:

PP = pipeline_parallel (default: 1)
GPUs per replica = tensor_parallel * PP
GPUs per replica node = GPUs per replica / nodes_per_replica
replicas = (resources.nodes / nodes_per_replica) * (gpus_per_node / GPUs per replica node)

For a profile that requests eight GPUs per node, the following are separate choices for one deployment in one array task. PP is explicit in this table:

resources.nodesTPPPnodes_per_replicavLLM replicasGPUs per replica
111181
124118
281128
2822116
21612116
2442116
41612216
4111321

These are valid planner layouts; each model and serving image must also support the selected TP and PP sizes. In the four-node TP16/PP1 example, each pair of nodes hosts an independent 16-GPU replica. Enabling EP keeps those two replicas separate.

Increasing resources.nodes at TP=1 creates more independent one-GPU servers; it does not combine their GPUs into one larger server. The client uses one logical endpoint per model alias, backed by a local proxy that routes requests among that alias’s replicas. invocation.model_concurrency limits in-flight model calls per alias within each array task; it does not set the replica count or the number of array tasks.

tensor_parallel * PP must divide evenly across nodes_per_replica. The resulting GPUs per replica node must be positive and divide the GPUs requested per node in the selected profile. nodes_per_replica must divide resources.nodes. With gpus_per_node: auto, the eligible nodes must agree on their GPU count. These rules are checked before submission.

Multiple models and images

Add one deployment per locally served builder model alias. Each deployment may use a different registered serving image:

deployments:
- model_alias: writer
model: example/writer
server:
type: vllm
image:
name: vllm-writer
- model_alias: judge
model: example/judge
server:
type: vllm
image:
name: vllm-judge
invocation:
num_records: 1000
dataset_name: judged-output
model_concurrency:
writer: 64
judge: 32

Different models on one node

By default, deployments use disjoint nodes and each receives the profile’s GPU budget. To place different models on the same physical node, give their resources the same shared_node name and explicit GPU quotas:

deployments:
- model_alias: writer
model: Qwen/Qwen2.5-0.5B-Instruct
resources:
shared_node: models
gpus_per_node: 1
topology:
tensor_parallel: 1
server:
type: vllm
image: {name: vllm}
- model_alias: judge
model: microsoft/Phi-3-mini-4k-instruct
resources:
shared_node: models
gpus_per_node: 1
topology:
tensor_parallel: 1
server:
type: vllm
image: {name: vllm}

Declare both aliases in the Data Designer builder. For example, the writer can generate an answer column and the judge can evaluate {{ answer }} in a dependent column. A complete four-record example is included at packages/data-designer-slurm/examples/colocated-models.yaml.

The profile’s gpus_per_node is the Slurm allocation budget. Set it to 2 for the example above; the quota sum must fit that budget. Each quota is a positive number of GPUs reserved for that deployment. tensor_parallel must divide its quota: a quota of four with TP two starts two replicas of that model. The compiler assigns immutable disjoint GPU slices and separate backend and logical endpoint ports. GPU identifiers are resolved from the serving step’s actual CUDA visibility, including Slurm device remapping. Each alias retains its own readiness, backend order, concurrency, and status; a model failure stops the shared worker and fails the attempt.

Shared placement requires one group covering every deployment in the run, at least two deployments, resources.nodes: 1, nodes_per_replica: 1, GRES GPU request mode, the same resolved serving image, and identical server.environment and queue_backpressure settings. Model identities, served names, extra arguments, and launch/readiness timings may differ. Multiple groups, mixtures of shared and disjoint placements, multi-node shared groups, and different images within one group are rejected before submission. Memory fit is not inferred. An allocation can use fewer GPUs than the physical node has; sharing does not add node exclusivity.

To share a GPU explicitly, set resources.gpu_start_index: 0 and gpus_per_node: 1 on both deployments, with a profile budget of one GPU. For a TP-two model sharing its second GPU with a detector, use offsets 0 and 1 with quotas 2 and 1 and a profile budget of two. Each slice must fit the budget; automatic placement follows the highest assigned index. Overlapping models start in launch-delay order, waiting for a model’s readiness before starting another model on its GPUs. Configure per-model --gpu-memory-utilization, context length, and concurrency through server.extra_args to leave sufficient memory for both models and startup allocations.

Python callers use the same resource fields with with_deployment:

slurm.with_deployment({
"model_alias": "writer",
"model": "Qwen/Qwen2.5-0.5B-Instruct",
"resources": {"shared_node": "models", "gpus_per_node": 1},
"topology": {"tensor_parallel": 1},
"server": {"type": "vllm", "image": {"name": "vllm"}},
})

Add the judge deployment with the same group name before calling build() or write_config().

Put topologies and shards together

This example plans 1,000 records across five array tasks. Each task allocates two nodes for one-GPU writer replicas and one node for a single eight-GPU reviewer replica. The two aliases may load different model families and serving images:

schema_version: 1
name: sharded-two-model-run
builder:
source: builder.yaml
invocation:
num_records: 1000
dataset_name: reviewed-records
model_concurrency:
writer: 16
reviewer: 16
deployments:
- model_alias: writer
model: example/writer-model
server:
type: vllm
image:
name: vllm-writer
resources:
nodes: 2
topology:
tensor_parallel: 1
nodes_per_replica: 1
- model_alias: reviewer
model: example/reviewer-model
server:
type: vllm
image:
name: vllm-reviewer
resources:
nodes: 1
topology:
tensor_parallel: 8
nodes_per_replica: 1
array_tasks:
count: 5
max_concurrent: 2

With eight GPUs per node, each task has 16 writer replicas and one reviewer replica on three nodes. At most two tasks can run together, so the run can occupy up to six nodes and has up to 32 writer replicas and two reviewer replicas while both tasks are active. The client can send up to 16 in-flight calls per alias in each task, or up to 32 per alias across two active tasks. Each task has its own client, proxies, and 200 planned records; the tasks do not share a model endpoint. builder.yaml must declare writer and reviewer model aliases, and both image aliases and model IDs above must be replaced with registered images and models available to your cluster.

Build a run in Python

from data_designer.config import DataDesignerConfigBuilder, LLMTextColumnConfig, ModelConfig
from data_designer.slurm.config import DataDesignerSlurmConfigBuilder
builder = DataDesignerConfigBuilder(
model_configs=[
ModelConfig(alias="generator", model="example/generator", provider="openai")
]
)
builder.add_column(
LLMTextColumnConfig(
name="greeting",
prompt="Write one short greeting.",
model_alias="generator",
)
)
slurm = (
DataDesignerSlurmConfigBuilder.from_config_builder(builder, name="generated-run")
.with_invocation(
num_records=100,
dataset_name="generated",
model_concurrency={"generator": 16},
)
.with_client(cpus=16)
.with_deployment(
{
"model_alias": "generator",
"model": "example/generator",
"server": {"type": "vllm", "image": {"name": "vllm"}},
}
)
)
slurm.write_config("run.yaml")

The Slurm builder validates each orchestration step and writes strict YAML or JSON. Full Data Designer builder and plugin validation runs in the prepared client environment. The CLI rejects duplicate keys, YAML anchors, merge keys, unknown fields, and environment interpolation outside the serialized Data Designer builder payload.