From 6b2d1dd35fff07135e5c4e66f55e9b5128ed591f Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 15 May 2026 17:16:26 -0700 Subject: [PATCH] Add F6E3M2FN and F6E2M3FN to xla::PrimitiveType. This CL introduces first-class declarations for two 6-bit floating point formats: - F6E3M2FN (3 exponent bits, 2 mantissa bits) - F6E2M3FN (2 exponent bits, 3 mantissa bits) These types conform to the OCP Microscaling Formats (MX) specification: https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf The encoding parameters are as follows: FP6 E3M2 (Exponent bias: 3) - Max normal: +/-28.0 - Min normal: +/-0.25 - Max subnormal: +/-0.1875 - Min subnormal: +/-0.0625 FP6 E2M3 (Exponent bias: 1) - Max normal: +/-7.5 - Min normal: +/-1.0 - Max subnormal: +/-0.875 - Min subnormal: +/-0.125 PiperOrigin-RevId: 916256455 --- tsl/platform/ml_dtypes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tsl/platform/ml_dtypes.h b/tsl/platform/ml_dtypes.h index b536e2f8a..b035546ca 100644 --- a/tsl/platform/ml_dtypes.h +++ b/tsl/platform/ml_dtypes.h @@ -30,6 +30,8 @@ using float8_e4m3b11fnuz = ::ml_dtypes::float8_e4m3b11fnuz; using float8_e5m2 = ::ml_dtypes::float8_e5m2; using float8_e5m2fnuz = ::ml_dtypes::float8_e5m2fnuz; using float8_e8m0fnu = ::ml_dtypes::float8_e8m0fnu; +using float6_e3m2fn = ::ml_dtypes::float6_e3m2fn; +using float6_e2m3fn = ::ml_dtypes::float6_e2m3fn; using int1 = ::ml_dtypes::int1; using uint1 = ::ml_dtypes::uint1;