triton.experimental.gluon.language.amd.cdna5.scaled_upcast

triton.experimental.gluon.language.amd.cdna5.scaled_upcast(src, scale, elem_type, axis=None, _semantic=None)

Upcast an fp4 or fp8 tensor and fold raw E8M0 scale payload into the CDNA5 scaled-upcast op.

The scale tensor must contain raw E8M0 payload in int8 or uint8. elem_type must be fp16 or bf16.

FP8 inputs

  • axis must be None.

  • scale must have the same shape and layout as src.

FP4 inputs

axis selects the packed fp4 dimension. Two scale layouts are supported:

  • Expanded scale: one scale per output value. For example, fp4 bytes [M, K / 2] produce output [M, K] with scale [M, K].

  • Compact scale: one scale per scale block. For example, with axis=1 and a 32-element scale block, output [M, K] uses scale [M, K / 32].