Skip to content

autolens_jax_joss: JOSS benchmark suite + real-data start_here pairing #281

Description

@Jammy2211

Overview

The PyAutoLens-JAX paper draft (PyAutoLens/paper_jax/paper.md) promises 10 end-to-end benchmarks (6 single-dataset, 4 joint) that do not yet exist. This task creates a new public repo PyAutoLabs/autolens_jax_joss containing one runnable script per benchmark plus a timing/report harness, and pairs each benchmark to a real-data start_here.py (or multi feature script) in autolens_workspace — upgrading the simulated ones to real data. Because these land in start_here.py, they are user-facing far beyond the paper: each rewrite keeps teaching-quality prose, runs on a normal laptop, and auto-downloads its data.

Per the paper, every benchmark reports: total wall-clock, JAX compile time, number of likelihood evaluations, post-compile runtime (+ hardware/versions). Official numbers on an NVIDIA A100; scripts reproducible on any GPU/CPU.

Dataset decisions (user-approved): ALMA = SDP.81 · point source = RXJ1131-1231 · cluster + weak + joint strong/weak anchor = Abell 2744 · repo = PyAutoLabs org, public.

Plan

  • Phase 1 — birth autolens_jax_joss (public) + timing harness + benchmarks already on real data: galaxy-scale imaging (COSMOS-Web Ring F150W) and multi-band (4 bands), paired to imaging/start_here.py and multi/start_here.py.
  • Phase 2 — interferometry: public SDP.81 ALMA visibilities (>1M), download-on-first-run; rewrite interferometer/start_here.py; benchmark.
  • Phase 3 — point source: RXJ1131-1231 published positions/time delays; rewrite point_source/start_here.py; new multi/features/imaging_and_point_source/ joint script; two benchmarks.
  • Phase 4 — group (verify existing dataset is real, make fast) + cluster: A2744 public multiple-image catalogues; rewrite cluster/start_here.py; two benchmarks.
  • Phase 5 — weak: new weak/start_here.py from the real A2744 shape catalogue; joint strong+weak (A2744) and joint imaging+interferometer (SDP.81); three benchmarks; final RESULTS.md sweep.

Benchmark ↔ workspace pairing table

Benchmark Paired example Data
Galaxy-scale imaging scripts/imaging/start_here.py cosmos_web_ring (real, JWST F150W)
Interferometry scripts/interferometer/start_here.py SDP.81 (ALMA, >1M vis)
Point source scripts/point_source/start_here.py RXJ1131-1231 (positions + delays)
Group scripts/group/start_here.py existing real group lens (verify)
Cluster scripts/cluster/start_here.py Abell 2744 (multiple images)
Weak scripts/weak/start_here.py (new) Abell 2744 JWST shape catalogue
Multi-band scripts/multi/start_here.py cosmos_web_ring 4 wavebands
Strong + weak scripts/weak/features/strong_lensing/ Abell 2744
Imaging + point source scripts/multi/features/imaging_and_point_source/ (new) RXJ1131-1231
Imaging + interferometer scripts/multi/features/imaging_and_interferometer/ SDP.81
Detailed implementation plan

Affected Repositories

  • autolens_jax_joss (new, primary deliverable)
  • autolens_workspace (primary tracked repo)

Branch Survey

Repository Current Branch Dirty?
./autolens_workspace main clean

Suggested branch: feature/jax-joss-benchmarks
Worktree: ~/Code/PyAutoLabs-wt/jax-joss-benchmarks/

Data hosting policy

Large real datasets are never committed: sizeable data (SDP.81 visibilities, A2744 catalogues/imaging, RXJ1131 cutouts) is fetched automatically on first run from a stable public URL (Zenodo preferred; weak/real_data/a2744.py download-and-cache pattern is the template) into gitignored dataset/ paths, with checksum + printed provenance. Small derived products (position/delay JSONs, model CSVs, kB–few-MB) may live in dataset/ per existing convention.

