Skip to main content
Log in

Mojo function

topp_minp_sampling_kernel

topp_minp_sampling_kernel[type: DType, out_idx_type: DType, is_top_p: Bool](p_thresholds_: UnsafePointer[SIMD[type, 1]], sorted_probs_: UnsafePointer[SIMD[type, 1]], sorted_ids_: UnsafePointer[SIMD[out_idx_type, 1]], out_token_ids: UnsafePointer[SIMD[out_idx_type, 1]], skip_sort: UnsafePointer[SIMD[bool, 1]], vocab_size: Int)

Top P-Min P sampling kernel.

Parameters:

  • type (DType): DType - scalar values dtype.
  • out_idx_type (DType): DType - output index type.
  • is_top_p (Bool): Bool - Whether to use Top-P (True) or Min-P (False) sampling.