jax.experimental.pallas.mosaic_gpu.format_tcgen05_sparse_metadata

jax.experimental.pallas.mosaic_gpu.format_tcgen05_sparse_metadata#

jax.experimental.pallas.mosaic_gpu.format_tcgen05_sparse_metadata(meta, operand_dtype)[source]#

Formats the sparse metadata for tcgen05.mma into the expected format.

See https://docs.nvidia.com/cuda/parallel-thread-execution/#tcgen05-sparse-matrices-sparsity-selector-kind-f16-m128-256 for the documentation of the required layouts. The array can be copied into SMEM, from where plgpu.async_copy_sparse_metadata_to_tmem can be used to copy it over to TMEM. The formatting of the array depends on the data type of the operands to the sparse MMA operation.

Parameters:
  • meta – Metadata of shape (M, K // 4, 2).

  • dtype – Data type of MMA operands.