Skip to content

site-build: jax joins the base environment on the GPU leg - #105

Merged
mmcky merged 1 commit into
mainfrom
site-build/jax
Nov 27, 2026
Merged

mmcky merged 1 commit into
mainfrom
site-build/jax

Conversation

@mmcky

@mmcky mmcky commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

The last step of the site builds in Matt's order of 2026-11-22 (intro, advanced, then the GPU sites: programming, intermediate and jax): jax builds from the pool on the GPU leg, in the base environment, as programming (#87) and intermediate (#99) do. With it, site-build.yml builds all six sites.

What changes

  • sites/jax/site.yml gains environment: base. On the GPU leg that means _base/environment.yml is created on the RunsOn machine, _base/environment-update.yml is applied, and jax[cuda13] is added at the list's jax version (0.12.1, the version jax's own workflows pin). Its other fields, re-read at lecture-jax 3431f12 (the pin) on 2026-11-27, are unchanged.
  • site-build.yml: SITES gains jax, and the header and the GPU leg's notes name it.
  • The time limit needs no change: jax's cell_timeout is 2400 seconds, so its limit is 40 + 150 = 190 minutes, against its own builds from an empty cache of 20 to 23 minutes (the ten cache.yml runs in November 2026 before this pull request; an earlier version of this description said eight).
  • The docs. With jax in, the base sites are every site but dp, so README.md, sites/README.md, _base/README.md and the list's header say that, instead of listing the sites in each place. intermediate's build times now stay in tools/site-matrix alone, with jax's added beside them; sites/README.md points there.
  • The organiser's nits on site-build: intermediate joins the base environment on the GPU leg #99, in the lines this edits anyway: the list's header names site-build: intermediate joins the base environment on the GPU leg #99 and this pull request; the stray names, with line in site-build.yml's notes is rewrapped; and tools/site-matrix's AMI note says when it was last read.

Checks before this pull request

  • The machine image. The AMI in tools/site-matrix, ami-0edec81935264b6d3, is still the one the three GPU series' .github/runs-on.yml name (QuantEcon/lecture-jax, QuantEcon/lecture-python.myst and QuantEcon/lecture-python-programming), read 2026-11-27.
  • The text. By the ledger, jax is the canonical source of 27 of the 28 pool lectures its table of contents lists. The other, autodiff (canonical in programming), has the same digest as jax's copy. So the site's lecture text is jax's own at its pin, 3431f12, which is lecture-jax's main.
  • The installs. tools/pool-check --installs lists no install that would replace a pin. jax's lectures install quantecon, keras, optax and jax in their cells, and all four are in the list. In jax's own builds those cells fetch the newest releases, so a version difference shows up in the comparison, not as a failure.
  • The cache. The list's header edit is a comment. Since environment: plotly-orca leaves the list; key the base cache on its entries; dp publishes notebooks #98 the base key hashes only the list's entries, so the other base sites restore their caches, as on site-build: intermediate joins the base environment on the GPU leg #99.
  • Locally: tests 330 passed and 1 skipped; pool-check clean; tools/site-matrix gives jax the GPU leg, the base environment and 190 minutes; actionlint clean.

Validation (to follow, in a comment)

This pull request's jax leg builds from an empty cache. It will be compared page by page with two fresh builds of jax's own site at 3431f12, dispatched today: QuantEcon/lecture-jax 45901655935, and a second for the noise baseline, QuantEcon/lecture-jax 45901668136. The comparison covers log warnings, cell-output warnings and errors, in-cell installs and every page with its figures. It adds a per-page GPU check: every lecture that uses jax ran it on the GPU, as in jax's own builds, with no fallback to the CPU.

Copilot: not requested (Matt, 2026-11-22).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG

The last step of the site builds in Matt's order of 2026-11-22 (intro,
advanced, then the GPU sites: programming, intermediate and jax): jax
builds from the pool on the GPU leg, in the base environment, as
programming and intermediate do. site-build.yml now builds all six sites.

- sites/jax/site.yml gains `environment: base`; its other fields re-read
  at lecture-jax 3431f12 (the pin) on 2026-11-27, unchanged.
- site-build.yml: SITES gains jax; the header and the GPU leg's notes
  name it.
- With jax, the base sites are every site but dp, so the docs say that
  instead of listing them in each place; intermediate's build times stay in
  tools/site-matrix alone, with jax's (20 to 23 minutes) beside them.
- The organiser's nits on #99: the list's header names
  #99; the stray "names, with" line in site-build.yml's notes is rewrapped;
  tools/site-matrix's AMI note says when it was last read (2026-11-27).

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

mmcky commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation of be0e47b: jax from the pool matches jax's own build

The build. site-build 45902097421's jax leg passed in 20 min 37 s from an empty cache, against 20 to 23 minutes for jax's own builds. It built strict (-n -W --keep-going) on the GPU leg in the base environment. All 32 pages are ok and none failed: 30 executed, plus the 2 pages with no code (troubleshooting, zreferences), which the execution cache matches to an empty page it already holds. It made 33 notebooks, one for each page the table of contents lists, and each page's "Download Notebook" link points at its notebook.

What it was compared with. Two fresh builds of jax's own site at its pin 3431f12 (lecture-jax's main), dispatched today on the same machine image: QuantEcon/lecture-jax 45901655935, and QuantEcon/lecture-jax 45901668136 for the noise between two runs of the same build. Every page and figure was compared, with log warnings, warnings and errors in cell outputs, and in-cell installs.

Comparison Pages that differ (of 50)
jax's own build against its own second build (noise) 22
the pool's jax site against jax's own build 23: the same 22, and zreferences
  • No prose differs on any page except zreferences. Every other difference is in cell output, on the 22 pages that also differ between jax's own two builds:
    • timings and nvidia-smi timestamps;
    • object ids, and small numerical differences of the size jax's own builds show between runs. For example, wealth_dynamics_jax's 0.768 against 0.765, and ifp_dl's −42.9578 against −42.9579; jax's own two builds differ by the same amounts.
    • the same figures that differ between jax's own builds: figure 8 of arellano_jax's 8, figures 5 and 6 of ifp_dl's 6, figure 4 of opt_invest's 4 and of opt_savings_2's 4, figure 2 of overborrowing's 2, and inventory_ssd's one figure.
  • Install cells. jax's lectures install quantecon, keras and optax in their cells. In jax's own build pip downloads them; in the pool's the environment already has them, at the same versions (quantecon 0.13.1, keras 3.15.1, optax 0.2.9), so the cell prints "Requirement already satisfied".
  • The bibliography. arellano_jax, lucas_model_jax and overborrowing link their citations to different anchor numbers on zreferences, because the pool's merged bibliography numbers them differently, as on site-build: intermediate joins the base environment on the GPU leg #99. On zreferences one entry drops its month ("December 2011"): the pool's house style for the merged bibliography (tools/bib-merge).
  • The environment. The status page's package list differs as expected. The pool's environment has the packages the one list adds for other sites' lectures (arviz, cvxpy, pymc and so on). Of the packages both environments have, only cffi differs (2.1.0 against 2.1.1). Every package jax's lectures use is at the same version, jax 0.12.1 with jax[cuda13] among them.
  • Warnings and errors in outputs: the same on both sides. ifp_egm_jax prints 8 lines starting "Error at iteration", its solver's convergence messages rather than errors. jax_intro_jax shows one traceback, from a cell tagged raises-exception, and status one RuntimeWarning.
  • Log warnings. Neither build logs a Sphinx warning. The pool's job log also has Node deprecation notices from the actions' JavaScript and lines of build-lectures' own script, as on site-build: intermediate joins the base environment on the GPU leg #99.

The GPU, page by page. No page of the three builds shows jax's CPU-fallback warning or a CUDA error, and each status page reports a Tesla T4. The 26 pages that import jax ran in 0.96 to 1.05 times the time they took in jax's own builds; a page that fell back to the CPU would take many times longer.

The other legs. dp, intro, advanced and programming passed with their caches restored. intermediate's leg is building from an empty cache, because main's build after #99 (site-build 45900647305) has not yet saved intermediate's first cache. This pull request changes nothing intermediate builds, so that leg runs cold only because of when it started. The run finishes when it does, in about two hours.

Conclusion. jax builds from the pool on the GPU leg, strict, in the base environment, with every page ok and every jax page on the GPU. The site matches jax's own build, except for the merged bibliography, the pool's environment and noise of the kinds jax's own builds show between runs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block adding jax to the shared GPU build path.

No open issues 🎉

What changed in this PR

Adds jax to the existing GPU build path using the shared base environment, completing site-build coverage for all six sites. dp remains on its series environment.

Changes:

  • Enables environment: base for jax and adds it to the workflow’s site list.
  • Updates documentation to reflect all six builds and five base-environment sites.
  • Records jax build timings and refreshes the AMI verification date in comments; timeout logic and package entries remain unchanged.
File Description
tools/​site-matrix Updates comments with jax build times and the AMI verification date.
sites/​README.md Documents complete site coverage and centralizes timing references.
sites/​jax/​site.yml Selects the shared base environment for jax.
README.md Reflects all six builds and jax’s GPU environment.
.github/​workflows/​site-build.yml Adds jax to SITES and updates build notes.
_base/​README.md Documents base-environment use by every site except dp.
_base/​environment-update.yml Updates header comments to include jax without changing dependencies.

Review effort: Balanced (adaptive)

@mmcky

mmcky commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

