Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This repository is the single home for PyAutoLens performance measurement. It ex
**What is profiled:**

- **Likelihood functions** — imaging, interferometer, point-source, and datacube paths, across the MGE, pixelization, and Delaunay model compositions used in real science cases.
- **Mesh kernels** — full mapper-table profiling for Delaunay and Sibson natural-neighbour `DelaunayNN`, including static-cap scaling and split regularization.
- **Simulators** — run-time tracking for the imaging, interferometer, point-source, cluster, group, and multi-plane simulators.
- **Searches / samplers** — sampler-level profiling, starting with Nautilus. Other samplers (Dynesty, Emcee, BlackJAX, NumPyro, LBFGS, PocoMC) follow in later sweeps.

Expand Down Expand Up @@ -136,6 +137,7 @@ auto-tables) live under `scripts/misc/<task>/`; dataset-agnostic tooling lives u
| `quick_update/` · [README](./scripts/misc/quick_update/README.md) | Fast incremental re-profiling helpers. |
| [`scripts/misc/jax_compile/`](./scripts/misc/jax_compile/README.md) | JAX/XLA **compile-time** profiling — trace / compile / first-call / steady split per likelihood × transform. *How long before this fit starts running?* |
| [`scripts/misc/vram/`](./scripts/misc/vram/README.md) | GPU memory profiling + the per-cell vmap batch-size table for the A100. |
| [`scripts/misc/delaunay_nn/`](./scripts/misc/delaunay_nn/README.md) | DelaunayNN full-mapper runtime and fixed-shape cap scaling. |
| [`scripts/misc/simulators/`](./scripts/misc/simulators/README.md) | Run-time tracking for the PyAutoLens simulators. |
| [`scripts/misc/pipeline_resume/`](./scripts/misc/pipeline_resume/README.md) | SLaM pipeline resume overhead — the wall time a re-run pays per completed stage. |
| [`instruments/`](./instruments/README.md) | Instrument presets (pixel scale, shape) that frame every result. |
Expand Down
1 change: 1 addition & 0 deletions results/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ packages; the dashboard tables in every README are rendered from this tree by
| `searches/` | [`searches/`](../scripts/misc/searches/README.md) | Versioned sampler profiling summaries |
| `pipeline_resume/` | [`pipeline_resume/`](../scripts/misc/pipeline_resume/README.md) | Versioned SLaM resume-overhead summaries (cold + resume run records) |
| `quick_update/` | [`quick_update/`](../scripts/misc/quick_update/README.md) | Unversioned fast re-profiling snapshots (scratch tier) |
| `delaunay_nn/` | [`delaunay_nn/`](../scripts/misc/delaunay_nn/README.md) | Versioned full-mapper cap and runtime benchmarks |
| `notes/` | humans + agents | Narrative findings and design notes (e.g. [`design_lock_in.md`](./notes/design_lock_in.md)) |
| `baselines/` | campaign snapshots | Named, frozen baselines (e.g. `PreOptimizationTimes/`) — see below |

