Skip to navigation

Slurm Getting Started

View as MarkdownOpen in Claude

This flow starts from a clean Python environment in a site-approved Slurm submit environment and submits one small Data Designer run. Replace the example account, partitions, image sources, and model with values available on your cluster.

Before starting, confirm the Slurm prerequisites and host responsibilities.

Obtain these site-specific values from your Slurm or platform administrator before continuing:

  • A Python 3.11 or later executable
  • An account, GPU partition, CPU image-build partition, and shared workspace path
  • An official vLLM release tag, a digest-qualified custom serving OCI image, or an absolute SQSH path containing a vLLM installation compatible with your model
  • A model available to the serving image and compute nodes

The site values and example/generator model below are placeholders. The official vLLM tag is a real image reference; select a release that supports your model and that your site can access.

1. Create and activate an environment

Create the environment on a shared filesystem at the same absolute path seen by submit and compute nodes. If software installation is not allowed on login nodes, run these steps from a dedicated editor node or a short CPU allocation approved by your administrator.

export DD_SLURM_WORKSPACE=/workspace/alice/data-designer-slurm
export DATA_DESIGNER_SLURM_PROFILE_FILE="$DD_SLURM_WORKSPACE/config/slurm-profiles.yml"
export DD_PYTHON="${DD_PYTHON:-python3}"
mkdir -p "$DD_SLURM_WORKSPACE/config" "$DD_SLURM_WORKSPACE/envs"
"$DD_PYTHON" -c 'import sys; print(sys.version); raise SystemExit(sys.version_info < (3, 11))'
"$DD_PYTHON" -m venv "$DD_SLURM_WORKSPACE/envs/control"
source "$DD_SLURM_WORKSPACE/envs/control/bin/activate"
python -m pip install --upgrade pip

If the version check fails, load a site-provided Python module or set DD_PYTHON to a supported executable such as python3.11, then rerun the block.

2. Install Data Designer with Slurm support

python -m pip install "data-designer[slurm]"
python -m pip show data-designer-slurm

The base data-designer wheel does not install or import Slurm support. The extra installs the same-version data-designer-slurm wheel and exposes the lazy data-designer slurm command group. Do not continue if pip show cannot find the extension.

The active environment is also the client runtime for submitted jobs. Planning records its exact Python executable, ABI, package inventory, and available install provenance; compute-node preflight verifies those facts before generation starts. Keep the environment at the same absolute shared path for the lifetime of submitted runs, and do not modify it while runs are active.

3. Discover the CLI

data-designer --help
data-designer slurm --help

If the Slurm command group is absent, see Troubleshooting.

4. Create a profile

Create the durable shared workspace first, then initialize an explicit profile:

data-designer slurm profile init \
--profile-file "$DATA_DESIGNER_SLURM_PROFILE_FILE" \
--cluster primary \
--workspace-root "$DD_SLURM_WORKSPACE" \
--image-build-partition cpu \
--account research \
--partition gpu

The command writes the profile with restrictive permissions and never overwrites an existing file. It leaves host_patterns empty, so this single-cluster catalog uses default_cluster: primary unless --cluster is specified. Before submitting work, review every generated site value. In particular, confirm the account, partitions, workspace, GPU request mode, gpus_per_node, and the image-build CPU, memory, and time limit. The starter sets gpus_per_node: auto, which requests the GPU count reported by eligible nodes. The run below uses one GPU per vLLM replica, not necessarily one GPU for the allocation: on an eight-GPU node, it starts eight replicas. If your site permits partial-node allocations and you want to request only one GPU, set gpus_per_node: 1 in the profile. Generation discovers the Slurm executable directory from the submit host; normally you do not need scheduler.bin_path. The starter image-build time limit is four hours and may exceed site policy. Edit it before image add when necessary.

5. Validate the profile

data-designer slurm profile validate

Validation checks strict profile loading, cluster selection, workspace access, and scheduler facts. See Profiles and clusters for non-default files and multiple clusters.

6. Register a serving image

data-designer slurm image add \
vllm/vllm-openai:v0.22.0 \
--kind serving \
--name vllm

Replace the tag with a release that supports your model and is available to your site. The CLI pins the tag to a registry digest before submission, then submits a CPU Slurm job, waits for it to finish, checks the installed vLLM version, and only then publishes the alias. Keep the terminal open. You can instead import a custom digest-pinned OCI image or register an existing absolute .sqsh path. No Data Designer client image is needed. See Images.

7. Create a Data Designer builder config

Create builder.yaml:

data_designer:
model_configs:
- alias: generator
model: example/generator
provider: openai
columns:
- name: tone
column_type: sampler
sampler_type: category
params:
values: [friendly, formal, playful]
- name: greeting
column_type: llm-text
prompt: Write one short {{ tone }} greeting.
model_alias: generator

The sampler chooses a tone for each row, and the model uses that value when writing the greeting. The model alias in this file must match a deployment in the Slurm run config.

8. Create a Slurm run config

Create run.yaml next to builder.yaml:

schema_version: 1
name: greeting-run
builder:
source: builder.yaml
invocation:
num_records: 8
dataset_name: greetings
model_concurrency:
generator: 8
deployments:
- model_alias: generator
served_model_name: example/generator
model: example/generator
server:
type: vllm
image:
name: vllm
startup_timeout: 15m
distributed_init_timeout: 10m
topology:
tensor_parallel: 1
submission:
time_limit: 01:00:00

The repository also contains checked examples under packages/data-designer-slurm/examples. served_model_name is the name sent by the client to the vLLM-compatible endpoint. It may differ from model, which can be an absolute model path visible only to the serving container. Slurm writes Parquet shard and collection files; the run config needs no output section. See GPU topology before changing resources.nodes or tensor_parallel.

9. Dry-run the submission

data-designer slurm execute run.yaml --dry-run

Dry-run resolves the selected profile, records the active shared Python runtime, verifies registered serving-image contents, loads the builder envelope, resolves client dependencies, and renders the batch script without calling sbatch. Full builder and plugin validation runs with that Python environment on the compute node. Preview staging is temporary: dry-run does not initialize durable managed-run state and cannot be resumed or passed to status.

10. Submit the run

data-designer slurm execute run.yaml

The command prints a readable result, a status command, and a first-shard log-tail command in an interactive terminal. Save its run ID; all lifecycle commands use the managed run ID rather than a raw Slurm job ID. To capture a JSON object instead, use data-designer slurm --output json execute run.yaml.

11. Inspect or cancel the run

data-designer slurm status <run-id>
data-designer slurm cancel <run-id>

Status reconciles active queue and accounting evidence with durable run state. Cancellation targets only jobs recorded for the managed run.

12. Inspect results

Each successful shard publishes a canonical winner at:

/workspace/alice/data-designer-slurm/runs/<run-id>/shards/<shard-id>/winner.json

The winner’s candidate_manifest.path points to the winning attempt’s output-manifest.json. That manifest records dataset_path and the relative path, size, digest, and record count of every canonical output file. Follow this chain instead of recursively scanning for Parquet files, because failed or superseded attempts can retain non-canonical files.

Use status to confirm every shard succeeded. To create one collected dataset at the default destination under the run directory, submit a managed collection job:

data-designer slurm merge <run-id>

The command writes to /workspace/alice/data-designer-slurm/runs/<run-id>/merge-output. --output-path selects another authorized destination. --num-partitions controls the collected Parquet file count and defaults to 1 for a new collection.

Continue with Run operations, Retry and collection, Scaling runs, Dependencies and tools, or the CLI reference.