Skip to content

Stabilize Distributed LU and addition allocation checks - #843

Merged
jpsamaroo merged 2 commits into
masterfrom
jps/benchmark-fixed-placement
Nov 29, 2026
Merged

jpsamaroo merged 2 commits into
masterfrom
jps/benchmark-fixed-placement

Conversation

@jpsamaroo

Copy link
Copy Markdown
Member

Why

BenchmarkTools measures allocations on the driver. With Distributed placement, the same operation can put different tiles on the driver and report very different allocation totals. That makes the allocation checks for ordinary LU and addition sensitive to scheduler placement.

Changes

  • Add Distributed CPU lu! and in-place addition leaves with cyclic workspaces or destinations. Keep the ordinary leaves for end-to-end timings and their original allocation measurements.
  • Report ordinary LU allocation counts and bytes, and ordinary X + X bytes, as advisories when the same shape has at least five usable fixed-placement samples on each revision. Fixed measurements, timing, and ordinary addition counts still gate. A missing or incomplete peer keeps the original gate active.
  • Show advisories separately in the CI reports and include an opt-in probe for tile ownership, numeric correctness, and per-process allocations.

Validation

  • Across three fresh Julia sessions with 30 samples per operation, LU driver-byte spread went from 96.4% for ordinary LU to 2.6% for the fixed-workspace leaf. The fixed leaf always placed 16 tiles per process.
  • Under a same-revision scheduler-pressure intervention, ordinary addition driver bytes shifted −36.1% and the fixed leaf shifted +0.24%. Idle addition still showed some allocation outliers.
  • The comparator and aggregate-report tests cover matching, missing and incomplete peers, fixed regressions, the retained addition count gate, timing, and non-Distributed configurations.
  • Replayed the archived Datadeps: free copies of identity-less arguments again, and give each its own slot #833 results with five new fixed BenchmarkTools samples per revision, measured locally on its archived master and merge revisions. The two Distributed LU allocation flags and the Distributed addition byte flag became advisories. The single-process sin.(X) timing regression still failed. The fixed samples in this replay are local measurements.

An allocating kernel may move whole tile payloads between processes even when both samples use the same input grid. Preserve those end-to-end measurements and add in-place leaves that hold workspace ownership fixed. Provide a separate diagnostic for ownership and process-level allocations.
Keep allocating LU count and byte changes and ordinary addition byte changes visible for review when five measured samples on the matched fixed leaf provide that allocation gate on both revisions. Preserve the addition count gate, timing, the original fallback, and the other leaves and backends.
@github-actions

Copy link
Copy Markdown
Contributor

Dagger benchmarks: dirty vs master

Counts are benchmark metrics (time, allocations, bytes). Timing changes require non-overlapping median ± IQR bands; both revisions need at least five timed samples, and timing regressions need an independent confirmation run.

Backend Regressions Improvements Within noise Inconclusive time Suites
Threads 0 1 11 0 4/4
Distributed 0 0 0 2 4/4
Distributed+Threads 0 0 1 1 4/4
MPI 0 1 2 0 4/4
MPI+Threads 0 1 18 4 4/4
Total 0 3 32 7 20/20

Regressions across all backends

None in the available results.

Improvements across all backends

Backend Benchmark Metric Change
Threads stencil/dagger/N=256 (block 128)/alloc (neighbors Wrap) time -62.3%
MPI+Threads array/dagger/N=1024 (block 128)/broadcast (X .+ 1) time -50.5%
MPI linalg/dagger/N=1024 (block 128)/cholesky time -35.8%

Advisory allocation changes

Paired fixed-placement measurements gate Distributed CPU allocating LU counts and bytes and allocating X + X bytes. Review the advisory changes for costs specific to the allocating path. The original X + X count gate still applies.

Backend Benchmark Metric Change
Distributed array/dagger/N=1024 (block 128)/add (X + X) memory -38.5%
Threads (1 process × 4 threads) — 0 regressions, 1 improvements
Suite Regressions Improvements Within noise Inconclusive time
array 0 0 7 0
linalg 0 0 2 0
sparse 0 0 0 0
stencil 0 1 2 0

Improvements

Benchmark Metric Change
stencil/dagger/N=256 (block 128)/alloc (neighbors Wrap) time -62.3%

Within noise

