[all-commits] [llvm/llvm-project] 22f0c7: [mlir][AMDGPU] 8-bit float usage in the AMDGPU dia...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Wed Feb 15 08:46:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22f0c7a45149a55e643665c4cb69faa960e3c565
      https://github.com/llvm/llvm-project/commit/22f0c7a45149a55e643665c4cb69faa960e3c565
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/AMDGPU/AMDGPU.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
    M mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp
    M mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir
    M mlir/test/Conversion/AMDGPUToROCDL/mfma.mlir
    M mlir/test/Dialect/AMDGPU/invalid.mlir
    M mlir/test/Dialect/AMDGPU/ops.mlir
    M mlir/test/Target/LLVMIR/rocdl.mlir

  Log Message:
  -----------
  [mlir][AMDGPU] 8-bit float usage in the AMDGPU dialect

Upcoming AMD hardware will include functions that accept 8-bit floats.
Specifically, there are MFMA instructions that accept 8-bit floats,
either using the same or mixed formats. This patch adds MLIR wrappers
for these intrinsics and explicitly adds support for 8-bit floats in
the gpu-to-rocdl conversion by way of amdgpu-to-rocdl.

Since LLVM does not have f8 types, when targeting LLVM for compilation
on an AMD GPU, both f8 types used on AMD hardware (f8E5M2FNUZ and
f8E4M3FNUZ) are rewritten to i8.

This patch also relaxes the restriction that the types of both source
operands to a amdgpu.mfma instructions match exactly, as this is not
necessarily required for the bf8 (f8E5M2FNUZ) and fp8 (f8E4M3FNUZ)
instructions. In addition, since the buffer_{load,store} operations
maintain a whitelist of permitted types, we add the relevant f8 types
to that list.

This patch does not add any implementations of arithmetic operations
for f8 types.

Reviewed By: jakeh-gc

Differential Revision: https://reviews.llvm.org/D143956




More information about the All-commits mailing list