Quantize an input FP32 matrix into MXFP4 (Microscaling FP4) using TorchAO's MXTensor reference path.
The quantization contract uses:
For more information regarding the MXFP4 format, check out the MXFP4 specification.
fp32 pointer to a row-major tensor of shape uint8 pointer, MXFP4 payload bytes (packed E2M1 values) of shape uint8 pointer, per-block E8M0 scale bytes in row-major layout of shape Sample Run Results
Hit "Run" to test your code with sample inputs
Loading editor...
CUDA C++ environment
For the best coding experience, please switch to a desktop device to write and submit your solution.