triton.experimental.gluon.language.amd.cdna5.scaled_downcast
- triton.experimental.gluon.language.amd.cdna5.scaled_downcast(input, scale, format, axis=-1, _semantic=None)
Scale and convert FP16, BF16, or FP32 values to a low-precision MX format.
Divide input values by the raw E8M0
scalepayload (int8oruint8).formatselects the target type and packing behavior:"e4m3"/"e5m2"(fp8): elementwise, so the output keeps the shape and layout ofinput."e2m1"(packed fp4): consecutive pairs of values alongaxisare packed into one output byte (even element -> low nibble, next element -> high nibble), so the result extent alongaxisis halved (the inverse ofscaled_upcast).
axis(default: last dim) selects the dimension along which scales are shared.scaleprovides one E8M0 byte per block of consecutive input elements alongaxis. The block size must be a power of two and a multiple of 2 on CDNA4 or 8 on CDNA5. For packed FP4, CDNA4 permits one scale per output byte. The block size and scale layout are checked when the kernel is compiled.