[Mlir-commits] [mlir] [MLIR][AMDGPU] Add OCP FP8 support for new hardware (PR #106160)

Paul C Fuqua llvmlistbot at llvm.org
Wed Sep 18 12:39:10 PDT 2024


================
@@ -454,6 +454,20 @@ static void wmmaPushOutputOperand(ConversionPatternRewriter &rewriter,
   }
 }
 
+/// Return true if `type` is the E5M2 variant of an 8-bit float that is
+/// supported by the `_bf8` instructions on the given `chipset`.
+static bool isNativeBf8(Chipset chipset, Type type) {
+  return (chipset.isGfx940() && type.isFloat8E5M2FNUZ()) ||
+         (chipset.hasOcpFp8() && type.isFloat8E5M2());
+}
+
+/// Return true if `type` is the E4M3FN variant of an 8-bit float that is
+/// supported by the `_fp8` instructions on the given `chipset`.
+static bool isNativeFp8(Chipset chipset, Type type) {
----------------
pcf000 wrote:

This file uses "FP8" extensively, but both as a generic term for Float8 and as the specific for 4.3 (with "BF8" for 5.2).  The two isNative functions are doing the latter.

https://github.com/llvm/llvm-project/pull/106160


More information about the Mlir-commits mailing list