Skip to content

profiling(point_source): static-lattice A/B, RAL CPU + A100 rows, campaign phase 3 (PyAutoArray#568) - #305

Merged
Jammy2211 merged 6 commits into
mainfrom
feature/point-source-cpu-p3
Sep 24, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
feature/point-source-cpu-p3

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Profiling evidence for point-source CPU campaign phase 3 (PyAutoArray#568; phase 4 remains): precompute the JAX PointSolver's static step-0 lattice, deflecting the 11 859 geometrically unique vertices instead of the 69 849 flat slots (46 516 vs 276 507 on the cluster). A four-route in-process A/B cell — control (flat, 69 849), exact (28 665 exact-float unique), lattice (11 859, cell-built) and library (the linked library branches, self-labelled from the traced step-0 row count) — with fresh closures + jax.clear_caches(), 20 rounds × 20 calls, a separate-process constant-folding cell, thread/affinity and memory provenance. Decision: ACCEPT.

Measured speed-up (control = flat step-0 table → library = this change; median ms per likelihood call, 20 rounds × 20 calls, bootstrap 90 % CI)

RAL CPU job 350636 (ral, pinned Xeon Platinum 8490H, 8 CPUs, fp64) — constant folding off (PyAutoNerves default):

Row control ms library ms control / library [90 % CI] MDI compile s ctrl → lib FLOPs ctrl → lib
simple_solved 3.540 1.758 2.01× [1.63, 2.09] 34.7 % 2.91 → 3.14 (+8.0 %) 7.05M → 3.38M
simple_solved_vmap4 (per batch) 8.258 5.784 1.43× [1.42, 1.44] 26.7 % 3.39 → 3.71 (+9.5 %) 23.30M → 11.83M
simple_plain 3.479 1.669 2.08× [1.91, 2.13] 36.0 % 2.58 → 2.67 (+3.3 %) 7.05M → 3.38M
cluster_solved (2 sources, 13 components) 47.36 9.085 5.21× [5.10, 5.30] 39.1 % 22.77 → 24.66 (+8.3 %) 139.44M → 39.47M
cluster_plain 47.60 9.225 5.16× [5.04, 5.26] 27.0 % 16.69 → 18.72 (+12.2 %) 139.43M → 39.46M

RAL CPU job 350636 — constant folding on (--constant-folding, HLO probe confirms folding ran):

Row control ms library ms control / library [90 % CI] MDI compile s ctrl → lib FLOPs ctrl → lib
simple_solved 4.093 1.722 2.38× [2.08, 2.45] 42.9 % 2.85 → 2.91 (+1.9 %) 6.79M → 3.10M
simple_solved_vmap4 (per batch) 7.632 5.499 1.39× [1.31, 1.63] 44.6 % 3.22 → 3.43 (+6.4 %) 23.02M → 11.53M
simple_plain 3.564 1.696 2.10× [1.99, 2.25] 49.5 % 2.44 → 2.57 (+5.2 %) 6.79M → 3.10M
cluster_solved 39.03 8.599 4.54× [4.39, 4.64] 37.4 % 21.93 → 24.14 (+10.1 %) 131.39M → 30.34M
cluster_plain 32.34 8.273 3.91× [3.83, 3.99] 31.1 % 16.28 → 18.97 (+16.5 %) 131.38M → 30.33M

RAL A100 job 350637 (A100 80GB PCIe, fp64, folding off):

Row control ms library ms control / library [90 % CI] MDI compile s ctrl → lib FLOPs ctrl → lib
simple_solved 0.8463 0.8418 1.01× [1.00, 1.01] 5.3 % 5.28 → 5.57 (+5.4 %) 6.60M → 3.07M
simple_solved_vmap4 (per batch) 0.9421 0.9251 1.02× [1.02, 1.02] 4.5 % 6.28 → 6.19 (−1.5 %) 21.98M → 10.82M
simple_plain 0.8244 0.8184 1.01× [1.00, 1.01] 7.0 % 5.19 → 5.10 (−1.6 %) 6.60M → 3.07M
cluster_solved 2.696 2.515 1.07× [1.06, 1.09] 9.2 % 43.13 → 48.84 (+13.2 %) 120.38M → 34.59M
cluster_plain 2.073 1.991 1.04× [1.04, 1.05] 11.8 % 36.11 → 38.76 (+7.4 %) 120.37M → 34.57M

Read from results/breakdown/point_source/static_lattice_ab_{hpc_ral_cpu,constant_folding_hpc_ral_cpu,hpc_ral_a100}_fp64.json (autolens_profiling). Every JSON: source_revisions PyAutoArray ad0bf97b, PyAutoLens b346b6a0 (imported from RAL branch clones), library_matches: lattice, all_gates_pass: true. XLA temp memory falls 4.82 → 1.69 MB (simple) and 91.6 → 22.6 MB (cluster) on CPU, 3.36 → 0.39 / 42.1 → 6.35 MB on the A100.

Gates

  • A/B correctness: 31 / 31 gates pass in all three JSONs with max |Δ| = 0 — log-likelihood bit-identical on every row, route and 16-instance stream (fiducial simple solved 7.743201200876812, unchanged since phase 1); solved positions and image counts identical (simple 4, cluster 3 + 3); jax.grad finite, non-zero and bit-identical; vmap-4 equals scalar; step-0 containing_indices sets identical. The plan's gate was the tolerance gate (logL ≤ 1e-12 rel, positions ≤ 1e-10); the A/B met it at Δ = 0.
  • Tie case pinned — a source placed bit-exactly on traced step-0 vertex (−0.8, −1.99185843) of a simple SIE: the flat control returns 3 images (a duplicate of the vertex root), the static lattice exactly the 2 true images. Human decision 2026-09-24: PASS, pinned as PyAutoLens test__source_on_a_step_0_vertex_returns_the_two_true_images.

Caveats

  • Compile figures are a single cold compile per route, not a median; differences of a few percent are not resolved. Worst: +12.2 % (folding off), +16.5 % (folding on), +13.2 % (A100) — all under the +20 % stop rule.
  • The CPU job ran on a Xeon 8490H node (the phase-1 host); phase 2 ran on EPYC 7763. Only in-job ratios compare across phases.
  • vmap-4 gains 1.43×, below 2× MDI on its own; the change is accepted via the cluster clause of the stop rule (reject only if the simple gain < max(5 %, 2× MDI) with no cluster gain — cluster gains 5.21× against 2× MDI = 78 %).
  • MDI is 27–50 % on this node (per-call dispersion across the parameter stream, not uncertainty of the median; the ratio CIs are a few percent wide).
  • GPU gain is only 1–7 %: the A100 call is launch/latency-bound, not FLOP-bound. No regression.
  • PyAutoLens gains a guarded JAX unit-test file (test_static_lattice_jax.py, ~85–100 s, skipped without jax), departing from its no-JAX-in-unit-tests convention.

Scripts Changed

  • scripts/point_source/likelihood_breakdown/static_lattice_ab.py — new four-route static-lattice A/B cell (31 correctness gates, FLOPs, memory_analysis, RSS, compile/lower/first-call, table build and cache-hit time, --constant-folding mode with an HLO probe)
  • hpc/batch_cpu/submit_breakdown_point_source_static_lattice_ab_ral_cpu_fp64 — RAL ral CPU submit, pinned --nodelist, folding off then on in one job
  • hpc/batch_gpu/submit_breakdown_point_source_static_lattice_ab_a100_fp64 — RAL A100 fp64 submit
  • results/breakdown/point_source/static_lattice_ab_{laptop_cpu,constant_folding_laptop_cpu,hpc_ral_cpu,constant_folding_hpc_ral_cpu,hpc_ral_a100}_fp64.{json,png} — laptop witness (not quotable) and RAL rows
  • results/notes/point_source_cpu_2026_09_24_ral_job_350636_static_lattice_ab.out, ..._350637_static_lattice_ab_a100.out — job logs
  • results/notes/point_source_cpu_campaign.md — phase-3 section (mechanism, A/B, gates, tie case PASSED by human decision 2026-09-24, decision, phase-4 re-rank)
  • README.md — dashboard line

Upstream PR

Test Plan

  • scripts/misc/tooling/build_readme.py --check passes
  • scripts/misc/wall/check_submits.py --check passes (11 wall-basis submits, 0 failing)
  • RAL CPU job 350636 and A100 job 350637 COMPLETED; all_gates_pass: true, library_matches: lattice in all three JSONs
  • CI green (profiling lint checks out the library mains, so the library route is only exercised once the library PRs merge)

Part of PyAutoLabs/PyAutoArray#568 (phase 4 remains).

Heart RED development override

Shipped under the AUTONOMY.md "Human override for Heart RED (development only)".

  • Authorization (live human, 2026-09-24, this session), faithfully quoted: asked "When ingestion finishes, how should I ship? Heart is RED…", with the options "Ship with RED override (Recommended): Authorize the development-only Heart RED override for PyAutoArray#568 phase 3…" or hold, the human selected "Ship with RED override (Recommended)".
  • Scope: commit, push and open the pending-release PRs (PyAutoArray, PyAutoLens, then autolens_profiling). No merge, no release. Merge needs its own human /prm with every required check green.
  • Exact current Heart RED reasons (pyauto-heart readiness, re-read immediately before opening these PRs, verdict RED, score 45):
    • release validation FAILED (stage integrate)
    • workspace validation not passing (4 failed, cloud#35579888156: autolens notebooks/cluster/modeling.ipynb, autolens notebooks/weak/a2744.ipynb, autolens scripts/cluster/modeling.py, +1 more)
    • manifest drift: hub organism blurb (organs present) — 7 mismatch(es) vs PyAutoMind/repos.yaml
  • Passed branch gates: pytest test_autoarray 1645 passed at ad0bf97b; pytest test_autolens 756 passed, 1 xfailed at 972d454e (both re-run at ship); the step-0 shape guard (11 859 traced rows) is red on main (69 849) and green on the branch; autolens_workspace_test point-source jax_likelihood ×4 and jax_grad/gradient.py output identical to main (no rtol-1e-4 pin moved); A/B 31 / 31 gates bit-identical on RAL CPU job 350636 (folding off and on) and A100 job 350637; tie case pinned as a test; profiling build_readme.py --check and check_submits.py --check pass.
  • This branch does not fix Heart. Heart stays RED for release purposes.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Jammy2211 and others added 6 commits September 24, 2026 14:03
…0 submits (PyAutoArray#568 phase 3)

scripts/point_source/likelihood_breakdown/static_lattice_ab.py: interleaved
in-process A/B of AbstractSolver._initial_triangles with four routes --
control (flat 3N table, 69 849 rows), exact (28 665 exact-float rows),
lattice (11 859 geometric vertices), library (self-labels from the traced
step-0 deflection row count). Fresh closures + jax.clear_caches(); 20 x 20
default protocol; records FLOPs, memory_analysis, RSS delta, compile/lower/
first-call, table build + cache-hit time, observed XLA thread count and
affinity. Tolerance gates (log L rel 1e-12, image counts + positions 1e-10,
non-zero grad, vmap, step-0 containing sets). --constant-folding re-enables
folding in a separate process via a dummy pass name and refuses (CPU) unless
an HLO probe confirms folding ran.

Submits: RAL CPU pinned to euclid-ral-compute-1 (phase-2 EPYC host), folding
off + on, branch clones of PyAutoArray/PyAutoLens with import-origin refusal;
A100 regression leg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-compute-10-2 (compute-1..19 not responding)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… off/on) + campaign note section + README line

Laptop, load-inflated, not quotable: simple 1.9x, cluster 2.7x (folding on
2.0x / 2.1x), library_matches=lattice, 31/31 gates bit-identical. Compile
effect unresolved on the laptop; RAL CPU (pinned) and A100 legs pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…U, 350637 A100) — ACCEPT

Pull the RAL JSONs/PNGs (CPU folding off + on, A100) and both job logs.
All three JSONs import PyAutoArray ad0bf97b / PyAutoLens b346b6a0 from the
branch clones, self-label library_matches=lattice, 31/31 gates bit-identical.

CPU (Xeon 8490H, folding off) control -> library: simple solved 3.540 -> 1.758 ms
(2.01x), vmap-4 1.43x, plain 2.08x, cluster 5.21x / 5.16x; compile +3..+12 %;
XLA temp 4.82 -> 1.69 MB / 91.6 -> 22.6 MB. Folding on: 1.39-4.54x, worst compile
+16.5 %. A100: 1.01-1.07x, compile -2..+13 %, no regression.

Campaign note phase-3 section: RAL tables, gates, tie-case gate decision
pending at ship, stop-rule verdict, phase-4 re-rank from FLOP shares.
README phase-3 bullet updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…9-24, pinned as a PyAutoLens test

The source-on-step-0-vertex tie (control 3 images incl. a duplicate root vs
lattice 2) is accepted as duplicate removal and pinned as
test__source_on_a_step_0_vertex_returns_the_two_true_images (PyAutoLens
feature/point-source-cpu-p3 972d454e). README compile figures made exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-> 29)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant