pub fn fp8_gemm_act_weight_t_blkscaled_ldc(
act_fp8: u64,
act_scale: u64,
weight_fp8: u64,
weight_block_scale: u64,
out: u64,
m: u32,
n: u32,
k: u32,
ldc: u32,
stream: u64,
) -> Result<()>Expand description
fp8_gemm_act_weight_t_blkscaled with an explicit output ROW PITCH.
WHY (#927, the 5..16-row decode projections). cuBLASLt’s D operand is a
column-major [N, M] layout with leading dimension ldc, which is exactly
a row-major [M, N] whose rows are ldc BF16 elements apart — so one
parameter is the whole difference between a contiguous [M, N] output and
writing straight into a strided slot. The multi-seq decode QKV buffer is
[n, per_seq_qkv] with Q at 0, K at q_proj_bytes and V after it, so
ldc = per_seq_qkv / 2 puts each row’s n outputs in its own sequence’s
slot with the gaps left alone — the same thing the _strided GEMV entry
points do, without a staging buffer or a scatter kernel.
⚠ WRITE EXTENT. The library writes n elements of EACH of the m columns,
i.e. the last byte touched is at element (m - 1) * ldc + n. m here is
the caller’s PADDED row count, so the phantom rows are written too; callers
must bound that extent against their buffer — see
spark_model::layers::ops::strided_out_extent_elems, which is the SSOT for
the arithmetic and is unit-tested on the CPU.
ldc >= n is required by the library (a leading dimension shorter than the
column is rejected); it is checked here so the failure names itself instead
of arriving as a cuBLAS status code.