[MUH] Derive BI-V100 tuning values from hardware specs — fix 5 SMEM overflow bugs

Previous values were copied verbatim from SM100 (B200). Three of those
crash on BI-V100 because tile_size = threads * items * accum_size exceeds
the 48KB SMEM limit:

REDUCE:
  float64+o4: SM100(640,16) → tile=81920 > 49152 → BI-V100(512,12) tile=49152
  int64+o4:   SM100(512,15) → tile=61440 > 49152 → BI-V100(384,16) tile=49152
  int64+o8:   SM100(512,15) → tile=61440 > 49152 → BI-V100(384,16) tile=49152

SCAN:
  8B_o4: SM100(416,23) → tile=76544 > 49152 → BI-V100(416,14) tile=46592
  8B_o8: SM100(320,22) → tile=56320 > 49152 → BI-V100(320,19) tile=48640

SCAN DELAY DERIVATION:
  SM100 L2=50MB, BI-V100 L2=6MB (8.3x smaller cache).
  Smaller L2 → faster coherence → shorter busy-wait delays.
  Applied: ns *= 0.5, l2w *= 0.6 across all 6 lookback tunings.
  Example: 4B_o4 delay 1904ns→952ns, l2w 830→498.

TRANSFORM:
  min_bytes_in_flight: SM100=64KB but BI-V100 per-SM BW (18 GB/s) matches
  A100 (18.5 GB/s), not H100/B200. Changed 48KB → 16KB (A100 level).

compile_test: 35/35 including SMEM overflow regression test.
This commit is contained in:
Claude
2026-07-30 15:08:30 +00:00
parent c7a63bc2c8
commit 4c796fe4b3
4 changed files with 94 additions and 88 deletions

View File

@@ -106,6 +106,17 @@ int main() {
CHECK_EQ(p.lookback.threads_per_block, 384, "scan.f32.lookback.threads=384");
CHECK_EQ(p.lookback.items_per_thread, 22, "scan.f32.lookback.items=22");
CHECK_NONZERO(p.lookahead.reduce_and_scan_warps, "scan.f32.lookahead.warps");
// 8-byte scan: was SMEM overflow with SM100 values (416*23*8=76544 > 49152)
auto ps8 = policy_selector{
.input_value_size = 8, .accum_size = 8, .offset_size = 4,
.input_type = type_t::int64, .accum_type = type_t::int64,
.operation_t = op_kind_t::plus, .is_primitive_accum = true,
};
auto p8 = ps8(hw);
CHECK_EQ(p8.lookback.items_per_thread, 14, "scan.8B.items=14(derived)");
CHECK_TRUE(p8.lookback.threads_per_block * p8.lookback.items_per_thread * 8 <= 49152,
"scan.8B.tile_fits_48KB_smem");
}
// --- batch_memcpy: two-tier ---