xla icon indicating copy to clipboard operation
xla copied to clipboard

Make it possible to lower fp8 `tt.splat`.

Open copybara-service[bot] opened this issue 1 year ago • 0 comments
trafficstars

Make it possible to lower fp8 tt.splat.

Before the fix, tt.splat was lowered to e.g.

%14 = "llvm.mlir.constant"() <{value = 0.000000e+00 : f8E4M3FNUZ}> : () -> f8E4M3FNUZ

which LLVM rejected.

Translating the result type through typeConverter is what is done in other similar places. It results in

%14 = "llvm.mlir.constant"() <{value = 0.000000e+00 : f8E4M3FNUZ}> : () -> i8

and it's accepted by LLVM. During the MLIR to LLVM lowering, the fp8 value is converted to i8 with the correct binary representation.

The isFloat() function that is updated happened to have just one caller (in ArithConstantSplatOpConversion)

copybara-service[bot] avatar May 13 '24 09:05 copybara-service[bot]