tilelang.contrib.rocm

Utility for ROCm backend

Functions

find_lld([required])

Find ld.lld in system.

rocm_link(in_file, out_file[, lld])

Link relocatable ELF object to shared ELF object using lld

callback_rocm_link(obj_bin)

Links object file generated from LLVM to HSA Code Object

callback_rocm_bitcode_path([rocdl_dir])

Utility function to find ROCm device library bitcodes

parse_compute_version(compute_version)

Parse compute capability string to divide major and minor version

have_matrixcore([compute_version])

Either MatrixCore support is provided in the compute capability or not

get_rocm_arch([rocm_path])

Utility function to get the AMD GPU architecture

find_rocm_path()

Utility function to find ROCm path

Module Contents

tilelang.contrib.rocm.find_lld(required=True)

Find ld.lld in system.

参数:

required (bool) -- Whether it is required, runtime error will be raised if the compiler is required.

返回:

valid_list -- List of possible paths.

返回类型:

list of str

备注

This function will first search ld.lld that matches the major llvm version that built with tvm

Link relocatable ELF object to shared ELF object using lld

参数:
  • in_file (str) -- Input file name (relocatable ELF object file)

  • out_file (str) -- Output file name (shared ELF object file)

  • lld (str, optional) -- The lld linker, if not specified, we will try to guess the matched clang version.

Links object file generated from LLVM to HSA Code Object

参数:

obj_bin (bytearray) -- The object file

返回:

cobj_bin -- The HSA Code Object

返回类型:

bytearray

tilelang.contrib.rocm.callback_rocm_bitcode_path(rocdl_dir=None)

Utility function to find ROCm device library bitcodes

参数:

rocdl_dir (str) -- The path to rocm library directory The default value is the standard location

tilelang.contrib.rocm.parse_compute_version(compute_version)

Parse compute capability string to divide major and minor version

参数:

compute_version (str) -- compute capability of a GPU (e.g. "6.0")

返回:

  • major (int) -- major version number

  • minor (int) -- minor version number

tilelang.contrib.rocm.have_matrixcore(compute_version=None)

Either MatrixCore support is provided in the compute capability or not

参数:

compute_version (str, optional) -- compute capability of a GPU (e.g. "7.0").

返回:

have_matrixcore -- True if MatrixCore support is provided, False otherwise

返回类型:

bool

tilelang.contrib.rocm.get_rocm_arch(rocm_path='/opt/rocm')

Utility function to get the AMD GPU architecture

参数:

rocm_path (str) -- The path to rocm installation directory

返回:

gpu_arch -- The AMD GPU architecture

返回类型:

str

tilelang.contrib.rocm.find_rocm_path()

Utility function to find ROCm path

返回:

path -- Path to ROCm root.

返回类型:

str