/mila-tools:mila-run-jobs <interactive|batch>from mila-tools
Guides users through running jobs on the Mila cluster: interactive development with `mila code` (VSCode on a compute node) or batch jobs submitted via `sbatch`. Covers GPU requests, SLURM commands, and data staging.
Ships in mila-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill guides users through running jobs on the Mila cluster: either
interactive development sessions using mila code (VSCode on a compute
node), or batch jobs submitted with sbatch.
At the start of each response, use the Skill tool with skill: "mila-base" to
load and apply all shared policies before proceeding with the workflow below.
Interactive development: https://docs.mila.quebec/getting_started/my_first_job/
Batch training: https://docs.mila.quebec/getting_started/train_first_model/
Use the WebSearch tool with this query to find the current URLs of the pages above:
site:docs.mila.quebec "__skill-mila-run-jobs"
The query should return two pages (interactive and batch). Use those URLs in the WebFetch steps below. If the search returns no results, fall back to the hardcoded URLs in "Reference documentation".
Determine which mode the user needs:
mila code.sbatch. → Use sbatch.If unclear, ask: "Do you want to work interactively with VSCode on a compute node, or submit a batch job that runs on its own?"
mila code)ssh mila 'mkdir -p CODE/my_first_job'
mila code CODE/my_first_job --alloc --gres=gpu:1 --cpus-per-task=2 --mem=16G --time=01:00:00
Everything after --alloc is passed to Slurm. Adjust resources as needed.pyproject.toml and main.py in the project folder.uv run python main.py
mila code is running to end the session and release the allocation.Key points:
mila code requires milatools and a working SSH connection (see the
mila-connect-cluster skill).--gres=gpu:1, --mem, and --time for the actual workload.sbatch)From the local machine, create the project directory on the cluster:
ssh mila 'mkdir -p CODE/train_first_model'
Open a CPU node for editing (faster to allocate than a GPU node):
mila code CODE/train_first_model --alloc --cpus-per-task=2 --mem=16G --time=01:00:00
In VSCode, create three files: job.sh, pyproject.toml, and main.py.
job.sh does three things:
#SBATCH directives — request resources (GPU, CPUs, memory, time). Typical
values:
--ntasks=1, --cpus-per-task=4, --gpus-per-task=<type>:1.
Use --mem-per-gpu (not --mem) when requesting GPUs./network/datasets/ into
$SLURM_TMPDIR/data/ before training. Example:
mkdir -p $SLURM_TMPDIR/data
cp /network/datasets/cifar10/cifar-10-python.tar.gz $SLURM_TMPDIR/data/
Compute nodes read from $SLURM_TMPDIR much faster than from
network storage.srun uv run python main.py.Submit the job from the VSCode terminal:
sbatch job.sh
Monitor the job:
squeue --meslurm-<JOBID>.out for logs.ReqNodeNotAvail status: means no matching node is available
right now; the job waits in the queue automatically. If waiting
too long, resubmit requesting a different GPU type.Key points:
$SLURM_TMPDIR is fast local storage on the compute node, available
only during the job. Always stage datasets there before training.srun inside job.sh runs the command within the allocated resources./network/datasets/cifar10/.Common questions:
squeue --mescancel <JOBID>--gres=gpu:2 (or more) in the
mila code command or #SBATCH directive.mila code supports
Cursor and other compatible editors.$SLURM_TMPDIR?" — Fast local storage on the compute node,
unique to each job. Use it to stage datasets for fast I/O during training.slurm-<JOBID>.out in the project
directory once the job starts.For more complex job patterns (multi-GPU, distributed training, environment variables, partitions):
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mila-iqia/skills --plugin mila-tools7 skills in this plugin
/mila-account-setupUse this skill when the user asks about obtaining a Mila account, enabling cluster access, or setting up Multi-Factor Authentication (MFA). Trigger phrases include: "How do I get a Mila account", "I need a Mila account", "How do I get cluster access", "How do I set up MFA", "How do I enable MFA", "I received a registration token", "registration email", "registrationcode", "I got an email from IT", "MFA setup", "I can't log in to the MFA portal", "How do I add a TOTP", "What is my cluster username", "How long does cluster access take", "IT onboarding quiz", "mfa.mila.quebec"./mila-baseMila Base: Shared PoliciesThis skill is loaded by other mila-* skills via the Skill tool. Apply its/mila-connect-clusterUse this skill when the user asks about connecting to the Mila cluster via SSH, verifying the connection, entering an OTP, or troubleshooting connection failures. Trigger phrases include: "How do I connect to the cluster", "How do I SSH into the cluster", "ssh mila", "login.server.mila.quebec", "How do I verify my connection", "I can't connect", "connection refused", "permission denied", "host key verification failed", "OTP", "one-time password", "The login node banner does not appear", "Not prompted for OTP", "How do I install uv on the cluster", "I'm connected, what's next"./mila-local-setupUse this skill when the user asks about setting up their local machine to connect to the Mila cluster. Trigger phrases include: "How do I install WSL", "How do I install uv", "How do I install milatools", "What is milatools", "How do I configure milatools", "How do I set up my laptop for the cluster", "mila init", "uv tool install milatools", "curl uv install", "How do I install the mila CLI", "Windows setup for the cluster", "What tools do I need on my laptop", "SSH config", "SSH config setup", "authorized_keys"./mila-paperoniQuery and manage the Mila Paperoni publication database via its REST API at https://paperoni.mila.quebec. Use when the user wants to search for papers, look up an author's publications, filter by venue or date, add missing papers, populate a paper entry from an external link (arXiv, DOI, etc.), or claim papers to their Mila profile with their @mila.quebec email. Also use when the user asks about the Paperoni API, authentication/token setup, which identity a token belongs to, or how to submit a paper suggestion./mila-sarcFetch job, user, cluster and usage data over HTTP from the SARC API at sarc.mila.quebec. Use when asked about Mila/DRAC compute usage, slurm jobs, GPU/RGU utilization, waste, or Mila researchers — including first-person questions like "how many jobs did I run last week" or "how much GPU am I wasting".