Expand Down
113 changes: 113 additions & 0 deletions results/delaunay_nn/delaunay_nn_benchmark_cpu_v2026.7.23.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"pyautolens_version": "2026.7.23.1",
"backend": "cpu",
"device": "cpu",
"mesh_points": 1200,
"queries": 15000,
"query_chunk": 256,
"repeats": 5,
"rows": [
{
"name": "Delaunay",
"cap": null,
"compile_and_first_seconds": 0.3508444019998933,
"warm_median_seconds": 0.0667459289998078,
"warm_seconds": [
0.06326032399920223,
0.0667459289998078,
0.06692990099963936,
0.0668505190005817,
0.06327970300026209
],
"ratio_to_delaunay": 1.0
},
{
"name": "DelaunayNN cap 16",
"cap": 16,
"compile_and_first_seconds": 1.330291995999687,
"warm_median_seconds": 0.19231454999953712,
"warm_seconds": [
0.19774434400005703,
0.20188686700021208,
0.19175842699951318,
0.19044281399965257,
0.19231454999953712
],
"ratio_to_delaunay": 2.881292580407277,
"main_max_neighbors": 13,
"main_max_cavity": 11,
"split_max_neighbors": 11,
"split_max_cavity": 9,
"main_overflow_rows": 0,
"split_overflow_rows": 0,
"main_degenerate_rows": 0,
"split_degenerate_rows": 0
},
{
"name": "DelaunayNN cap 24",
"cap": 24,
"compile_and_first_seconds": 1.2141758490006396,
"warm_median_seconds": 0.23995153800024127,
"warm_seconds": [
0.23995153800024127,
0.23690873500072485,
0.23717795999982627,
0.24465054699976463,
0.24186520599960204
],
"ratio_to_delaunay": 3.5949988500561916,
"main_max_neighbors": 13,
"main_max_cavity": 11,
"split_max_neighbors": 11,
"split_max_cavity": 9,
"main_overflow_rows": 0,
"split_overflow_rows": 0,
"main_degenerate_rows": 0,
"split_degenerate_rows": 0
},
{
"name": "DelaunayNN cap 32",
"cap": 32,
"compile_and_first_seconds": 1.241680672000257,
"warm_median_seconds": 0.3176600659999167,
"warm_seconds": [
0.33976070000062464,
0.32011838699963846,
0.3176600659999167,
0.30417247700006556,
0.31641388699972595
],
"ratio_to_delaunay": 4.7592425599594455,
"main_max_neighbors": 13,
"main_max_cavity": 11,
"split_max_neighbors": 11,
"split_max_cavity": 9,
"main_overflow_rows": 0,
"split_overflow_rows": 0,
"main_degenerate_rows": 0,
"split_degenerate_rows": 0
},
{
"name": "DelaunayNN cap 64",
"cap": 64,
"compile_and_first_seconds": 1.5097327220000807,
"warm_median_seconds": 0.5624023139998826,
"warm_seconds": [
0.5624023139998826,
0.5757860489993618,
0.5676023759997406,
0.4991818990001775,
0.49036738100039656
],
"ratio_to_delaunay": 8.426016723828985,
"main_max_neighbors": 13,
"main_max_cavity": 11,
"split_max_neighbors": 11,
"split_max_cavity": 9,
"main_overflow_rows": 0,
"split_overflow_rows": 0,
"main_degenerate_rows": 0,
"split_degenerate_rows": 0
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions results/notes/delaunay_nn_cap_audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# DelaunayNN fixed-shape cap audit

## Decision

Keep both `DelaunayNN` static limits at **32**. Caps 16 and 24 are too low for
the tested lensing geometries; 64 roughly doubles the cap-32 geometry cost
without being required by the audit.

## Correctness audit

The workspace assertion
`scripts/misc/jax_assertions/delaunay_nn_caps.py` constructs a 1,200-vertex
Hilbert image mesh from an arc-like adapt image and ray-traces both that mesh
and 4,421 image pixels through 101 Isothermal + external-shear mass models.
The ensemble contains a 25-step local mass-model trajectory, 75 broad prior
draws, and a fixed stress geometry. It audits ordinary mapper queries and all
4,800 split-cross points used by split regularization.

The untruncated cap-64 reference observed:

| Quantity | Maximum | Rows above 16 |
|---|---:|---:|
| Main natural neighbours | 27 | 198 |
| Main cavity triangles | 25 | 107 |
| Split natural neighbours | 21 | 28 |
| Split cavity triangles | 19 | 12 |

The main-neighbour 99th, 99.9th and 99.99th percentiles were 9, 14 and 22;
the corresponding split-neighbour percentiles were 9, 11 and 15. Thus 16 is
usually sufficient but fails in the tail—the precise failure mode that would
otherwise create rare NaN likelihood samples as the mass model changes.

The worst geometry was rerun explicitly at caps 16, 24 and 32. Both 16 and 24
reported fixed-shape overflow; 32 completed without main or split overflow.

## Runtime trade-off

The versioned local CPU benchmark uses 1,200 vertices, 15,000 data queries and
the full mapper path, including split regularization:

| Mapper | Warm median | Relative to Delaunay |
|---|---:|---:|
| Barycentric Delaunay | 0.0667 s | 1.00× |
| DelaunayNN cap 16 | 0.1923 s | 2.88× |
| DelaunayNN cap 24 | 0.2400 s | 3.59× |
| DelaunayNN cap 32 | 0.3177 s | 4.76× |
| DelaunayNN cap 64 | 0.5624 s | 8.43× |

These are local CPU measurements, not A100 results. The cap-32 choice is the
smallest tested static shape that covers the broad mass-model audit. The A100
profile should be rerun before drawing sampler-throughput conclusions.
35 changes: 35 additions & 0 deletions scripts/misc/delaunay_nn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# DelaunayNN profiling

This profile isolates the full geometry cost of the Sibson natural-neighbour
mapper added as `mesh.DelaunayNN`. It times:

- qhull connectivity and JAX point location;
- data-grid natural-neighbour weights;
- barycentric dual areas and split-cross coordinates;
- natural-neighbour weights for all split-regularization points.

The comparison is therefore the complete mapper-table construction against
the equivalent barycentric `Delaunay` path, rather than an isolated
circumcircle kernel.

Run the production-shaped CPU/GPU benchmark from the repository root:

```bash
python scripts/misc/delaunay_nn/benchmark.py
```

Useful overrides:

```bash
python scripts/misc/delaunay_nn/benchmark.py \
--mesh-points 1500 --queries 20000 --caps 16 24 32 64 --repeats 10
```

The script writes a versioned JSON and PNG pair under
`results/delaunay_nn/`. The cap sweep exposes the speed/headroom trade-off;
the separate workspace assertion
`scripts/misc/jax_assertions/delaunay_nn_caps.py` decides correctness using
actual Hilbert meshes ray-traced through a mass-model ensemble.

The current cap decision and measured tail distributions are recorded in
[`results/notes/delaunay_nn_cap_audit.md`](../../../results/notes/delaunay_nn_cap_audit.md).
Loading
Loading