Archived
The R-th largest of a row's 64 sub-group maxima is a lower bound on its R-th largest key (those maxima are R distinct elements), so the row's top R are among the keys at or above it -- a few dozen on real logits. A second read gathers them into local memory, and a survivor's place is the count of survivors above it: the keys carry the column and are distinct, so that is the order the serial passes produce. More than 4096 survivors (a row of equal values) takes the passes over the row. bf16 rows are read 8 values a 16-byte load. XE2_TOPK_CHUNKS=1 keeps the two-stage form. The two-stage form was 846 + 86 us a round (unitrace, M = 15, N = 248320, R = 32); this one 37 us. rad-kbench against libref: fixture 21/21, Qwen3.8-27B-DFLASH2-PARO-M2XFP4 (R = 32) 14/14 and qwen3.8-27b-w4a16-rtn (R = 1) 12/12, all at rel_l2 0; greedy output identical (8/8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>