Benchmark Metric Change
linalg/dagger/N=1024 (block 512)/matvec (A*x) time +107.8%
stencil/dagger/N=1024 (block 128)/update (+) time +65.7%
array/dagger/N=1024 (block 512)/reduce (sum) time +58.1%
array/dagger/N=1024 (block 128)/transpose (permutedims) time +46.7%
linalg/dagger/N=256 (block 256)/matvec (A*x) time +35.4%
array/dagger/N=256 (block 128)/add (X + X) time +34.1%
stencil/dagger/N=256 (block 128)/assign (const) time +33.2%
array/dagger/N=1024 (block 512)/alloc (rand) time +33.2%
array/dagger/N=1024 (block 128)/broadcast (X .+ 1) time -38.4%
array/dagger/N=256 (block 128)/reduce (sum) time -45.9%
array/dagger/N=1024 (block 128)/alloc (rand) time -46.8%
Distributed (4 processes × 1 thread) — 0 regressions, 0 improvements
Suite Regressions Improvements Within noise Inconclusive time
array 0 0 0 1
linalg 0 0 0 0
sparse 0 0 0 0
stencil 0 0 0 1

Inconclusive timing changes

Benchmark Metric Change
stencil/dagger/N=256 (block 128)/neighbors (Pad) time +42.1%
array/dagger/N=1024 (block 512)/reduce (sum) time +39.9%
Distributed+Threads (2 processes × 2 threads) — 0 regressions, 0 improvements
Suite Regressions Improvements Within noise Inconclusive time
array 0 0 1 1
linalg 0 0 0 0
sparse 0 0 0 0
stencil 0 0 0 0

Within noise

Benchmark Metric Change
array/dagger/N=1024 (block 512)/broadcast (X .+ 1) time +44.4%

Inconclusive timing changes

Benchmark Metric Change
array/dagger/N=1024 (block 512)/transpose (permutedims) time +51.5%
MPI (4 ranks × 1 thread) — 0 regressions, 1 improvements
Suite Regressions Improvements Within noise Inconclusive time
array 0 0 1 0
linalg 0 1 1 0
sparse 0 0 0 0
stencil 0 0 0 0

Improvements

Benchmark Metric Change
linalg/dagger/N=1024 (block 128)/cholesky time -35.8%

Within noise

Benchmark Metric Change
linalg/dagger/N=256 (block 128)/matvec (A*x) time -46.1%
array/dagger/N=1024 (block 128)/transpose (permutedims) time -46.6%
MPI+Threads (2 ranks × 2 threads) — 0 regressions, 1 improvements
Suite Regressions Improvements Within noise Inconclusive time
array 0 1 7 1
linalg 0 0 3 1
sparse 0 0 0 1
stencil 0 0 8 1

Improvements

Benchmark Metric Change
array/dagger/N=1024 (block 128)/broadcast (X .+ 1) time -50.5%

Within noise

Benchmark Metric Change
array/dagger/N=256 (block 128)/broadcast (X .+ 1) time +281.7%
array/dagger/N=1024 (block 512)/broadcast (X .+ 1) time +87.5%
array/dagger/N=256 (block 128)/map (sin.(X)) time +81.2%
linalg/dagger/N=256 (block 256)/syrk (A'*A) time +70.8%
array/dagger/N=256 (block 256)/add (X + X) time +67.9%
linalg/dagger/N=256 (block 128)/syrk (A'*A) time +61.6%
stencil/dagger/N=256 (block 256)/update (+) time +59.0%
array/dagger/N=1024 (block 512)/add (X + X) time +48.8%
stencil/dagger/N=256 (block 128)/update (+) time +42.0%
stencil/dagger/N=256 (block 256)/neighbors (Wrap) time +40.8%
array/dagger/N=1024 (block 512)/norm time +37.6%
array/dagger/N=256 (block 128)/alloc (rand) time +36.1%
stencil/dagger/N=1024 (block 512)/assign (const) time -36.7%
stencil/dagger/N=1024 (block 512)/neighbors (Reflect) time -36.7%
linalg/dagger/N=256 (block 128)/matvec (A*x) time -39.4%
stencil/dagger/N=1024 (block 512)/update (+) time -45.4%
stencil/dagger/N=256 (block 128)/neighbors (Reflect) time -45.6%
stencil/dagger/N=256 (block 128)/neighbors (Clamp) time -48.5%

Inconclusive timing changes

Benchmark Metric Change
array/dagger/N=256 (block 128)/transpose (permutedims) time +115.1%
stencil/dagger/N=256 (block 256)/neighbors (Pad) time +50.1%
linalg/dagger/N=1024 (block 128)/matvec (A*x) time +46.4%
sparse/dagger/N=256 (block 16)/spgemm (S*S) time +35.5%

Full results and plots (download the benchmark-results-* artifacts).

@jpsamaroo
jpsamaroo merged commit 8e29b85 into master Nov 29, 2026
56 of 62 checks passed
@jpsamaroo
jpsamaroo deleted the jps/benchmark-fixed-placement branch November 29, 2026 19:09
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