review notes of the pipelined prefill past two ranks; selftest timings warm the clocks first

Independent review of fa118d8 / 14fb72c: no defect. Notes taken:

- RADIANCE_PREFILL_PIPELINE takes 1 / true as on and 0 / false as off (the old per-arch switches
  took 0 for off; such a value must not leave the pipeline on); the header says that past two
  ranks only the two-shot band is narrow and that eight ranks pipeline on the exact wire only; the
  note says the switch allows the pipeline (gemma3 may still turn it off); "rad_arch.h" as the other
  common headers include it; comment lines rewrapped.
- plugin_test resolves the all-reduce at `overlap` 1 against the real libr4d: the two-shot band
  takes the lane row at three, four and eight ranks, exact and ti8; the one-shot band keeps the wide
  row. arch_test: every spelling of the switch, off at two ranks in all three; no three-rank arch
  case (neither test model's heads split three ways, nor do the real models' KV heads).
- r4d_selftest: gemv_wide's two column tiles at four row tiles and on the per-row scale.
- r4d_selftest: every timed pass is preceded by an untimed one. A fresh process otherwise times its
  first pass while the clocks ramp up from idle (up to 1.5x slow, +-30 % between runs); two builds
  of the same machine code read 13 % apart until both warmed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
mici81andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-24 11:10:08 +02:00
1 parent 284feda3a6
commit ad01fcaf19
5 files changed
+80 -29

No files matched your search

+25
View File
@@ -900,6 +900,31 @@ TEST(libr4d_resolves_the_all_reduce_by_message_size) {
"8192:ar_oneshot_3rank_exact 524288:ar_oneshot_3rank_exact "
"41943040:ar_twoshot_3rank_exact ");
/* At `overlap` 1 (a pipelined prefill's all-reduce beside compute) the two-shot band takes the
* narrow lane row at three, four and eight ranks, exact and, where it exists, lossy; the
* one-shot band has no lane row past two ranks. The lists split at the eight-rank one-shot edge
* as above; at eight ranks the band between it and the wide one-shot bound stays on the plain
* two-shot. */
auto lane = [&](int world, int exact) {
Geometry g;
g.set_i("world_size", world);
g.set_s("dtype", "bf16");
g.set_i("exact", exact);
g.set_i("min_bytes", 128 * 1024);
g.set_i("overlap", 1);
return r.build_bands("all_reduce", "numel", width, chunk * width, g);
};
CHECK_EQ(band_names(lane(3, 1)), "8192:ar_oneshot_3rank_exact 524288:ar_oneshot_3rank_exact "
"5242880:ar_twoshot_3rank_exact_lane ");
CHECK_EQ(band_names(lane(4, 1)), "8192:ar_oneshot_4rank_exact 524288:ar_oneshot_4rank_exact "
"5242880:ar_twoshot_4rank_exact_lane ");
CHECK_EQ(band_names(lane(8, 1)), "8192:ar_oneshot_8rank_exact 524288:ar_twoshot_8rank_exact "
"5242880:ar_twoshot_8rank_exact_lane ");
CHECK_EQ(band_names(lane(3, 0)), "8192:ar_twoshot_3rank_ti8_lane 524288:ar_twoshot_3rank_ti8_lane "
"5242880:ar_twoshot_3rank_ti8_lane ");
CHECK_EQ(band_names(lane(4, 0)), "8192:ar_twoshot_4rank_ti8_lane 524288:ar_twoshot_4rank_ti8_lane "
"5242880:ar_twoshot_4rank_ti8_lane ");
/* Above the two-shot's bound the one-shot takes the message back. */
CHECK_EQ(band_names(bands(4, 1, 131072)),
"8192:ar_oneshot_4rank_exact 524288:ar_oneshot_4rank_exact "