borch

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.

Open the notebook → Empty JupyterLab →

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.

Open marimo → What it runs →

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

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.