Verba/Rapida

Esperimenti #172

The shortlist's top-64 pick as a threshold select (row 171; row 167p's unbuilt half): `r167_topk_part`...

done

Il testo degli esperimenti resta in inglese, come l'ha scritto il laboratorio.

Cosa è stato provato

The shortlist's top-64 pick as a threshold select (row 171; row 167p's unbuilt half): `r167_topk_part` bitonic-sorts every 256-score chunk in full and `r167_topk_merge` runs 64 sequential one-threadgroup rounds, 61.5 plus 53.1 us a step at both lengths for 162,489 scores (`src/topk_select.zig:38`, `:69` at 729d1f79). Find the cut with a count above candidate values (a radix or histogram pass over the row), gather the scores at or above it, and order only those with `r167_before` (argpartition's tie order), so the 64 indices and their order stay identical. Step 1a: microbench at the shape against part plus with row 167f's harness, picks checked equal to argpartition at every size; kill when the new pick takes above 0.6 of the current one

Modello e configurazione

the best

Guadagno atteso

+0.7% to +0.9% (75 to 95 us a step, estimated kernel time)

Da dove viene l'idea

row 171, row 167p

Esito

done 2026-11-19: , decode +0.79% [+0.65, +0.84] (floor 0.05, line +0.4%), replies identical 150 of 150, first +0.4 ms [+0.2, +0.7] (A/A +0.1 [-0.2, +0.3]); scored run mac/172/1; replicated 19:42, +0.85% [+0.71, +0.91] (mac/172/2), the warm first token inside the A/A; adopted 20:30: Lesto main 4acc3806 v0.22.4, tag best-2026-11-19-r172, merged binary 150 of 150 identical (diag172m), ledger lesto_r172 97.3 (`2026-11-19-mac-r172-threshold-select/README.md` § Adoption, row 172)

Lezione

the threshold select that cut the top-64 pick from 91.7 to 27.3 us in the microbench keeps that saving in the engine. Decode rises +0.79% [+0.65, +0.84] (about 82 us a step against 80 predicted), flat across turns, with every reply identical, so a pick kernel's microbench ratio at the served length predicts its decode effect here.

Adottato

yes (Lesto main 4acc3806, tag best-2026-11-19-r172, ledger row lesto_r172)

Vuoi vedere cosa hanno prodotto questi esperimenti? Lesto, il motore di inferenza per Gemma 4 sui Mac con Apple silicon, è su lestoengine.com

Creato da Federico Andrioli, @fedeandri su X Le misure di un laboratorio di ricerca, ricavate direttamente dai suoi file. Dati aggiornati al