Skip to content

The astronomical GP without the padded grid - #239

Draft
chrisfinlay wants to merge 2 commits into
setup-costfrom
dft-gp-ast
Draft

chrisfinlay wants to merge 2 commits into
setup-costfrom
dft-gp-ast

Conversation

@chrisfinlay

@chrisfinlay chrisfinlay commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #242, which is the bottom of this stack and branches off main.
Nothing here touches the compiled kernels.

The Fourier GPs reach a signal by padding the surviving modes to a grid twice
the data axis in each of frequency and time, inverse-transforming the whole of
it and cropping the padding away. The chain is linear and separable, so the
cropped output is a discrete Fourier transform of the surviving modes evaluated
at the positions that survive the crop — one small matrix product per axis
instead of a grid about four times the size of the visibilities, formed and
discarded once per block in the forward pass and again in reverse.

ast_vis:GPVisAstDFT is GPVisAst with that substitution made:

model:
  components:
    - ast_vis:GPVisAstDFT

The prior, the initialisation and the blocking over baselines are the parent's;
only the step from the surviving modes to the visibilities differs. The modes of
this component are set by the array's geometry rather than by a choice, so the
matrices are fixed at setup and shared by every baseline.

Measured

One GH200, 2016 baselines at 150 integrations, value and gradient together, each
case in its own process — the peak is a process high-water mark, not an
allocator figure.

channels GPVisAst, best block GPVisAst, unblocked GPVisAstDFT
8 273.9 MB, 1.0 ms 441.2 MB, 1.0 ms 218.6 MB, 0.2 ms
32 828.6 MB, 4.0 ms 1711.2 MB, 3.3 ms 683.8 MB, 0.4 ms
128 2386.4 MB, 14.7 ms 5926.7 MB, 12.7 ms 1799.1 MB, 1.1 ms

The two components agree to round-off in value and in gradient, which is what
the tests check — against the parent's own pads and crop, so the comparison is
to the code being replaced rather than to a second implementation of the same
idea.

auto on this component is a single step over every baseline. Its only
transient is the intermediate of two matrix products, so the scan has nothing
large left to bound and its stack of per-step outputs would be a cost of its
own. An explicit baseline_block_size is still honoured on both components.

Scope

GPVisAst remains the default and is unchanged. This is a component you list in
its place, so nothing moves unless a config asks for it.

@chrisfinlay
chrisfinlay changed the base branch from poly-interp-reference to poly-interp-hybrid September 13, 2026 01:48
@chrisfinlay
chrisfinlay changed the base branch from poly-interp-hybrid to setup-cost September 13, 2026 05:51
@chrisfinlay chrisfinlay changed the title Astronomical GP without the padded Fourier grid (GPVisAstDFT) Baseline-axis sharding, and the astronomical GP without the padded grid Sep 13, 2026
@chrisfinlay chrisfinlay changed the title Baseline-axis sharding, and the astronomical GP without the padded grid The astronomical GP without the padded grid Sep 13, 2026
@read-the-docs-community

read-the-docs-community Bot commented Sep 13, 2026

Copy link
Copy Markdown

Documentation build overview

📚 tabascal | 🛠️ Build #34535144 | 📁 Comparing a644938 against latest (3394990)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

…added grid

The Fourier GPs reach a signal by padding the surviving modes up to a grid
twice the data axis in each of frequency and time, inverse-transforming the
whole of it and cropping the padding away. The padded grid is never wanted
for itself: in two dimensions it is about four times the elements of the
visibilities, formed and discarded once per block in the forward pass and
again in reverse, and the astronomical prior keeps very few modes -- at the
scaling benchmark's settings, 1 by 55 of a 16 by 300 grid.

That chain is linear and separable, so the cropped output is a discrete
Fourier transform of the surviving modes evaluated at the positions that
survive the crop: one small matrix per axis, contracted in whichever order
makes the intermediate smaller. `latent_to_signal_dft` is that, and
`ast_vis:GPVisAstDFT` is `GPVisAst` with only this step replaced, so the
prior, the initialisation and the blocking are the parent's and the two can
be compared directly. The phases are reduced as exact integer ratios, so the
matrices are the same in single precision as in double.

The scan over baselines exists to bound the padded grid. With none to bound,
and with its own stack of per-step outputs to pay for, it is a cost on this
transform, so `auto` is a single step here. Measured on a 2016-baseline grid
at 150 integrations, value and gradient together, against the FFT component
at whichever block suited it best: 273.9 MB and 36.5 ms become 190.6 MB and
3.4 ms at 8 channels, 828.6 and 153.2 become 683.8 and 25.2 at 32, and
2386.4 and 596.0 become 1799.1 and 86.1 at 128, where the FFT route runs out
of memory on a 6 GB card if it is not blocked.

Tests hold the transform to the chain it stands for over five grid shapes,
including a single channel, non-default padding and a supersampled axis, and
hold the component to `GPVisAst` in value and in gradient.
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