For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
load_frequencies
def load_frequencies[pairs: Int](frequencies: ImmPointer[Float32, ImmutAnyOrigin], row: Int, first_pair: Int) -> Tuple[SIMD[.float32, pairs], SIMD[.float32, pairs]]
Loads the cosines and sines of consecutive RoPE pairs.
A frequency row holds 32 cosines, then 32 sines.
Parameters:
- pairs (
Int): The number of pairs.
Args:
- frequencies (
ImmPointer[Float32, ImmutAnyOrigin]): The frequency table, aligned to4 * pairsbytes. - row (
Int): The offset of the position's row. - first_pair (
Int): The first pair, a multiple ofpairs.
Returns:
Tuple[SIMD[.float32, pairs], SIMD[.float32, pairs]]: The cosines and the sines.
def load_frequencies[pairs: Int](frequencies: TileTensor[.float32, Engine=frequencies.Engine, address_space=frequencies.address_space, linear_idx_type=frequencies.linear_idx_type], position: Int, first_pair: Int) -> Tuple[SIMD[.float32, pairs], SIMD[.float32, pairs]]
Loads the cosines and sines of consecutive RoPE pairs from a table.
A frequency row holds 32 cosines, then 32 sines.
Parameters:
- pairs (
Int): The number of pairs.
Args:
- frequencies (
TileTensor[.float32, Engine=frequencies.Engine, address_space=frequencies.address_space, linear_idx_type=frequencies.linear_idx_type]): The frequency table, one row per position, with rows aligned to4 * pairsbytes. - position (
Int): The position's row. - first_pair (
Int): The first pair, a multiple ofpairs.
Returns:
Tuple[SIMD[.float32, pairs], SIMD[.float32, pairs]]: The cosines and the sines.