Implementation Steps

  1. gh repo create PyAutoLabs/autolens_jax_joss --public; skeleton: README (pairing table + how to run), LICENSE, .gitignore, requirements.txt, benchmarks/, results/.
  2. harness.py: runner recording wall-clock, compile time (first-eval − steady-state), likelihood evals (search counter), post-compile runtime, GPU/CPU + jax/autolens versions → results/<benchmark>.json; regenerates RESULTS.md.
  3. benchmarks/imaging.py + benchmarks/multi_band.py — same data/model family as their paired start_here scripts (MGE lens light + SIE+shear + pixelized source, gradient-based search), tuned toward ~5 min on A100.
  4. Phases 2–5 per the checklist above: each = real-data acquisition (download-on-first-run) + start_here rewrite (teaching prose, laptop-runnable) + JOSS benchmark script(s).
  5. A100 timing runs via the RAL HPC pipeline; commit results/*.json + regenerated RESULTS.md.

Key Files

  • autolens_jax_joss/harness.py — timing/report harness (new)
  • autolens_jax_joss/benchmarks/*.py — the 10 benchmarks (new)
  • autolens_workspace/scripts/{interferometer,point_source,cluster}/start_here.py — real-data rewrites
  • autolens_workspace/scripts/weak/start_here.py — new front door for weak lensing
  • autolens_workspace/scripts/multi/features/imaging_and_point_source/ — new joint feature script
  • PyAutoLens/paper_jax/paper.md — benchmark section these numbers feed (not edited here)

Risks

  • ~5 min A100 targets are aspirational until measured — report honestly, tune (e.g. lax.map batch_size) rather than fake.
  • SDP.81 visibility extraction may need CASA; fallback = pre-exported uv table on Zenodo.
  • Cluster/group JAX point-solver performance at scale less battle-tested than imaging.

Original Prompt

Click to expand starting prompt

Create a repo autolens_jax_joss which provides examples to run each JAX benchmark from the PyAutoLens-JAX paper draft and reports the run time and info. These benchmarks currently do not exist.

Single-dataset and single-regime benchmarks (establish GPU acceleration and autodiff across lensing scales and data types):

  • Galaxy-scale CCD imaging: Model JWST COSMOS-Web Ring F150W imaging, including lens-light subtraction and a pixelized source reconstruction, in approximately five minutes.
  • Interferometry: Model a real ALMA strong-lensing dataset containing more than one million interferometer visibilities in approximately five minutes.
  • Point-source lensing: Model a real multiply imaged quasar or supernova using point-source observables, including image positions and, where available, time delays or flux information, in under five minutes.
  • Group-scale strong lensing: Model a real group-scale lens containing multiple deflecting galaxies in under five minutes, demonstrating that PyAutoLens-JAX is not restricted to isolated galaxy-scale lenses.
  • Cluster-scale strong lensing: Model a real cluster lens with multiple mass components, multiple images, and potentially multiple source planes in under five minutes.
  • Weak lensing: Fit a weak-lensing shear catalogue using a differentiable JAX likelihood in under five minutes, demonstrating that PyAutoLens-JAX is not restricted to strong-lensing data.

Joint and multi-dataset benchmarks (different datasets, lensing regimes, and physical scales combined in a single differentiable, GPU-accelerated probabilistic model):

  • Multi-band imaging: Jointly model the four available JWST COSMOS-Web Ring bands, constraining a common lens mass model while fitting the wavelength-dependent lens and source emission in each dataset.
  • Joint strong and weak lensing: Constrain a single group- or cluster-scale mass model using both strong-lensing and weak-lensing observables.
  • Imaging and point-source lensing: Jointly model extended arcs and point-source constraints from a lensed quasar or supernova within the same lens model.
  • Imaging and interferometry: Jointly fit optical or infrared imaging and radio or submillimetre interferometer visibilities, constraining a common mass model using complementary observations of the lensed source.

Pairing requirement: pair each benchmark to the start_here.py file in each autolens_workspace package. For example the JWST COSMOS-Web Ring F150W example, which is made fast, is paired to autolens_workspace/scripts/imaging/start_here.py. All 6 single-dataset start_here.py examples should use real data, and each JOSS example should use the same real data.

The four multi examples pair to examples in autolens_workspace/scripts/multi or scripts/weak/features/strong_lensing. A new multi script will likely be needed for the imaging + point-source lensing joint-modelling benchmark.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions