Skip to content

Whole lectures, as used: every JAX lecture on an Apple CPU, a Turing GPU and an x86 CPU #4

Open

Description

@mmcky

Run every JAX lecture as a reader or a CI build runs it, on an Apple CPU, a Turing GPU and an x86 CPU, and record where each lecture's time goes. The aim is to know which lectures run faster on a CPU than on the GPU they are built on, and why.

Why

Lectures

  • All 29 lectures in lecture-jax, at a fixed commit. That is every lecture except intro, status, troubleshooting and zreferences.
  • The JAX lectures in lecture-python.myst, sargent_surico among them.
  • Each runs as written. The 13 float64 lectures also run in float32, where the lecture tolerates it (aiyagari_jax does, slowly; see Lectures run as used: aiyagari_jax and ifp_egm_jax in float32 and float64 #3).

Platforms

Device Where When
M6, 12 cores, 32 GB (CPU) qe-mini1, with its agents paused First
TITAN RTX, one card qe-wharton1-gpu, card 0b:00.0 First
Threadripper 2990WX (CPU) qe-wharton1-gpu First
M5 Pro, 64 GB (CPU) qe-wharton2 Once it is onboarded in infrastructure
T4 and its host CPU RunsOn g4dn.2xlarge, the lectures' CI instance Once RunsOn is configured for this repository

Method

  • lectures/run_lecture.py: every code cell in one fresh process, compile counted, timed per cell. Three runs per configuration.
  • One environment per platform, pinned to precision/constraints.txt's JAX release. Each lecture's imports are installed beforehand, and the runner skips !pip install cells.
  • Outputs are kept for a cross-device check. Each lecture's key results are recorded with --record, so that a device or precision that changes the answer is flagged.
  • Results go to lectures/results/<host>/<date>/<lecture>/. The dashboard (QuantEcon/project-benchmarks-jax) gets a per-lecture view.

Relation to meta#289

meta#289 tracks lecture build times over releases, on one platform. This is one point in time, across platforms. run_lecture.py's per-cell timings may serve meta#289's tool question.

What the results would change

If Then
Most lectures run as fast or faster on a recent Mac CPU The lectures can say so, and CI can run them on CPU instances. That is meta#350's question 1
A lecture's time sits in a few cells Those cells are candidates for restructuring, which qe:benchmark can assess one lecture at a time
A lecture runs much faster on the GPU It keeps the GPU, and the table says by how much

Deliverables

  • the per-lecture results, under lectures/results/;
  • a table of every lecture by device, with the cells that dominate;
  • a summary comment on meta#350.

🤖 Generated with Claude Code

Activity

  1. mmcky commented on Oct 25, 2026

    @mmcky
    ContributorAuthor

    The T4 leg is running (2026-10-25), on RunsOn's g4dn.2xlarge: the lecture-jax set, three runs on the T4 and three on its host Xeon, with the TITAN RTX run's exact packages. It's run 40181233548, from the job in #10. It started at 20:35 AEDT and should take about 3.5 hours, about USD 2.50. The job stops at five hours.

    To pick it up:

    1. gh run download 40181233548 -R QuantEcon/benchmarks -D <directory> fetches lectures/results/runson-g4dn.2xlarge/<date>/whole/: each run's JSON, lectures-set.log, environment.txt, and any non-empty .err.
    2. Run lectures/whole/summarise_whole.py over it with lectures/results/*/2026-10-25/whole, to put the T4 and the Xeon beside the TITAN RTX, the Threadripper and the M6.
    3. Commit the results in a PR, add the T4 to the table in lectures/whole/README.md, and check the privacy scan first, as for Whole lectures as used: lecture-jax on the TITAN RTX, the Threadripper and the M6 #8.
    4. Then write the finding in QuantEcon/project-benchmarks-jax, and post the summary comment on meta#350 for its question 1. The dashboard picks up the new host by itself.
  2. added 3 commits that reference this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions