IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo function

update_frequency_data_kernel

def update_frequency_data_kernel[freq_data_origin: MutOrigin, FreqDataLayoutType: TensorLayout, freq_offsets_origin: ImmutOrigin, FreqOffsetsLayoutType: TensorLayout, new_tokens_origin: ImmutOrigin, NewTokensLayoutType: TensorLayout, token_type: DType, block_size: Int](compressed_frequency_data: TileTensor[DType.int32, FreqDataLayoutType, freq_data_origin], frequency_offsets: TileTensor[DType.uint32, FreqOffsetsLayoutType, freq_offsets_origin], new_tokens: TileTensor[token_type, NewTokensLayoutType, new_tokens_origin])

GPU kernel to update token frequency data in CSR format.

Searches for new tokens in existing frequency data and either increments their count or adds them to the first available padding slot.