Skip to content

X34: two grid phases for long mixed rows where L3 per CPU is small (lead c) - #21

Merged
jtravs merged 12 commits into
mainfrom
exp/x34-xeon-mixed
Nov 16, 2026
Merged

jtravs merged 12 commits into
mainfrom
exp/x34-xeon-mixed

Conversation

@jtravs

@jtravs jtravs commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Experiment X34 (PLAN lead (c)): the Xeon's long rows of mixed length.

Diagnosis (Xeon 6240: private 1 MiB L2, 0.7 MiB of L3 per CPU)

  • Chains lose at every grid row: 1.05–1.45 of the grid, whatever the rule's key.
  • 100000 was a three-phase grid, 40 × 50 × 50, in blocks of 4 columns (one register per row). It ran 8.05M instructions per transform, against 2.35M for FFTW.
  • Counters on 100000: two phases (200 × 500) take 0.70 of the cycles; three phases in blocks of 20 take 0.80.
  • On 15 mixed rows from 71680 to 4 × 10^6 points with an odd part of 15 or more, two phases took 0.70–1.01 of the cycles. Rows nearer a power of two (odd part 3–9) lost up to 1.13.
  • On the EPYC 7763, two phases lose (1.13–1.67) below 16 MiB.

Change

  • New profile field grid_two_odd_part (fbench knob GRID_TWO_ODD_PART), set to 15 where a private L2 has less than 2 MiB of L3 per CPU behind it, i.e. where X29's chains do not apply.
  • On those machines, a row whose odd part is at least 15 stays in two grid phases at any size.
  • The EPYC and the Mac change no plan.
  • Arm b (blocks that are other multiples of the lanes) was dropped: arm c supersedes it.

Results (Xeon, GCC 14, avx512)

  • Run 20261116-125601-0542, 23 mixed rows: 0.861 over the 14 rows whose plan changes, none slower. 100000 0.711, 10^6 0.724, 2·10^6 0.742.
  • 100000: 2.03 → 1.44 of FFTW, 1.34 → 0.95 of MKL.
  • Tracking tier, run 20261116-131703-f74f: 0.995. 100000 0.706, nothing else outside the band.

Details: dev/experiments/X34-xeon-mixed.md.

Not covered: Granite Rapids in an 8-vCPU VM reports 63 MiB of L3 per CPU, so X29's chains still apply there.

🤖 Generated with Claude Code

jtravs and others added 12 commits November 16, 2026 11:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m b)

100000 = 40 x 50 x 50 on avx512 takes blocks of 20 columns instead of 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… narrowest block (X34 arm b)

Keeps every plan whose power-of-two block is wider than max(2, lanes) (EPYC 51200, 256000,
the Mac's 51200 and 55296 would otherwise have changed, some to narrower blocks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Superseded by two phases for these rows (arm c): 100000 in three phases with blocks of 20
took 0.80 of main's cycles on the Xeon, in two phases with main's blocks of 4 0.69-0.73;
with two phases no measured row has the narrowest power-of-two block in three phases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…where L3 per CPU is small (X34 arm c)

On the Xeon 6240 (private 1 MiB L2, 0.7 MiB of L3 per CPU) two phases took 0.70-0.92 of
the three phases' cycles on every mixed row measured from 71680 to 4 x 10^6 points with an
odd part of 15 or more (100000 0.73, 10^6 0.70); rows nearer a power of two lost (odd part
3-9: up to 1.13). New profile field grid_two_odd_part (fbench GRID_TWO_ODD_PART), set to 15
where a private L2 has less than 2 MiB of L3 per CPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… PLAN

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	bench/README.md
#	bench/backends/fftn.cpp
#	dev/DESIGN.md
#	dev/LESSONS.md
#	dev/PLAN.md
@jtravs
jtravs merged commit 5b02f07 into main Nov 16, 2026
12 checks passed
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