npx skills add ...
npx skills add nvidia/tensorrt-llm --skill exec-slurm-compile
Compile TensorRT-LLM on a SLURM cluster. Covers submitting a batch job with a container image, monitoring the job, and verifying the build. Use when the user wants to compile TRT-LLM remotely via SLURM rather than on a local compute node.
npx skills add nvidia/tensorrt-llm --skill exec-slurm-compile
Submit, monitor, and verify a TensorRT-LLM compilation job on a SLURM cluster using enroot containers.
| Scenario | Use This Skill? |
|---|---|
| User wants to compile TRT-LLM on a SLURM cluster | Yes |
| User is already on a compute node and wants to compile | No — use exec-local-compile skill instead |
The official Docker image tag for a given TensorRT-LLM version is recorded in the repo itself:
Read this file to find the current image URL. The format is <registry-host>/<namespace>/tensorrt-llm:<tag>, for example <your-registry>/<your-namespace>/tensorrt-llm:pytorch-25.12-py3-aarch64-ubuntu24.04-trt10.14.1.48-skip-tritondevel-202602011118-10901. Substitute <your-registry> and <your-namespace> with your own container registry coordinates.
SLURM clusters using enroot/pyxis require a .sqsh container image. To avoid download overhead at compile time, pre-dump the image in advance using the enroot-import companion script:
The script submits an sbatch job that runs enroot import docker://<image_url> and produces a .sqsh file in the current directory. The output on stdout is the SLURM job ID.
| Flag | Description |
|---|---|
-p, --partition | SLURM partition for the import job (use a CPU partition like cpu_datamover) |
-d, --debug | Enable debug output and preserve the SLURM log (recommended) |
-o, --output | Custom output path for the .sqsh file |
-A, --account | SLURM account (defaults to user's first account) |
-t, --time | Time limit for the import job (default: 1 hour) |
-n, --just-print | Print the sbatch command without executing |
-J, --job-name | Custom job name |
jenkins/current_image_tags.properties in the TRT-LLM repo.enroot-import to submit the import job:
/ after the registry host with # to avoid credential issues. For example, <your-registry>/<your-namespace>/tensorrt-llm:xxx becomes <your-registry>#<your-namespace>/tensorrt-llm:xxx.squeue -j <job_id>)..sqsh file is the container_image used in the compile step.The user must provide (or you must ask for) these values:
| Parameter | Description | Example |
|---|---|---|
container_image | Path to .sqsh container image (see enroot import above) | /path/to/pytorch.sqsh |
repo_dir | Path to the TensorRT-LLM repository | /path/to/TensorRT-LLM |
user_root_dir | Top-level directory to bind-mount into the container | /shared/users |
partition | SLURM partition | batch |
account | SLURM account | my_account |
Optional parameters:
| Parameter | Description | Default |
|---|---|---|
jobname | SLURM job name | trtllm-compile.<username> |
gpu_count | Number of GPUs to request | 4 |
time_limit | Job time limit | 02:00:00 |
arch | GPU architecture(s) for -a flag | 100-real |
extra_build_args | Extra flags for build_wheel.py | (none) |
This skill includes three companion scripts in scripts/:
| Script | Purpose |
|---|---|
enroot-import | Pre-dump a Docker image to .sqsh via a SLURM batch job |
submit_compile.sh | Template for submitting the SLURM job — copy and customize |
compile.slurm | SLURM batch script — launches the container and calls compile.sh |
compile.sh | Runs inside the container — executes build_wheel.py |
Scripts directory: skills/exec-slurm-compile/scripts/
Follow these steps in order:
If the user does not already have a .sqsh container image:
<repo_dir>/jenkins/current_image_tags.properties.enroot-import to pre-dump it:
squeue -j <job_id>..sqsh file path becomes the container_image parameter.If the user already has a .sqsh file, skip this step.
Ask the user for any missing prerequisite values listed above. At minimum you need:
container_image (or the Docker image URL — then run Step 0 first)repo_diruser_root_dirpartition and accountIf the user has used this workflow before, check if previous values are stored in memory files.
The compile scripts must be accessible from inside the container (i.e., under user_root_dir). Either:
Option A — Copy companion scripts to a location under user_root_dir:
Option B — If the user already has scripts at a known location, use those directly.
Run sbatch from the login node (or a node with SLURM client access):
Capture and report the job ID from the sbatch output.
You MUST actively poll the job until it completes. Do not submit and walk away.
Monitoring loop:
squeue -j <job_id> to check statePD (pending) — report the reason, keep polling every 30-60sR (running) — tail the build log every 30-60s; look for [XX%] Building, errors, or completionsqueue, it has finished — proceed to Step 5F (failed) — immediately read the full log and report the errorProgress indicators to look for in the log:
[XX%] Building CXX object... — compilation progressLinking CXX... — link phaseFAILED:, error:, fatal error: — build failureSuccessfully built — successOnce the job completes, check for success:
A successful build ends with a message like Successfully built tensorrt_llm or completes without error.
| Flag | Description |
|---|---|
-a "100-real" | Target architecture — 100 for Blackwell, 90 for Hopper, etc. |
--nvtx | Enable NVTX markers for profiling |
--no-venv | Skip virtual environment creation |
--use_ccache | Use ccache to speed up recompilation |
--skip_building_wheel | Build in-place without creating a wheel file |
-f | Fast build — skip some kernels for faster dev compilation |
-c | Clean build — wipe build directory before building |
Common architecture values:
"100-real" — Blackwell (B200, GB200)"90-real" — Hopper (H100, H200)"89-real" — Ada Lovelace (L40S)"80-real" — Ampere (A100)"90;100-real" — Multiple architectures| Issue | Solution |
|---|---|
sbatch: error: invalid partition | Verify partition name with sinfo -s |
sbatch: error: invalid account | Check available accounts with sacctmgr show assoc user=$USER |
| Container image not found | Verify the .sqsh path exists and is readable |
| Build OOM (out of memory) | Reduce parallelism with -j <N> flag to build_wheel.py |
srun: error: Unable to create step | The node may lack enroot/pyxis — check with cluster admin |
Job stuck in PD state | Check squeue -j <id> -o %R for the reason (e.g., resource limits, priority) |
enroot import fails with auth error | Check ~/.config/enroot/.credentials has the correct registry credentials |
enroot import produces empty/corrupt .sqsh | Re-run with --debug and check the SLURM log; verify the image URL has no https:// prefix |
| Weird compile issues | Retry with a clean build (-c flag) |
QOSGrpNodeLimit shown in NODELIST(REASON) | Not a blocker, just wait for the job to get scheduled |
User: "Compile TRT-LLM on the OCI cluster"
Agent actions:
sbatchsqueue until complete