diff --git a/_profile_cli.py b/_profile_cli.py index 7ac5c75c3..da5187e40 100644 --- a/_profile_cli.py +++ b/_profile_cli.py @@ -36,6 +36,7 @@ class ProfileCLI: instrument: str | None vmap_probe: bool use_sparse_operator: bool + rect_mesh: str def parse_profile_cli(default_config_name: str | None = None) -> ProfileCLI: @@ -122,6 +123,25 @@ def parse_profile_cli(default_config_name: str | None = None) -> ProfileCLI: ), ) + parser.add_argument( + "--rect-mesh", + choices=("bilinear", "rtu"), + default="bilinear", + help=( + "Which adaptive rectangular mesh family the cell profiles " + "(PyAutoArray#462 split): 'bilinear' — " + "RectangularBilinearAdaptDensity/AdaptImage, the empirical " + "rank-CDF workspace default and CPU-speed campaign target — or " + "'rtu' — RectangularRTUAdaptDensity/AdaptImage, the kernel-CDF " + "advanced/GPU/gradient meshes (the pre-split behaviour, so " + "'--rect-mesh rtu' reproduces pre-split recorded results). " + "Cells that read this flag resolve the classes via " + "``rect_mesh_classes`` and embed ``rect_mesh`` in the result " + "JSON; '_rtu' is appended to the output basename so the two " + "families' results never clobber each other." + ), + ) + args, _unknown = parser.parse_known_args() config_name = args.config_name or default_config_name output_dir = Path(args.output_dir).resolve() if args.output_dir else None @@ -132,6 +152,26 @@ def parse_profile_cli(default_config_name: str | None = None) -> ProfileCLI: instrument=args.instrument, vmap_probe=bool(args.vmap_probe), use_sparse_operator=bool(args.sparse), + rect_mesh=args.rect_mesh, + ) + + +def rect_mesh_classes(cli: ProfileCLI): + """Resolve the explicit adaptive rectangular mesh classes for this run. + + Returns ``(density_cls, image_cls)`` for ``cli.rect_mesh``: + ``RectangularBilinearAdaptDensity/AdaptImage`` (rank-CDF, the workspace + default) or ``RectangularRTUAdaptDensity/AdaptImage`` (kernel-CDF, the + pre-split behaviour). Imports autolens lazily so ``_profile_cli`` stays + importable without the modelling stack. + """ + import autolens as al + + if cli.rect_mesh == "rtu": + return al.mesh.RectangularRTUAdaptDensity, al.mesh.RectangularRTUAdaptImage + return ( + al.mesh.RectangularBilinearAdaptDensity, + al.mesh.RectangularBilinearAdaptImage, ) @@ -211,6 +251,10 @@ def resolve_output_paths( basename = f"{cell}_{cli.config_name}" if cli.use_sparse_operator: basename = f"{basename}_sparse" + if cli.rect_mesh == "rtu": + # Keep the two rectangular-mesh families' results disjoint; the + # bilinear default keeps the unsuffixed (pre-split) filenames. + basename = f"{basename}_rtu" return results_dir / f"{basename}.json", results_dir / f"{basename}.png" diff --git a/scripts/imaging/likelihood_breakdown/pixelization.py b/scripts/imaging/likelihood_breakdown/pixelization.py index cb5c27bc6..ad628e2eb 100644 --- a/scripts/imaging/likelihood_breakdown/pixelization.py +++ b/scripts/imaging/likelihood_breakdown/pixelization.py @@ -93,6 +93,7 @@ def _profiling_root() -> _Path: auto_simulate_if_missing, device_info_dict, parse_profile_cli, + rect_mesh_classes, resolve_output_paths, ) @@ -270,12 +271,12 @@ def jit_profile(func, label, *args, n_repeats=10): lens = af.Model(al.Galaxy, redshift=0.5, bulge=lens_bulge, mass=mass, shear=shear) - # ``RectangularAdaptImage`` weights mesh pixels by the lensed-source + # ``RectangularBilinearAdaptImage`` weights mesh pixels by the lensed-source # adapt image — the production-grade alternative to the coordinate- - # density-only ``RectangularAdaptDensity``. Adapt image is loaded / + # density-only ``RectangularBilinearAdaptDensity``. Adapt image is loaded / # cached below; the same shape and regularization are kept. pixelization = al.Pixelization( - mesh=al.mesh.RectangularAdaptImage(shape=mesh_shape, weight_power=1.0, weight_floor=0.0), + mesh=rect_mesh_classes(_cli)[1](shape=mesh_shape, weight_power=1.0, weight_floor=0.0), regularization=al.reg.Constant(coefficient=1.0), ) @@ -324,7 +325,7 @@ def jit_profile(func, label, *args, n_repeats=10): # --------------------------------------------------------------------------- # 4. Adapt image — PSF-convolved lensed-source image used by -# ``RectangularAdaptImage`` to weight mesh pixels. +# ``RectangularBilinearAdaptImage`` to weight mesh pixels. # --------------------------------------------------------------------------- print("\n--- Adapt image (lensed source) ---") @@ -557,7 +558,7 @@ def overlay_grid_raw_fn(relocated_grid_raw): pixelization_obj = instance.galaxies.source.pixelization with timer.section("interpolation_and_mapper"): - # ``RectangularAdaptImage.interpolator_from`` consumes ``adapt_data`` to + # ``RectangularBilinearAdaptImage.interpolator_from`` consumes ``adapt_data`` to # build the per-pixel weight map; pass the lensed-source image through. interpolator = pixelization_obj.mesh.interpolator_from( source_plane_data_grid=relocated_grid, @@ -973,6 +974,7 @@ def compute_log_evidence( "image_pixels_masked": int(n_image_pixels), "over_sampled_pixels": int(n_over_sampled_pixels), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "inversion_path": "sparse" if _cli.use_sparse_operator else "dense", }, diff --git a/scripts/imaging/likelihood_breakdown/pixelization_numba.py b/scripts/imaging/likelihood_breakdown/pixelization_numba.py index e422be667..4857680e3 100644 --- a/scripts/imaging/likelihood_breakdown/pixelization_numba.py +++ b/scripts/imaging/likelihood_breakdown/pixelization_numba.py @@ -88,6 +88,7 @@ def _profiling_root() -> _Path: device_info_dict, parse_profile_cli, record_pinned_check, + rect_mesh_classes, resolve_output_paths, ) @@ -169,7 +170,7 @@ def _profiling_root() -> _Path: lens = af.Model(al.Galaxy, redshift=0.5, bulge=lens_bulge, mass=mass, shear=shear) pixelization = al.Pixelization( - mesh=al.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=rect_mesh_classes(_cli)[0](shape=mesh_shape), regularization=al.reg.Constant(coefficient=1.0), ) @@ -339,6 +340,7 @@ def one_decomposed_evaluation() -> tuple[dict[str, float], float]: "image_pixels_masked": int(n_image_pixels), "over_sampled_pixels": int(n_over_sampled_pixels), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "inversion_path": "sparse_numba", "use_jax": False, diff --git a/scripts/imaging/likelihood_runtime/pixelization.py b/scripts/imaging/likelihood_runtime/pixelization.py index 6d0057a08..5efe89fdb 100644 --- a/scripts/imaging/likelihood_runtime/pixelization.py +++ b/scripts/imaging/likelihood_runtime/pixelization.py @@ -96,6 +96,7 @@ def _profiling_root() -> _Path: device_info_dict, parse_profile_cli, record_pinned_check, # noqa: E402 + rect_mesh_classes, resolve_output_paths, ) @@ -275,12 +276,12 @@ def jit_profile(func, label, *args, n_repeats=10): lens = af.Model(al.Galaxy, redshift=0.5, bulge=lens_bulge, mass=mass, shear=shear) - # ``RectangularAdaptImage`` weights mesh pixels by the lensed-source + # ``RectangularBilinearAdaptImage`` weights mesh pixels by the lensed-source # adapt image — the production-grade alternative to the coordinate- - # density-only ``RectangularAdaptDensity``. Adapt image is loaded / + # density-only ``RectangularBilinearAdaptDensity``. Adapt image is loaded / # cached below; the same shape and regularization are kept. pixelization = al.Pixelization( - mesh=al.mesh.RectangularAdaptImage(shape=mesh_shape, weight_power=1.0, weight_floor=0.0), + mesh=rect_mesh_classes(_cli)[1](shape=mesh_shape, weight_power=1.0, weight_floor=0.0), regularization=al.reg.Constant(coefficient=1.0), ) @@ -329,7 +330,7 @@ def jit_profile(func, label, *args, n_repeats=10): # --------------------------------------------------------------------------- # 4. Adapt image — PSF-convolved lensed-source image used by -# ``RectangularAdaptImage`` to weight mesh pixels. Loads ``lensed_source.fits`` +# ``RectangularBilinearAdaptImage`` to weight mesh pixels. Loads ``lensed_source.fits`` # from the dataset directory if present, otherwise computes it from the # truth tracer and caches the file for sibling scripts on the same # instrument. @@ -421,6 +422,7 @@ def full_pipeline_from_params(params_tree): "image_pixels_masked": int(n_image_pixels), "over_sampled_pixels": int(n_over_sampled_pixels), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "inversion_path": "sparse" if _cli.use_sparse_operator else "dense", }, @@ -626,6 +628,7 @@ def full_pipeline_from_params(params_tree): "image_pixels_masked": int(n_image_pixels), "over_sampled_pixels": int(n_over_sampled_pixels), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "inversion_path": "sparse" if _cli.use_sparse_operator else "dense", }, @@ -654,7 +657,7 @@ def full_pipeline_from_params(params_tree): # Regression assertion — realistic-scale deterministic log-evidence # =================================================================== # -# RectangularAdaptImage at prior medians anchors the regression on the +# RectangularBilinearAdaptImage at prior medians anchors the regression on the # *eager* FitImaging value (deterministic to fp64 noise). The full-pipeline # single-JIT / vmap paths agree with eager to ~1e-3 only: adaptive mesh # weighting amplifies fp accumulation in Cholesky / log_det on the bigger diff --git a/scripts/imaging/likelihood_runtime/pixelization_numba.py b/scripts/imaging/likelihood_runtime/pixelization_numba.py index 826dff662..678203ddb 100644 --- a/scripts/imaging/likelihood_runtime/pixelization_numba.py +++ b/scripts/imaging/likelihood_runtime/pixelization_numba.py @@ -21,7 +21,8 @@ The model mirrors the production CPU-fast fiducial: MGE-60 lens light (linear, held at prior medians), Isothermal + shear mass, and a rectangular -``RectangularAdaptDensity`` source pixelization with constant regularization +``RectangularBilinearAdaptDensity`` source pixelization with constant regularization +(or ``RectangularRTUAdaptDensity`` via ``--rect-mesh rtu`` — PyAutoArray#462 split) (the workspace example's mesh; 28x28 = 784 source pixels). Notes: @@ -82,6 +83,7 @@ def _profiling_root() -> _Path: device_info_dict, parse_profile_cli, record_pinned_check, + rect_mesh_classes, resolve_output_paths, ) @@ -211,7 +213,7 @@ def section(self, label: str): lens = af.Model(al.Galaxy, redshift=0.5, bulge=lens_bulge, mass=mass, shear=shear) pixelization = al.Pixelization( - mesh=al.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=rect_mesh_classes(_cli)[0](shape=mesh_shape), regularization=al.reg.Constant(coefficient=1.0), ) @@ -324,6 +326,7 @@ def section(self, label: str): "image_pixels_masked": int(n_image_pixels), "over_sampled_pixels": int(n_over_sampled_pixels), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "inversion_path": "sparse_numba", "use_jax": False, diff --git a/scripts/imaging/parallel_scaling/README.md b/scripts/imaging/parallel_scaling/README.md index 632904b8a..9b7201b43 100644 --- a/scripts/imaging/parallel_scaling/README.md +++ b/scripts/imaging/parallel_scaling/README.md @@ -41,7 +41,7 @@ submit scripts are `hpc/batch_cpu/submit_parallel_scaling_pixelization_numba_euc harness deliberately excludes. > **Fiducial note:** the Findings section below is for the Rectangular -> (28×28 `RectangularAdaptDensity`) fiducial. The production campaign fiducial +> (28×28 `RectangularBilinearAdaptDensity`) fiducial. The production campaign fiducial > is Delaunay + Hilbert-1250 image-mesh (the `delaunay_numba` runtime/breakdown > cells): run it with `--mesh delaunay` (artifacts land as > `delaunay_numba_scaling_`). First Delaunay pass (euclid, 4-core @@ -54,7 +54,7 @@ submit scripts are `hpc/batch_cpu/submit_parallel_scaling_pixelization_numba_euc ## Findings — first pass, 2026-08-20 (v2026.8.17.1, local 8-core WSL box) -Fiducial: 28×28 `RectangularAdaptDensity` + `Constant` reg, MGE-60 linear lens +Fiducial: 28×28 `RectangularBilinearAdaptDensity` + `Constant` reg, MGE-60 linear lens light, mask 3.5". Full JSONs under `results/{runtime,breakdown,parallel_scaling}/imaging/`. **Per-evaluation cost** (`likelihood_runtime` cell): diff --git a/scripts/imaging/parallel_scaling/pixelization_numba.py b/scripts/imaging/parallel_scaling/pixelization_numba.py index 690e94c3d..7868770c1 100644 --- a/scripts/imaging/parallel_scaling/pixelization_numba.py +++ b/scripts/imaging/parallel_scaling/pixelization_numba.py @@ -51,7 +51,8 @@ ------ ``results/parallel_scaling/imaging/pixelization_numba_scaling__v.{json,png}`` -``--mesh`` selects the fiducial: ``rectangular`` (28x28 ``RectangularAdaptDensity``, +``--mesh`` selects the fiducial: ``rectangular`` (28x28 adaptive rectangular — +``RectangularBilinearAdaptDensity`` by default, ``--rect-mesh rtu`` for the kernel-CDF variant, the ``pixelization_numba`` siblings) or ``delaunay`` (Hilbert-1250 Delaunay + ConstantSplit, the ``delaunay_numba`` siblings — the production campaign fiducial; artifacts are written as ``delaunay_numba_scaling_``). @@ -105,6 +106,7 @@ def _profiling_root() -> _Path: auto_simulate_if_missing, device_info_dict, parse_profile_cli, + rect_mesh_classes, resolve_output_paths, ) @@ -205,10 +207,10 @@ def _profiling_root() -> _Path: mesh_pixels_yx = 28 mesh_shape = (mesh_pixels_yx, mesh_pixels_yx) n_source_pixels = mesh_pixels_yx * mesh_pixels_yx - mesh_label = f"rectangular_adapt_density_{mesh_pixels_yx}x{mesh_pixels_yx}" + mesh_label = f"rectangular_{_cli.rect_mesh}_adapt_density_{mesh_pixels_yx}x{mesh_pixels_yx}" pixelization = al.Pixelization( - mesh=al.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=rect_mesh_classes(_cli)[0](shape=mesh_shape), regularization=al.reg.Constant(coefficient=1.0), ) else: diff --git a/scripts/imaging/searches/multi_start_prodigy/pixelization.py b/scripts/imaging/searches/multi_start_prodigy/pixelization.py index 225631286..1d4ec24cc 100644 --- a/scripts/imaging/searches/multi_start_prodigy/pixelization.py +++ b/scripts/imaging/searches/multi_start_prodigy/pixelization.py @@ -18,7 +18,7 @@ Budget/batching lessons as per the ``knn`` cell: 16 starts, 3000-step budget (a long plateau is a reg mode, not convergence), ``batch_size=4`` mandatory (unbatched 16-start pixelized jvp ~58 GB). Model: MGE lens light + free broad -Isothermal/shear + ``RectangularAdaptImage`` source + free ``Constant`` reg — +Isothermal/shear + ``RectangularRTUAdaptImage`` source + free ``Constant`` reg — the SLaM ``source_pix[1]`` shape (see ``_setup._pixelization_model``). """ diff --git a/scripts/imaging/searches/nautilus/pixelization.py b/scripts/imaging/searches/nautilus/pixelization.py index ded9d7617..54cb2d682 100644 --- a/scripts/imaging/searches/nautilus/pixelization.py +++ b/scripts/imaging/searches/nautilus/pixelization.py @@ -1,6 +1,6 @@ """First-class af.Nautilus search profiling — imaging pixelization. -Drives a full ``af.Nautilus`` fit on an MGE lens + RectangularAdaptImage +Drives a full ``af.Nautilus`` fit on an MGE lens + RectangularRTUAdaptImage pixelization source imaging model. Uses a truth-derived adapt image cached next to the dataset. See ``searches/README.md`` for caveats. """ diff --git a/scripts/interferometer/likelihood_runtime/pixelization.py b/scripts/interferometer/likelihood_runtime/pixelization.py index d1ae1b81c..f6839c57a 100644 --- a/scripts/interferometer/likelihood_runtime/pixelization.py +++ b/scripts/interferometer/likelihood_runtime/pixelization.py @@ -105,6 +105,7 @@ def _profiling_root() -> _Path: device_info_dict, parse_profile_cli, record_pinned_check, # noqa: E402 + rect_mesh_classes, resolve_output_paths, ) @@ -260,7 +261,7 @@ def _build_transformer(uv_wavelengths, real_space_mask): pixelization = af.Model( al.Pixelization, - mesh=al.mesh.RectangularAdaptImage(shape=mesh_shape, weight_power=1.0, weight_floor=0.0), + mesh=rect_mesh_classes(_cli)[1](shape=mesh_shape, weight_power=1.0, weight_floor=0.0), regularization=al.reg.Constant(coefficient=regularization_coefficient), ) @@ -309,7 +310,7 @@ def _build_transformer(uv_wavelengths, real_space_mask): print(f" Reg. coefficient: {regularization_coefficient}") # --------------------------------------------------------------------------- -# 4b. Adapt image — drives ``RectangularAdaptImage`` mesh weighting +# 4b. Adapt image — drives ``RectangularBilinearAdaptImage`` mesh weighting # --------------------------------------------------------------------------- print("\n--- Adapt image (lensed source) ---") @@ -561,6 +562,7 @@ def full_pipeline_from_params(params_tree): "real_space_shape": list(real_space_shape), "visibilities": int(n_visibilities), "mesh_shape": list(mesh_shape), + "rect_mesh": _cli.rect_mesh, "source_pixels": int(n_source_pixels), "regularization_coefficient": regularization_coefficient, }, diff --git a/scripts/misc/likelihood_breakdown/README.md b/scripts/misc/likelihood_breakdown/README.md index d393dfc99..816571df0 100644 --- a/scripts/misc/likelihood_breakdown/README.md +++ b/scripts/misc/likelihood_breakdown/README.md @@ -91,7 +91,7 @@ If, on the other hand, the two numbers agree closely, the per-step bars are a fa | Script | Dataset class | Source model | Notes | |--------|--------------|--------------|-------| | `imaging/mge.py` | Imaging | MGE linear bulge | Linear MGE source; 8-step pipeline. | -| `imaging/pixelization.py` | Imaging | RectangularAdaptImage | 13-step pipeline incl. mesh + regularisation. | +| `imaging/pixelization.py` | Imaging | RectangularBilinearAdaptImage (`--rect-mesh rtu` for the RTU variant) | 13-step pipeline incl. mesh + regularisation. | | `imaging/delaunay.py` | Imaging | DelaunayBrightnessImage | 13-step pipeline; Hilbert-curve mesh. | | `interferometer/delaunay.py` | Interferometer | DelaunayBrightnessImage + sparse-DFT | 11-step pipeline. The transform-mapping-matrix step is the interferometer-specific replacement for imaging's PSF convolution. | | `datacube/delaunay.py` | Datacube | DelaunayBrightnessImage × N channels | 8-step pipeline. Channel-invariant steps profiled once; channel-variant steps profiled on channel 0 and multiplied by `N_channels` for the cube cost. | diff --git a/scripts/misc/likelihood_runtime/OPTIMIZATION_NOTES.md b/scripts/misc/likelihood_runtime/OPTIMIZATION_NOTES.md index 6cae42f69..97dcf94cc 100644 --- a/scripts/misc/likelihood_runtime/OPTIMIZATION_NOTES.md +++ b/scripts/misc/likelihood_runtime/OPTIMIZATION_NOTES.md @@ -100,7 +100,7 @@ A "—" entry means the row failed or wasn't run; see the cell's notes. --- ## imaging/pixelization -*Rectangular `RectangularAdaptImage` mesh + Constant regularization. 35×35 +*Rectangular `RectangularRTUAdaptImage` (kernel-CDF; measured pre-split as `RectangularAdaptImage`) mesh + Constant regularization. 35×35 source pixels = 1225 source mesh nodes. Default HST-resolution dataset (0.05″/px, mask radius 3.5″, 15 361 masked pixels, 17 980 over-sampled).* diff --git a/scripts/misc/likelihood_runtime/README.md b/scripts/misc/likelihood_runtime/README.md index 8d8fa0d38..8f4137d6c 100644 --- a/scripts/misc/likelihood_runtime/README.md +++ b/scripts/misc/likelihood_runtime/README.md @@ -77,10 +77,10 @@ Empirical effect: mp on CPU consistently helps 7 – 23 %. On GPU it's more vari | Script | Dataset class | Source model | |--------|--------------|--------------| | `imaging/mge.py` | Imaging | MGE linear bulge | -| `imaging/pixelization.py` | Imaging | RectangularAdaptImage | +| `imaging/pixelization.py` | Imaging | RectangularBilinearAdaptImage (`--rect-mesh rtu` for the kernel-CDF RTU variant) | | `imaging/delaunay.py` | Imaging | DelaunayBrightnessImage | | `interferometer/mge.py` | Interferometer | MGE linear bulge; `TransformerNUFFT` (nufftax) default, `--use-dft` opt-in | -| `interferometer/pixelization.py` | Interferometer | RectangularAdaptImage + `apply_sparse_operator(use_jax=True)` | +| `interferometer/pixelization.py` | Interferometer | RectangularBilinearAdaptImage (`--rect-mesh rtu` available) + `apply_sparse_operator(use_jax=True)` | | `interferometer/delaunay.py` | Interferometer | DelaunayBrightnessImage + `apply_sparse_operator(use_jax=True)` | | `datacube/delaunay.py` | Datacube (34-channel cube) | DelaunayBrightnessImage per channel, shared lens model | | `point_source/image_plane.py` | Point source | Image-plane χ² via `PointSolver` | diff --git a/scripts/misc/pipeline_resume/slam_resume.py b/scripts/misc/pipeline_resume/slam_resume.py index 1f818c150..9f7b34593 100644 --- a/scripts/misc/pipeline_resume/slam_resume.py +++ b/scripts/misc/pipeline_resume/slam_resume.py @@ -267,7 +267,7 @@ def source_pix_1(settings_search, dataset, source_lp_result, mesh_shape, n_live, redshift=source_lp_result.instance.galaxies.source.redshift, pixelization=af.Model( al.Pixelization, - mesh=af.Model(al.mesh.RectangularAdaptDensity, shape=mesh_shape), + mesh=af.Model(al.mesh.RectangularBilinearAdaptDensity, shape=mesh_shape), regularization=al.reg.Adapt, ), ), @@ -321,7 +321,7 @@ def source_pix_2( redshift=source_lp_result.instance.galaxies.source.redshift, pixelization=af.Model( al.Pixelization, - mesh=af.Model(al.mesh.RectangularAdaptImage, shape=mesh_shape), + mesh=af.Model(al.mesh.RectangularBilinearAdaptImage, shape=mesh_shape), regularization=al.reg.Adapt, ), ), diff --git a/scripts/misc/searches/_setup.py b/scripts/misc/searches/_setup.py index c97db58b9..307acc1a3 100644 --- a/scripts/misc/searches/_setup.py +++ b/scripts/misc/searches/_setup.py @@ -733,7 +733,7 @@ def _group_mge_model(*, mask_radius: float) -> af.Collection: def _pixelization_model(*, mask_radius: float) -> af.Collection: - """RectangularAdaptImage source, mirrors ``source_pix[1]`` init mesh. + """RectangularRTUAdaptImage source, mirrors ``source_pix[1]`` init mesh. The lens light is MGE so the lens-light + source-pixelization inversion runs the full Gaussians + mesh columns through the same @@ -748,7 +748,7 @@ def _pixelization_model(*, mask_radius: float) -> af.Collection: lens = af.Model(al.Galaxy, redshift=0.5, bulge=lens_bulge, mass=mass, shear=shear) pixelization = af.Model( al.Pixelization, - mesh=al.mesh.RectangularAdaptImage( + mesh=al.mesh.RectangularRTUAdaptImage( shape=_PIXELIZATION_MESH_SHAPE, weight_power=1.0, weight_floor=0.0, diff --git a/scripts/misc/simulators/imaging.py b/scripts/misc/simulators/imaging.py index d7795c6c5..ab0f04357 100644 --- a/scripts/misc/simulators/imaging.py +++ b/scripts/misc/simulators/imaging.py @@ -262,7 +262,7 @@ def _image_fn(grid_array): ) # Lensed source image (PSF-convolved) — used as the ``adapt_image`` by - # downstream likelihood scripts that profile ``RectangularAdaptImage`` and + # downstream likelihood scripts that profile ``RectangularBilinearAdaptImage`` and # ``image_mesh.Hilbert``. with timer.section("output_lensed_source"): lensed_source_unblurred = tracer.image_2d_list_from(grid=grid)[-1] diff --git a/scripts/misc/simulators/interferometer.py b/scripts/misc/simulators/interferometer.py index 2725296d9..12b2d7173 100644 --- a/scripts/misc/simulators/interferometer.py +++ b/scripts/misc/simulators/interferometer.py @@ -276,7 +276,7 @@ def _image_fn(grid_array): # Lensed source image (real-space, pre-NUFFT) — used as the ``adapt_image`` # by downstream interferometer + datacube likelihood scripts that profile - # ``RectangularAdaptImage`` and ``image_mesh.Hilbert``. No PSF convolution + # ``RectangularBilinearAdaptImage`` and ``image_mesh.Hilbert``. No PSF convolution # here; the visibility transform lives downstream in the likelihood path. with timer.section("output_lensed_source"): lensed_source = tracer.image_2d_list_from(grid=grid)[-1] diff --git a/skills/profile_likelihood/reference.md b/skills/profile_likelihood/reference.md index 2dec9885b..a3034d726 100644 --- a/skills/profile_likelihood/reference.md +++ b/skills/profile_likelihood/reference.md @@ -127,7 +127,7 @@ delete the feature branch; move the `active.md` entry to `complete.md` and - `mge-profiling-a100` (autolens_workspace_developer #56, merged 2026-05-09) — first run; 8-step MGE; A100 fp64 = 5.7 ms; vmap ~2×; F + Mapping matrix dominate. -- `pixelization-profiling-a100` (#57) — RectangularAdaptDensity; 11-step; +- `pixelization-profiling-a100` (#57) — RectangularBilinearAdaptDensity; 11-step; A100 fp64 = 9.7 ms; vmap does not help (serial NNLS); bottleneck shifts from F (consumer GPU) to NNLS (A100). - Canonical implementations: `z_projects/profiling/scripts/mge_profile.py` /