Skip to content

[offload] Provides a device-side binary linker for diverse range of architectures. #139036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
StevenYangCC opened this issue May 8, 2025 · 7 comments
Labels
offload question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@StevenYangCC
Copy link

Provides a device-side binary linker for diverse range of architectures.

@llvmbot
Copy link
Member

llvmbot commented May 8, 2025

@llvm/issue-subscribers-offload

Author: None (StevenYangCC)

Provides a device-side binary linker for diverse range of architectures.

@jhuber6
Copy link
Contributor

jhuber6 commented May 8, 2025

I don't understand this issue, please be more specific.

@StevenYangCC
Copy link
Author

AMDGPU target does not have an object file level linker, their implementation at the bottom of clang-linker-wrapper only has IR level bundler tool.

@jhuber6
Copy link
Contributor

jhuber6 commented May 9, 2025

AMDGPU target does not have an object file level linker, their implementation at the bottom of clang-linker-wrapper only has IR level bundler tool.

I'm not sure where this comes from. It's just doing LTO with ld.lld which is a linker. It's true that you can't correctly do object level linking, but you're free to try. It will work so long as whatever function you're calling uses fewer registers than the kernel is launched with. To fix that we'd need the linker to determine resource usage somehow.

@StevenYangCC
Copy link
Author

Resource usage can be recorded in ELF file.LTO is doing IR level linking, not binary level linking, we need a binary level device side linker, which can improve module reuse, reduce code size and compile time.

@jhuber6
Copy link
Contributor

jhuber6 commented May 9, 2025

We already have metadata for this, look at .AMDGPU.gpr_maximums and others. The problem is using it in the linker, which is a larger issue and will be tracked separately.

@jhuber6 jhuber6 closed this as completed May 9, 2025
@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label May 9, 2025
@StevenYangCC
Copy link
Author

@jhuber6 I'm not talking about AMDGPUs alone, we need to consider that the properties, content, and formats that need to be stored may be different for different architectures. We need to give each one room to play, so it's a much more abstract concept, not a small issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
offload question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

4 participants