Skip to content

Pin jax at 0.12.1, the shared baseline's new version - #665

Merged
mmcky merged 2 commits into
mainfrom
env-jax-0.12.1
Nov 19, 2026
Merged

mmcky merged 2 commits into
mainfrom
env-jax-0.12.1

Conversation

@mmcky

@mmcky mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What

This moves programming's jax from 0.11.0 to 0.12.1, the lecture baseline's new version (QuantEcon/lectures' _base/environment-update.yml). The baseline kept 0.11.0 because jax 0.11.1 hangs this series' numpy_vs_numba_vs_jax (its lax.fori_loop cells jit on the CPU; context in QuantEcon/workspace-lectures#49). A test build of this series on 0.12.1 ran those cells without a hang, so the owner chose to move the baseline, and every series, to 0.12.1.

File Change
cache.yml, ci.yml, publish.yml pip install "jax[cuda13]==0.11.0" becomes ==0.12.1; the comment above it says why it is pinned
numpy_vs_numba_vs_jax !pip install quantecon "jax==0.11.0" becomes "jax==0.12.1"

The workflows and the lecture move together. With the lecture's own line on the old version, a build would reinstall jax 0.11.0, without its CUDA plugin, partway through.

For readers on Colab, the lecture's install line now installs jax 0.12.1 in place of 0.11.0.

Validation

By the owner's rule for any software upgrade on a series, this merges only after a full validation of the site: fresh builds of main and of this branch, with every lecture executed, compared for new warnings, changed cell outputs and rendering. The evidence follows in a comment.

The test build that settled the question, on a temporary branch with the same jax pin and the same lecture line, is QuantEcon/lecture-python-programming run 44470126047. This branch differs from that test only in the workflows' comments, and in also pinning ci.yml and publish.yml.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

The lecture baseline (QuantEcon/lectures' _base/environment-update.yml)
moves jax from 0.11.0 to 0.12.1: 0.11.0 was kept because 0.11.1 hangs
numpy_vs_numba_vs_jax's lax.fori_loop cells, and a test build on 0.12.1
ran them without a hang. The three GPU workflows and the lecture's own
install line move together, so the lecture's cell stays satisfied.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Copilot AI balanced review requested due to automatic review settings November 19, 2026 06:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The three CPU workflows still pin JAX 0.11.0, so the lecture’s upgrade can make other lectures use different versions depending on execution order; update those pins and matching comments to 0.12.1.

1 open issue
What changed in this PR

Updates the programming lecture series to JAX 0.12.1 to match the shared lecture baseline, keeping the GPU build workflows and lecture installation cell aligned.

Changes:

  • Bumps JAX from 0.11.0 to 0.12.1 in cache, CI, and publishing workflows.
  • Updates the comparison lecture’s installation cell to the same version.
  • Revises workflow comments to explain the baseline pin and prior CPU-loop regression.
File Description
lectures/​numpy_vs_numba_vs_jax.md Pins the lecture’s JAX installation to 0.12.1.
.github/​workflows/​publish.yml Updates the publishing JAX pin and explanatory comments.
.github/​workflows/​ci.yml Updates the CI JAX pin and explanatory comments.
.github/​workflows/​cache.yml Updates the cache-build JAX pin and explanatory comments.

Review effort: Balanced

Comment thread lectures/numpy_vs_numba_vs_jax.md Resolved
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Copilot's review: the Linux, macOS and Windows execution checks still
installed jax[CPU]==0.11.0, so the lecture's 0.12.1 line would upgrade jax
partway through their builds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@mmcky

mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Full site validation: no new warnings and no regressions. jax 0.12.1 runs numpy_vs_numba_vs_jax without the slowdown that made 0.11.1 time out, on GPU and on Linux, macOS and Windows CPUs.

  • Fresh builds with no cache, every lecture executed (26 notebooks executed, 2 cached, GPU), both green: main at 6ddf088 on jax 0.11.0 (run 44472261695), and this PR at 53c29e5 on jax 0.12.1 (run 44472265772). The two builds share the same build stack and differ only in jax. The later commit, 5ff419f, changes only the CPU workflows below.

    • Execution took 214 s against main's 231 s. numpy_vs_numba_vs_jax took 9.1 s against 9.6 s. Its CPU lax.fori_loop cells, the ones 0.11.1 slowed, take the same time as on 0.11.0 and give the same results.
    • The earlier test build on a temporary branch, with the same jax pin and the same lecture line (run 44470126047), agrees.
  • CPU execution checks on this branch at 5ff419f, after Copilot's review moved their pins too, all on jax 0.12.1 and all green. Each check's warning lines are the same as in main's last scheduled run.

    Platform Run numpy_vs_numba_vs_jax Total execution Main's last scheduled run
    Linux 44475433967 4.8 s 142 s 4.9 s, 222 s
    macOS 44475437859 9.4 s 287 s 10.2 s, 290 s
    Windows 44475441846 5.9 s 160 s 7.9 s, 246 s
  • Logs and cell outputs: both GPU builds log the same warning lines: conda's setup notices, and no DeprecationWarning, FutureWarning or Sphinx warning. The warnings and tracebacks in cell outputs are the same on both sides, in the lectures that show them on purpose.

  • Page by page (31 pages): every page has the same counts of exercises, solutions, admonitions, figures, tables, math and cell outputs on both sides. The 16 pages that differ are exactly the 16 that differ between two builds of main on jax 0.11.0: Yahoo data, timings, object ids and download bars. On top of that noise, jax 0.12.1 changes two things:

    • the installed version printed by the install cells in autodiff, jax_intro and numpy_vs_numba_vs_jax;
    • autodiff's gradient-descent estimate, whose first coefficient goes from 0.0428 to 0.1179, with its fitted curve. It's the same on every build of a given jax version, and lecture-jax's copy of the lecture prints the same values.
  • Colab path (this series has no Colab check, so run locally with Colab's own versions, jax 0.11.1 included): numpy_vs_numba_vs_jax's install line upgraded jax and jaxlib to 0.12.1, and the lecture ran to the end without an error.

@mmcky
mmcky merged commit ad2be6a into main Nov 19, 2026
7 checks passed
@mmcky
mmcky deleted the env-jax-0.12.1 branch November 19, 2026 07:13
@mmcky

mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-python-programming.zh-cn
Translation PR: QuantEcon/lecture-python-programming.zh-cn#152
Files synced (1):

  • lectures/numpy_vs_numba_vs_jax.md

@mmcky

mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (fa)

Target repo: QuantEcon/lecture-python-programming.fa
Translation PR: QuantEcon/lecture-python-programming.fa#186
Files synced (1):

  • lectures/numpy_vs_numba_vs_jax.md

@mmcky

mmcky commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (fr)

Target repo: QuantEcon/lecture-python-programming.fr
Translation PR: QuantEcon/lecture-python-programming.fr#111
Files synced (1):

  • lectures/numpy_vs_numba_vs_jax.md

mmcky added a commit to QuantEcon/lectures that referenced this pull request Nov 19, 2026
…in (#76)

Moves the environment list's jax from 0.11.0 to 0.12.1, the newest
release, in _base/environment-update.yml and _base/README.md: 0.12.1
runs programming's numpy_vs_numba_vs_jax, which 0.11.1 hangs. Re-promotes
numpy_vs_numba_vs_jax from lecture-python-programming at bae31ee, so its
own install line names jax 0.12.1 and its ledger entry moves with it.

Content reviewed by a person: @mmcky, who reviewed and merged the same
line upstream (QuantEcon/lecture-python-programming#665) and answered
"Reviewed, merge" to this PR in the organiser session.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants