pub fn nvfp4_tc_lean_repack(
gpu: &dyn GpuBackend,
kernel: KernelHandle,
packed: DevicePtr,
scale: DevicePtr,
n: u32,
k: u32,
bad: DevicePtr,
stream: u64,
) -> Result<()>Expand description
2026-09-27: Grouped NVFP4 down over the SiLU product. k is the intermediate width; rows
of act and output are sorted positions, rows of sh_act and sh_down_out tokens.
2026-10-04: Repacks one row-major NVFP4 matrix [n, k] (packed E2M1 [n, k / 2] at packed,
E4M3 block scales [n, k / 16] at scale) in place into the lean layout the _lean
tensor-core expert kernels read (nvfp4_tc_lean_repack, moe_nvfp4_grouped_tc.cu): same bytes
and size, outputs byte-identical to the row-major point. Sets the device u32 at bad (zeroed
by the caller) on a negative or NaN scale, after which the matrix is unusable. Needs
nvfp4_lean_repack_shape_ok.