You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
that's it - it assumes there's some inner module - we don't want to link executables with no inner module at all.
gatherExecutablesForTarget/gatherExecutablesForTargets should be changed to not return any executable without an inner module
(that makes the naming a bit weird, may be better to filter, or change those to be gatherLinkableExecutable....)
in this particular case of a fully external executable (the hsaco, or if the user provided a .so on CPU, or something) yep! it'll always be better if we could be merging in .bc/.mlir instead (which we would want to link, and would likely need a dummy inner module).
Activity
benvanik commentedon Jun 5, 2025
got a stack?
MaheshRavishankar commentedon Jun 5, 2025
Posting stack from internal chat
benvanik commentedon Jun 5, 2025
cool - an
--mlir-print-ir-before=iree-llvmgpu-link-executablesshould be all that's needed to repro!MaheshRavishankar commentedon Jun 5, 2025
IR before the pass
https://gist.github.com/MaheshRavishankar/28b2983c85f6f154621fb01dbbc3cebb
but
isnt reproducing the crash
MaheshRavishankar commentedon Jun 5, 2025
Ah
reproduces the issue.
benvanik commentedon Jun 5, 2025
noticed:
may have to change that file to test it all the way, but I think this failure happens before it's actually needed
rsuderman commentedon Jun 5, 2025
It looks like
mergeModuleIntois being invoked with anullptrfor thesourceModuleOpbeing invoked duringLLVMGPULinkExecutablesPassbenvanik commentedon Jun 5, 2025
that's it - it assumes there's some inner module - we don't want to link executables with no inner module at all.
gatherExecutablesForTarget/gatherExecutablesForTargets should be changed to not return any executable without an inner module
(that makes the naming a bit weird, may be better to filter, or change those to be gatherLinkableExecutable....)
MaheshRavishankar commentedon Jun 5, 2025
Fixes the issue. But do we expect variants with no inner modules?
MaheshRavishankar commentedon Jun 5, 2025
I can land that change if that is the right fix, but I see the executable failing here as
It has an export but doesnt have a module that exports this. Is that expected?
benvanik commentedon Jun 5, 2025
in this particular case of a fully external executable (the hsaco, or if the user provided a .so on CPU, or something) yep! it'll always be better if we could be merging in .bc/.mlir instead (which we would want to link, and would likely need a dummy inner module).
rsuderman commentedon Jun 5, 2025
This appears to get us through the compilation process.
MaheshRavishankar commentedon Jun 5, 2025
yeah, struggling a bit to write a test.
But will send pr
[LLVMGPU] Fix linking error when one of the variants has no modules.
MaheshRavishankar commentedon Jun 5, 2025
Sent PR. That also fixes the issue but I am not sure that is right fix. Ill wait for Bens review.
[LLVMGPU] Fix linking error when one of the variants has no modules.
[LLVMGPU] Fix linking error when one of the variants has no modules. (#…
[LLVMGPU] Fix linking error when one of the variants has no modules. (#…