- SCITAS Tutorial
- What is SCITAS
- Terminology
- How to create an account
- How to access to the cluster
- Running a job on the cluster
- House keeping
In CS-503 Visual Intelligence: Machines and Minds, we are going to use the Scientific IT and Application Support (SCITAS) [link] cluster for computation. It provides scientific computing resources and High Performance Computing (HPC) services to everyone at EPFL. Currently, it contains four clusters: Helvetios, Izar GPU, Izar GPU 4x, and Jed [link]. We will mainly use Izar for our GPU computation.
When you see locally or on your own computer, it means the command should be executed on your own computer, not the cluster.
When you see remotely or on the clusters, it means the command should be executed on the clusters (after logging in), not your own computer.
We use <username> to denote your username on the clusters. Please replace it with your actual username when you execute the commands.
No need to do it yourself. Once you have enrolled yourself in the course, an account will be created automatically for you that uses your EPFL Gaspar credentials. Your account will be associated with the CS503 project to use reserved GPUs or acquire high priority in job queues. Please reach out to the teaching staff via email (vimm-ta@groupes.epfl.ch) in case you face any difficulty in using your account.
To connect to the clusters, you have to be inside the EPFL network or establish a VPN connection [link].
You can access the clusters by using ssh on your own computer. The command is:
ssh -X <username>@izar.epfl.chThe volumes mentioned below are the folders existing on the clusters.
You have 100 GB quota in /home/<username> for storing important files such as codes. The files here are backed up every night and the storage is kept permanantly.
/scratch/<username> is used to store large datasets, checkpoints, etc. Files here are NOT backed up and the files older than two week can get deleted. Therefore, please only store files that you can afford to lose and reproduce easily here.
Sometimes, you need to upload data to the clusters or download data from the clusters [link]. On your own computer, you can use rsync [link] (recommended) and scp [link] if you prefer command line tools. If you prefer GUI applications, you can also use WinSCP on Windows or FileZilla on MacOS and Linux locally.
The SCITAS clusters use SLURM to manage jobs submitted. It is a commonly used job scheduling system for HPC clusters. You can find almost all the information you want to know about SLURM on its official documentation or by searching on Google.
For this project, use the same workflow as in NanoFM_Homeworks/README.md.
-
Install dependencies (once, on the cluster):
bash setup_env.sh
-
Run training in one of two ways:
-
Option 1: Interactive (
srun) for debugging:srun -t 120 -A cs-503 --qos=cs-503 --gres=gpu:2 --mem=16G --pty bash
Then on the compute node:
conda activate nanofm wandb login OMP_NUM_THREADS=1 torchrun --nproc_per_node=2 run_training.py --config cfgs/nanoGPT/tinystories_d8w512.yaml
For 1 GPU, use
--gres=gpu:1and--nproc_per_node=1. -
Option 2: Batch job (
sbatch) for longer runs:sbatch submit_job.sh <config_file> <your_wandb_key> <num_gpus>
Example:
sbatch submit_job.sh cfgs/nanoGPT/tinystories_d8w512.yaml abcdef1234567890 2
-
-
For multi-node training (Part 3), submit:
sbatch submit_job_multi_node_scitas.sh <config_file> <your_wandb_key>
Example:
sbatch submit_job_multi_node_scitas.sh cfgs/nano4M/multiclevr_d6-6w512.yaml abcdef1234567890
-
After submission, SLURM prints
Submitted batch job <job-id>. -
Cancel a job with:
scancel <job-id>
-
Check your jobs with:
squeue -u <username>
Sometimes you want to interactively debug or run notebooks on a GPU node (e.g., from VS Code or a local browser). This section shows two common workflows.
First create an interactive SLURM job using srun, for example:
srun -t 120 -A cs-503 --qos=cs-503 --gres=gpu:2 --mem=16G --pty bashYou should now be in the interactive SLURM job. Check hostname to confirm. It should return the name of the GPU node within the SCITAS Izar cluster that you are currently on, e.g.:
i30You can now directly run your Python scripts in the CLI using commands such as:
OMP_NUM_THREADS=1 torchrun --nproc_per_node=2 run_training.py --config cfgs/nanoGPT/tinystories_d8w512.yamlBut to run a Jupyter notebook interactively through something like VS Code, you need to be able to open a Remote-SSH session to the SLURM job, not just izar. The steps below show you how to achieve this.
On your local machine, first check that you have an SSH key (commands shown for macOS; Linux is similar):
ls -l ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pubIf it does not exist, create one:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519Copy your local (laptop's) public key onto the GPU node (replace <username> and i30):
cat ~/.ssh/id_ed25519.pub | ssh <username>@izar.epfl.ch 'ssh <username>@i30 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"'Make sure to replace <username> with your actual username that you use to access izar. In addition, replace i30 with the name of the GPU node that you are on (returned by hostname as explained above).
This command copies your public key, which is needed for SSH connections, onto your GPU node through izar.
From your local machine:
ssh -J <username>@izar.epfl.ch <username>@i30 hostnameThis should print the name of your GPU node again. Success!
Now add the following entry to ~/.ssh/config (just copy–paste the following snippet into the file), replacing <username> and i30:
Host izar
HostName izar.epfl.ch
User <username>
ForwardX11 yes
Host izar-gpu
HostName i30
User <username>
ProxyJump izarNow, you should be able to Remote-SSH into the SLURM job (GPU session), not just izar, using:
ssh izar-gpuon your terminal, or- VS Code's
Remote-SSH: Connect to Hostcommand and selectingizar-gpu.
This option uses a long-lived terminal session (e.g. with tmux) plus SSH port forwarding to access Jupyter from your local browser.
On the cluster (logged into izar):
module load tmux
tmux new -s jupyterYou are now inside a tmux session named jupyter.
Inside tmux, request a GPU node:
srun -t 120 -A cs-503 --qos=cs-503 --gres=gpu:1 --mem=16G --pty bashYou are now on a GPU node (again, check with hostname).
If you used the course setup script from NanoFM_Homeworks:
conda activate nanofmAlternatively, if you rely on your own environment, make sure it contains all needed packages and that your conda-related directories appear early in PATH.
From the GPU node, in the CS503 repository directory (adapt the path as needed):
cd /home/<username>/CS503/2026-spring/NanoFM_Homeworks
jupyter lab --no-browser --port=8888 --ip=$(hostname -i)The output should contain a line similar to:
http://10.91.27.4:8888/lab?token=<token>
Where:
<ip-address>is10.91.27.4in this example.<token>is the long token string at the end of the URL.
On your local machine, execute (replace <ip-address> and <username>):
ssh -L 8888:<ip-address>:8888 -l <username> izar.epfl.ch -f -NThis forwards the remote Jupyter port to localhost:8888 on your laptop.
On your local machine, open a web browser and enter:
http://127.0.0.1:8888/lab?token=<token>
Replace <token> with the token printed in the Jupyter server output. You should now see your Jupyter Lab session running on the GPU node.
You can keep the job running in the background by detaching from tmux with Ctrl+b d, and later reattach with:
tmux attach -t jupyterIn the CS-503 course, we have reserved GPUs that are only accessible to CS-503 students. For SCITAS commands and job scripts, use the CS-503 account and QoS.
#SBATCH --account=cs-503
#SBATCH --qos=cs-503Please be considerate to the other students when using the clusters.
We do not restrict the number of GPUs each group can use. You can use all available resources, but other groups will not be able to use it, i.e., no preemption.