Hi all.
PyMC installs on standard Pyodide (the Python that JupyterLite and marimo run in the page),
but there PyTensor has no C compiler, so every logp and gradient runs on the Python linker.
On a logistic regression with 3,020 observations that is about one effective draw per second.
To see whether this could be made faster, I started a personal project, pymcwasm.
It lowers the logp graph to a WebAssembly module instead. For now it is a separate package, not affiliated with PyMC.
It can be used two ways: as a PyTensor linker, pm.sample(compile_kwargs={"mode": "WASM"}), with PyMC’s own NUTS and no change to the model; or with pymcwasm.sample, which also runs nuts-rs inside the module.
Notebook that installs PyMC and samples in your browser: https://habakan.github.io/pymcwasm/lite/
Write-up with benchmarks and limits: PyMC in the browser, compiled to wasm — habakan blog
Code: GitHub - habakan/pymcwasm: Sample a PyMC model in a browser: its log density compiled to WebAssembly, drawn by nuts-rs, with no Python sampler. · GitHub
On nine posteriordb models, mode="WASM" gets 10 to 100 times the Python linker’s ESS/s in the page.
pymcwasm.sample keeps up with PyMC’s NUTS on CPython up to about 100 parameters, and is well behind nutpie, more so on large data.
Of the 83 posteriordb posteriors with a PyMC implementation, 79 match PyMC’s logp and gradient; the other four use ops I haven’t covered.
PyMC Labs’ nuts-rs-wasm is working on in-browser sampling too, and already runs a marketing-mix model in the page, using Numba in a Xeus / Emscripten environment.
pymcwasm works within the stock Pyodide instead, so the two cover different setups, and I’d be glad to compare notes.
If you teach with JupyterLite or marimo, or want a model on a page without a server, I’d like to hear
whether this is useful and where it breaks.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | 🚀 Release v6.3.2 | 0 | 18.52 | 08-09-2026 |
| 2 | Proposal / feedback: topology-aware posterior predictive and simulator summaries | 0 | 11.43 | 04-10-2026 |
| 3 | 🚀 Release pymc-extras v0.15.1 | 0 | 19.63 | 16-09-2026 |
| 4 | New contributor looking for guidance: from issue fixes to sustained PyMC contributions | 0 | 10.39 | 12-09-2026 |
| 5 | Contributions to State-Space Models & Project Ideas for PyMC-Extras | 0 | 14.13 | 14-09-2026 |
| 6 | Introduction & GSoC 2027 Interest — PR #8434 (CAR distribution batch support) | 0 | 10.65 | 16-09-2026 |
| 7 | Bug in nutpie+numba: memory needed for LogNormal compilation scales superlinearly | 0 | 10 | 17-08-2026 |
| 8 | Bambi, Count data and thresholds | 0 | 12.8 | 24-09-2026 |
| 9 | Setting and justifying priors for a discrete "what went wrong" model when I have no labeled data | 0 | 11.32 | 03-09-2026 |
| 10 | Save and Load a BART model | 0 | 12.34 | 28-09-2026 |