[Issue]: lld lookup failure in different docker images for gfx1250
Problem Description
In different docker image, the rocm_path is different and lld location is different. This cause flydsl compile fail when in gpu-module-to-binary pass. We may need a better way to make this more stable in different product environment for different docker images
Operating System
ubuntu 24.04
CPU
amd
GPU
gfx1250
ROCm Version
rocm 6
ROCm Component
No response
Steps to Reproduce
No response
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
rocminfo --support output
Paste output here
Additional Information
No response
Root cause in the ROCm 10 MI450 images, which ship ROCm as Python wheels (ROCM_PATH=/usr/local/lib/python3.12/dist-packages/_rocm_sdk_core):
FlyDSL execs $ROCM_PATH/llvm/bin/ld.lld, but in this layout lld is at $ROCM_PATH/lib/llvm/bin/ld.lld. The exec fails with ENOENT and the child exits 127, which surfaces only as lld invocation failed / An error happened while serializing the module. From strace:
execve(".../_rocm_sdk_core/llvm/bin/ld.lld", ["...", "-shared", "/tmp/kernelcc-42881d.o", "-o", "/tmp/kernel-17d3f3.hsaco"], ...) = -1 ENOENT
exit_group(127)
The same kernel's ISA, from gpu-module-to-binary{format=isa}, assembles and links cleanly with $ROCM_PATH/lib/llvm/bin/ld.lld -shared --no-undefined. With ROCM_PATH pointing at a tree that adds llvm -> lib/llvm, the failing aiter test passes. FlyDSL also looks for $ROCM_PATH/amdgcn/bitcode, which this layout only has under _rocm_sdk_devel/amdgcn.
Image: rocm/ufb-private:pytorch-mi450-release-2.11-py3.12-rocm10.2.0a20260922-bkc.20260929. FlyDSL 0.4.1 and 0.4.2. Also reproduces with the ROCm 7.15 image of the same series.
Repro with aiter 796ff6a35588 on gfx1250:
pytest op_tests/test_flydsl_qk_norm_rope_quant.py::test_flydsl_qk_norm_rope_quant_cos_sin_4d
The same lookup also fails most of aiter's FlyDSL AOT replays (GEMM, CONV, PA decode plan) on this image. Looking for lld via the compiler driver's directory, or trying lib/llvm as well as llvm, would cover both layouts.
@andyluo7 please try flydsl==0.5.0.dev1036 which should fix this issue .
Workaround for the ROCm 10 wheel images: set ROCM_PATH (and ROCM_HOME, HIP_PATH) to .../_rocm_sdk_devel instead of .../_rocm_sdk_core. The devel prefix is a complete tree with llvm -> lib/llvm, amdgcn -> lib/llvm/amdgcn, and the rocPRIM headers; the core prefix has none of them.
With that, test_flydsl_qk_norm_rope_quant_cos_sin_4d passes, and the _rocm_sdk_core/amdgcn/bitcode does not exist error that FlyDSL also raises on these images goes away. The MI450 vLLM images already point ROCM_PATH at _rocm_sdk_devel; the PyTorch MI450 images use _rocm_sdk_core.
A lookup that also tries lib/llvm, or the compiler driver's directory, would still help users of the core-prefix images.