flashinfer.sdsa.token_sparse.compact_nvfp4_scratch_numel

flashinfer.sdsa.token_sparse.compact_nvfp4_scratch_numel(groups: int, max_keys: int, out_rows: int) → int

int32 elements of compact_nvfp4_kv_cache()’s scratch: a prefix row per group, the groups’ sizes and key ends, and a key per output row.

Parameters:
  • groups (int) – Groups of the launch.

  • max_keys (int) – The launch’s max_keys.

  • out_rows (int) – Rows of the launch’s out.

Returns:

The workspace size in int32 elements.

Return type:

int