For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
topk_per_row
Top-k with a pick count per row, for the DeepSeek-V4 indexer.
Selection runs on the block-wide bitonic and histogram-select kernels in
topk_bitonic, which pick all k elements together. The two-stage
topk_gpu extracts one element per round, so at k = 512 it is a few
hundred serial reductions per row. This file only supplies the output stage: a sink that
turns each selected column into the (value, index) pair the graph op
returns.
comptime valuesβ
TOPK_PER_ROW_MAX_Kβ
comptime TOPK_PER_ROW_MAX_K = PERSISTENT_TOPK_MAX_N
Largest max_k topk_per_row_gpu accepts.
Functionsβ
- β
topk_per_row_gpu: Selects the firstk[r]picks of each row's top-max_k.