Notebook
Two notebooks, nothing installed
Python in this tab, with pyborch already on the shelf. The kernel is
Pyodide in a worker; import borch_webgpu as torch boots borch.ts on
this tab's GPU. No CUDA, no Python on the machine, no account. Two of them are
hosted here — JupyterLite for anything at all, and
marimo for one job already written.
Two notebooks
JupyterLite — an empty one
The notebook you already know, with nothing to set up. Cells run when you press Shift+Enter, in the order you press them. Use it to try something, to follow a lesson with your own numbers, or to keep a scratch file that survives a reload.
marimo — one job, already written
A reactive notebook: change a cell and only what depends on it
reruns, and a table or a button is a Python value rather than widget code. The
one hosted here is a review job end to end — put in a folder of images, it
trains on this tab's GPU, sorts the labels it doubts to the top, and hands back
an ONNX file. The images stay in the tab. It drives
torch.workbench, and that page is
where the recipe and its evidence are.
The two lines
%pip install pyborch
import borch_webgpu as torch
The same two lines work in any Pyodide — either notebook above, a JupyterLite you host, PyScript — because the wheel carries borch.ts inside it and brings the device up on import. What torch code has to change is on the Python page; it is short.
What a tab cannot do
- Memory is the tab's, a few GB. Datasets and pretrained weights are downloads, every time.
- Packages are Pyodide's: no CUDA family, and some C extensions are absent.
- A long training run holds the kernel. That is a notebook's shape too.
- marimo's kernel takes about ten seconds to come up (Pyodide and marimo download), and its cells do not run by themselves — press the run button at the bottom right.
- The last cell is a support report:
torch.report()gathers the adapter, validation faults, memory and versions with this run's facts intoreport.json, and says in words when something is off (a software rasteriser, a fault, a lost device). - The marimo one ships as one folder for a network that lets nothing out:
python3 site/build_bundle.pymirrors Pyodide, marimo's packages and the backbone beside the page (75 MB), and a check presses it with every outside request refused. - Linux with an NVIDIA card needs two Chrome flags — the GPU page has them.
Both are pressed nightly. tests/browser/lab_probe.py opens the
JupyterLite one and presses Shift+Enter once: on apple / metal-3 the learned line
is there 6.3 s later, the wheel's install and borch.ts's boot included.
tests/browser/marimo_probe.py opens the marimo one and waits for each
section to appear — and refuses the run outright if the tab has no GPU, so a number
from this page is never a CPU's number wearing a GPU's name.