Skip to content

Conversation

@PMylon
Copy link
Contributor

@PMylon PMylon commented Jul 17, 2025

This commit replaces shell out to ROCm's lld by directly calling the lld library API.

Fixes https://github.com/ROCm/triton-internal/issues/997

@PMylon PMylon changed the title [AMD] Enable lld [AMD] Use lld library API Jul 18, 2025
Copy link
Collaborator

@antiagainst antiagainst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! Just a few nits.

@PMylon PMylon marked this pull request as ready for review July 18, 2025 18:04
@PMylon PMylon requested a review from zhanglx13 as a code owner July 18, 2025 18:04
@antiagainst antiagainst merged commit 3bd3e32 into triton-lang:main Jul 18, 2025
9 checks passed
antiagainst pushed a commit that referenced this pull request Jul 22, 2025
The PR #7548 requires the use
of LLD as part of LLVM (as opposed to the system LDD), which causes the
following error when
- (1) ldd is not built, or 

- (2) the location of the `LLD_DIR` is not specified correctly:

```
      CMake Error at third_party/amd/CMakeLists.txt:6 (find_package):
        Could not find a package configuration file provided by "LLD" with any of
        the following names:
      
          LLDConfig.cmake
          lld-config.cmake
```

To fix this issue, this PR made the following changes:

- For (1), build lld in `scripts/build-llvm-project.sh`, which is
invoked by `make dev-install-llvm`. The script was added in README in
#6709, and building ldd was
added in #6049.

- For (2), make sure that `LLVM_BUILD_PATH` is an absolute path in
Makefile, so `LLD_DIR` and `MLIR_DIR` are interpereted correctly.
Otherwise CMake has hard time finding the relative location with
CMakeLists.txt in a subdirectory.
- Introduce `LLD_DIR` so we don't write `"${MLIR_DIR}/../lld"`.
@staticmethod
def path_to_rocm_lld():
# Check env path for ld.lld
lld_env_path = knobs.amd.lld_path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this knob can now be removed

lld_path: env_opt_str = env_opt_str("TRITON_HIP_LLD_PATH")

antiagainst pushed a commit that referenced this pull request Jul 31, 2025
stadlmax pushed a commit to stadlmax/triton that referenced this pull request Aug 4, 2025
stadlmax pushed a commit to stadlmax/triton that referenced this pull request Aug 4, 2025
ptillet pushed a commit that referenced this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants