Repository navigation
site-build: jax joins the base environment on the GPU leg - #105
Conversation
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
Validation of
|
| 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-smitimestamps; - 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, andifp_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 ofifp_dl's 6, figure 4 ofopt_invest's 4 and ofopt_savings_2's 4, figure 2 ofoverborrowing's 2, andinventory_ssd's one figure.
- timings and
- Install cells. jax's lectures install
quantecon,kerasandoptaxin 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_jaxandoverborrowinglink their citations to different anchor numbers onzreferences, because the pool's merged bibliography numbers them differently, as on site-build: intermediate joins the base environment on the GPU leg #99. Onzreferencesone entry drops its month ("December 2011"): the pool's house style for the merged bibliography (tools/bib-merge). - The environment. The
statuspage'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, onlycffidiffers (2.1.0 against 2.1.1). Every package jax's lectures use is at the same version, jax 0.12.1 withjax[cuda13]among them. - Warnings and errors in outputs: the same on both sides.
ifp_egm_jaxprints 8 lines starting "Error at iteration", its solver's convergence messages rather than errors.jax_intro_jaxshows one traceback, from a cell taggedraises-exception, andstatusone 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.
There was a problem hiding this comment.
🟢 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: basefor 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)
|
I've read Copilot's review at
One thing the summary doesn't say: run 45902097421 at |
…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
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.ymlbuilds all six sites.What changes
sites/jax/site.ymlgainsenvironment: base. On the GPU leg that means_base/environment.ymlis created on the RunsOn machine,_base/environment-update.ymlis applied, andjax[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-jax3431f12(the pin) on 2026-11-27, are unchanged.site-build.yml:SITESgainsjax, and the header and the GPU leg's notes name it.cell_timeoutis 2400 seconds, so its limit is 40 + 150 = 190 minutes, against its own builds from an empty cache of 20 to 23 minutes (the tencache.ymlruns in November 2026 before this pull request; an earlier version of this description said eight).README.md,sites/README.md,_base/README.mdand the list's header say that, instead of listing the sites in each place. intermediate's build times now stay intools/site-matrixalone, with jax's added beside them;sites/README.mdpoints there.names, withline insite-build.yml's notes is rewrapped; andtools/site-matrix's AMI note says when it was last read.Checks before this pull request
tools/site-matrix,ami-0edec81935264b6d3, is still the one the three GPU series'.github/runs-on.ymlname (QuantEcon/lecture-jax, QuantEcon/lecture-python.myst and QuantEcon/lecture-python-programming), read 2026-11-27.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.tools/pool-check --installslists no install that would replace a pin. jax's lectures installquantecon,keras,optaxandjaxin 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.tools/site-matrixgives 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