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 function

ssd_state_sm100

def ssd_state_sm100(ctx: DeviceContext, total_len: Int, batch: Int, slots: Int, nheads: Int, ngroups: Int, x_addr: Int, b_addr: Int, x_ld: Int, bc_ld: Int, dt_addr: Int, cs_addr: Int, states_addr: Int, info_addr: Int)

Computes the chunk state of every used chunk slot and head.

Args:

  • ​ctx (DeviceContext): The device context.
  • ​total_len (Int): Tokens of the packed batch.
  • ​batch (Int): Sequences.
  • ​slots (Int): Chunk slots of the table (chunked_slots).
  • ​nheads (Int): Heads.
  • ​ngroups (Int): B groups.
  • ​x_addr (Int): The first element of x, [T, H, P] bf16 with rows x_ld apart.
  • ​b_addr (Int): The first element of B, [T, G, N] bf16 with rows bc_ld apart.
  • ​x_ld (Int): Row stride of x in elements (a multiple of 8).
  • ​bc_ld (Int): Row stride of B in elements (a multiple of 8).
  • ​dt_addr (Int): The softplus dt, fp32 [H, slots, CHUNK].
  • ​cs_addr (Int): The log2 decay cumsum, fp32 [H, slots, CHUNK].
  • ​states_addr (Int): The output, fp32 [slots, H, P, N].
  • ​info_addr (Int): The chunk table, int32 [3 slots + 2 batch].

Was this page helpful?