Skip to content

Commit c99d754

Browse files
authored
[AMD] support reading hip lld path from env variables (intel#3917)
When compiling AMD Triton kernels on non-AMD GPU machines, we didn't have either "/opt/rocm/llvm/bin/ld.lld" or "/usr/bin/ld.lld" paths. In such case, introduce an `TRITON_HIP_LLD_PATH` env variable to a third-party path. We had such support in the forked version. This PR added the support to the upstream version.
1 parent 5d5f3c8 commit c99d754

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

third_party/amd/backend/compiler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ def load_dialects(self, ctx):
8585

8686
@staticmethod
8787
def path_to_rocm_lld():
88-
# First check backend for ld.lld (used for pytorch wheels)
88+
# Check env path for ld.lld
89+
lld_env_path = os.getenv("TRITON_HIP_LLD_PATH")
90+
if lld_env_path is not None:
91+
lld = Path(lld_env_path)
92+
if lld.is_file():
93+
return lld
94+
# Check backend for ld.lld (used for pytorch wheels)
8995
lld = Path(__file__).parent / "llvm/bin/ld.lld"
9096
if lld.is_file():
9197
return lld

0 commit comments

Comments
 (0)