Skip to main content

Mojo function

update_frequency_data

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

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.

Was this page helpful?