tilelang.contrib.rocm¶
Utility for ROCm backend
Functions¶
|
Find ld.lld in system. |
|
Link relocatable ELF object to shared ELF object using lld |
|
Links object file generated from LLVM to HSA Code Object |
|
Utility function to find ROCm device library bitcodes |
|
Parse compute capability string to divide major and minor version |
|
Either MatrixCore support is provided in the compute capability or not |
|
Utility function to get the AMD GPU architecture |
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
- tilelang.contrib.rocm.rocm_link(in_file, out_file, lld=None)¶
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.
- tilelang.contrib.rocm.callback_rocm_link(obj_bin)¶
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
- 返回类型:
- 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