LooseLeaf

How LooseLeaf works

Each cell gets a GPU only while it runs, and only if it needs one. Between cells your notebook holds no GPU; its variables are kept and come back for the next cell, on whichever machine it runs.

GPU or CPU

LooseLeaf reads your notebook as you type and sends a cell that uses CUDA to a GPU, and anything else to a CPU. To choose yourself, right-click a cell, then Run on → GPU or CPU; the cell then shows “set by you”, and Run on → Automatically gives the choice back. A shell command (!nvidia-smi, !python train.py) runs on a CPU unless you choose GPU.

While a cell runs, a line under it says where: “Waiting for a GPU · #2” when every GPU is busy, then “Running on GPU”.

What persists

A notebook's variables live as long as its kernel. Closing the tab keeps them for 30 min with no page open and no cell running; restarting or shutting down the kernel, or a platform restart, ends them. Files in your home are permanent. Packages you pip install stay until the kernel shuts down; a restart keeps them.

Kept between cells, on any machinevariables, tensors, models (torch.compiled ones too), optimizers, NumPy arrays, DataFrames, plain DataLoaders
Not keptopen files, sockets and connections, background processes and servers, threads, iterators with worker processes running, compiled functions (@torch.compile), wandb runs

A cell that defines something that cannot be kept says so. It works while the same worker stays warm; a later cell on another worker fails with the reason, and running the defining cell again fixes it. So open files in the cell that uses them, start a server and use it in the cells right after, and train in chunks across cells. If a cell's worker crashes or goes past its memory limit, the cell says so; what earlier cells saved is kept.

Limits

The same for everyone
GPU time per cell2 h, with a warning 15 min before
Notebooks open at once2
Longest wait for a GPU10 min
A notebook with no open page and no cell runningshut down after 30 min
Saved variables per notebook32 GB
Home directory20 GB