Skip to content

Commit c2589a2

Browse files
mmckyclaude
andauthored
Pin jax in the numpy_vs_numba_vs_jax install cell (#621)
The workflow pin from #620 protects the build but not the reader. In CI the cell is a no-op because jax 0.11.0 is already installed, so pip treats the unpinned requirement as satisfied. In Colab nothing pre-satisfies it: a reader executing this notebook today resolves jax 0.11.1, then reaches the CPU-pinned lax.fori_loop and lax.scan cells at n = 10,000,000. jax 0.11.1 regresses XLA:CPU execution quadratically -- measured on linux x86_64, doubling n multiplies runtime by ~4.1 (fori) and ~4.0 (scan). At n=400,000 it is 105s against 0.005s under 0.11.0; extrapolated to the lecture's n=10,000,000 that is roughly 18 hours, which a reader experiences as a hang. Pinned to ==0.11.0 rather than !=0.11.1 deliberately: the regression is still present on jax main (nightly 0.11.2.dev20260819 measured at 96% of 0.11.1's time), so an exclusion would admit a likely-broken 0.11.2 without warning. This matches the exact version the six workflows install, so readers now run what CI runs. The other two jax cells in this repo are untouched: jax_intro.md loops to n=20 and autodiff.md has no lax loop, so neither reaches the regime. Lifting this pin is tracked alongside the workflow pins in QuantEcon/workspace-lectures#49. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 76a5879 commit c2589a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lectures/numpy_vs_numba_vs_jax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
4545
---
4646
tags: [hide-output]
4747
---
48-
!pip install quantecon jax
48+
!pip install quantecon "jax==0.11.0"
4949
```
5050

5151
```{include} _admonition/gpu.md

0 commit comments

Comments
 (0)