I've read Copilot's review at be0e47b ("Approval recommended", no open issues, no inline threads), and checked its summary against the diff from fb579c7. It is right on each point.

  • What changes in a build: two lines. sites/jax/site.yml gains environment: base, and site-build.yml's SITES gains jax. Every other change is a comment, a docstring or documentation.
  • All six builds, five on the base environment: the base environment is now used by intro, advanced, programming, intermediate and jax. dp stays on its series' environment. jax runs on the GPU leg beside programming and intermediate.
  • Timeouts and packages: unchanged. tools/site-matrix changes only in its docstring, which gains jax's build times from an empty cache (20 to 23 minutes) and the date the AMI was last read. _base/environment-update.yml changes only in its header comment, which adds jax to the sites that use it. No package entry changes. jax's limit stays 40 + 150 = 190 minutes.

One thing the summary doesn't say: run 45902097421 at be0e47b is green on every leg (jax 20m37s and intermediate 2h19m, both from an empty cache). The comparison with jax's own builds is in #105 (comment). Nothing to change, so the head stays at be0e47b.

@mmcky
mmcky merged commit 63d02d6 into main Nov 27, 2026
13 checks passed
@mmcky
mmcky deleted the site-build/jax branch November 27, 2026 00:59
mmcky added a commit that referenced this pull request Nov 27, 2026
…at _pdf/ (#106)

## Why

The rest of QuantEcon/project-monorepo#77 starts with the PDF. Five of the six sites publish one (`publishes: [html, pdf, notebooks]` in `site.yml`: intro, advanced, programming, intermediate and jax; dp publishes none). Their series build it and serve it at `_pdf/`, where the theme's "Book (PDF)" link points. Until now the site build made the HTML and the notebooks only.

## What it adds

- **The PDF, strict, from the cache.** For a site whose `site.yml` publishes `pdf`, a step after the notebooks runs `build-lectures` with the `pdflatex` builder and `-W --keep-going`. `build-lectures` adds `-n`, so the build matches the HTML's `-n -W`. It reads the cache the HTML build filled, so it executes nothing. A failed build uploads its reports as `execution-reports-<key>-pdf`. LaTeX comes with the full image and with the GPU machine image, which the GPU series' own PDF builds use.
- **Served at `_pdf/`.** quantecon-book-theme shows the "Book (PDF)" link only when `_build/html/_pdf/` is a folder as it renders the pages. The series build the PDF first and copy it in. Here, as for the notebooks, the folder is made before the HTML build, so the HTML build stays the one that executes the pages. The PDF is then copied in, as the series copy theirs (`cp _build/latex/*.pdf _build/html/_pdf/`).
- **ImageMagick** (`38c4d3a`). Jupyter Book's PDF build turns on `sphinx.ext.imgconverter`, which needs `convert` for an image LaTeX can't take, an SVG or a GIF. Three jax pages have a remote SVG logo that MyST's `html_image` makes an image of, so jax's strict PDF failed without it in the first run. Every leg that builds a PDF now installs ImageMagick, as lecture-jax's workflows do, unless `convert` is already there: as root in a container, and with `sudo` on the GPU machine. It takes 6 to 22 seconds.
- **Checked.** The copy step fails when the build wrote no PDF, when no page links to one under `/_pdf/` (the theme didn't see the folder), or when a page links to a PDF the build didn't make. The theme names the link after `latex_documents`' `targetname`. The HTML artefact then carries the PDF with the pages.
- **Docs:** the workflow's header (a step 9, and the PDF leaves "what it does not do"), `README.md`'s build paragraph, and `sites/README.md`'s `publishes` row and strictness note.
- **One line from the review of #105:** `sites/jax/site.yml`'s Sources line now leads with the pin it was last read at (3431f12, 2026-11-27).

## Checked

- **The build** (run [45923688718](https://github.com/QuantEcon/lectures/actions/runs/45923688718) at `38c4d3a`, green on every leg). Each PDF step read the cache and executed nothing. The steps took 71 s for jax, 102 s intro, 110 s programming, 182 s advanced and 631 s intermediate. intro's and advanced's PDFs build strict (`-n -W`), although their series build theirs with `-n` alone. Every content page links to the one PDF its site made; the only pages without the link are `index.html`, `index_toc.html` and the redirect pages.
- **Against each series' own PDF** (the evidence comment: #106 (comment)). Page counts are identical (995, 1906, 446, 3906, 403), and so are the outlines. Each section's text was compared with digits removed, and every word change falls into a class. Those are: upstream changes since the series' last publish, checked against the upstream diffs; the pool's bibliography rulings; one pool asset path; link texts taken from another site's current titles; execution output (dates, draws, a live API search, environment paths); and layout.
- tools/tests give 330 passed and 1 skipped; actionlint and pool-check are clean.

**Not compared:** the figures, which are images in the PDF and were validated through the HTML in each site's own PR.

Copilot: not requested (Matt, 2026-11-22).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
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