Scale Convert#

void trt_edgellm::kernels::fusedFp32ToSfAtom(
float const *fp32Scales,
uint8_t *tiledOut,
int32_t numRows,
int32_t numKBlocks,
cudaStream_t stream,
)#

Fused FP32 -> UE4M3 conversion + SfAtom tiled repack in a single kernel.

Reads FP32 scale factors from contiguous [numRows, numKBlocks] layout, converts each to UE4M3, and writes directly to the SfAtom tiled offset.

Output buffer does not need to be pre-zeroed; padding bytes are written by the kernel.

Parameters:
  • fp32Scales – Input FP32 scales [numRows, numKBlocks] row-major

  • tiledOut – Output SfAtom tiled UE4M3 buffer

  • numRows – Number of rows (M for SFA, N for SFB)

  • numKBlocks – Number of K-dimension scale blocks

  • stream – CUDA stream