For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo module
topk_bitonic
Block-wide bitonic sort top-k for the MLA/MSA indexer.
Replaces topk_gpu, which is pathological when k β N (e.g. the
k = N = 2048 DeepSeek-V3 / MiniMax-M3 indexer config). For N > 2048 a
streaming variant folds TILE-wide tiles into a running top-TILE
champion, selecting K β€ TILE out of arbitrarily large N.
comptime valuesβ
PERSISTENT_TOPK_MAX_Nβ
comptime PERSISTENT_TOPK_MAX_N = Int(2048)
Functionsβ
- β
persistent_topk_block: Launch block-wide bitonic top-k fortotal_seq_lenscore rows. - β
persistent_topk_block_split: Launch bitonic top-k, splitting the N dimension when rows under-fill GPU.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!