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

Mojo trait

SparseIndexRemap

A second output a sparse-index producer writes beside each logical slot.

Lets the kernel that selects the logical indices also emit what a consumer would otherwise derive from them in a separate pass.

Implemented traits​

AnyType, Copyable, Deinitable, DevicePassable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable

comptime members​

enabled​

comptime enabled

Whether store writes anything; False lets callers skip the batch lookup it would need.

Required methods​

offset​

def offset(self, slots: Int) -> Self

Returns this remap with its output advanced by slots slots.

Args:

  • ​slots (Int): Flat slots to advance by.

Returns:

_Self: The advanced remap.

store​

def store(self, idx: Int, batch: Int, logical: Int32)

Writes the remapped value of output slot idx.

Args:

  • ​idx (Int): Flat output slot.
  • ​batch (Int): Batch entry the slot's row belongs to.
  • ​logical (Int32): The slot's logical token position, or -1.

Was this page helpful?