Skip to main content

Mojo function

update_frequency_data_kernel

update_frequency_data_kernel[token_type: DType, block_size: Int, freq_data_layout: Layout, freq_offsets_layout: Layout, new_tokens_layout: Layout](compressed_frequency_data: LayoutTensor[int32, freq_data_layout, MutableAnyOrigin], frequency_offsets: LayoutTensor[uint32, freq_offsets_layout, MutableAnyOrigin], new_tokens: LayoutTensor[token_type, new_tokens_layout, MutableAnyOrigin])

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.

Was this page helpful?