IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 function

filtered_topk_launch

def filtered_topk_launch[in_dtype: DType, RB: RowBound, //, poison: Int = Int(0)](ctx: DeviceContext, in_scores: ImmPointer[Scalar[in_dtype], ImmutAnyOrigin], out_idxs: MutPointer[Int32, MutAnyOrigin], N: Int, K: Int, rows: Int, row_bounds: RB, fallback: MutPointer[UInt8, MutAnyOrigin])

Runs the filtered select's two launches, with the caller's flags.

Every row takes the filtered launch; the rows it flags in fallback ([rows] bytes) take the full select in the second. Callers go through filtered_topk_block_split, which decides when this pays; tests call it directly to read the flags.

Parameters:

  • ​in_dtype (DType): Score dtype (inferred).
  • ​RB (RowBound): Row bound type (inferred).
  • ​poison (Int): A planted fault (FILTER_POISONS), 0 for none.

Args:

Was this page helpful?