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

def update_frequency_data[token_type: DType, //, target: StringSlice[StaticConstantOrigin]](compressed_frequency_data: TileTensor[DType.int32, linear_idx_type=compressed_frequency_data.linear_idx_type, element_size=compressed_frequency_data.element_size], frequency_offsets: TileTensor[DType.uint32, linear_idx_type=frequency_offsets.linear_idx_type, element_size=frequency_offsets.element_size], new_tokens: TileTensor[token_type, linear_idx_type=new_tokens.linear_idx_type, element_size=new_tokens.element_size], ctx: DeviceContext)

Update the frequency data for the given new tokens.

The frequency data is stored in a CSR format. This kernel expects there will be enough padding for each sequence to store the new tokens.