Notebook
A notebook, nothing installed
JupyterLite in this tab, with pyborch already on its shelf. The kernel
is Python (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.
Open the notebook → Empty JupyterLab →
The two lines
%pip install pyborch
import borch_webgpu as torch
The same two lines work in any Pyodide — a JupyterLite you host, PyScript, marimo's wasm build — 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.
- Linux with an NVIDIA card needs two Chrome flags — the GPU page has them.
Measured by tests/browser/lab_probe.py, nightly: opening this
notebook and pressing Shift+Enter once, apple / metal-3 sees the learned line
6.3 s later, the wheel's install and borch.ts's boot included.