Skip to content
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

[backend] Use one linker to link all external libraries #3501

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

antiagainst
Copy link
Collaborator

This avoids creating a separate linker each time to link a device library to avoid the overhead of internal tracking.

This avoids creating a separate linker each time to link a device
library to avoid the overhead of internal tracking.
@antiagainst antiagainst marked this pull request as ready for review March 28, 2024 23:09
@antiagainst antiagainst requested a review from ptillet as a code owner March 28, 2024 23:09
Copy link
Collaborator

@jlebar jlebar left a comment

Choose a reason for hiding this comment

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

I'm a little surprised this is significantly faster, but sgtm!

llvm::SMDiagnostic err;
std::unique_ptr<llvm::Module> libMod = llvm::parseIRFile(path, err, ctx);
if (!libMod) {
llvm::errs() << "Failed to load " << path;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're not changing it in this PR, but I wonder if you want to raise a Python exception in this case and the other error case below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup! I'm a bit scared about exceptions, but hey this is Python land. :D

@antiagainst
Copy link
Collaborator Author

antiagainst commented Mar 28, 2024

I'm a little surprised this is significantly faster, but sgtm!

Yeah I won't expect huge speedup either. I was actually more wanting to see if this addresses some suspected linking issues; turns out not. Either way seems good to have; won't be harmful.

@ThomasRaoux ThomasRaoux merged commit f5722cb into triton-lang:main Mar 29, 2024
5 checks passed
@antiagainst antiagainst deleted the linker-one branch March 29, 2024 00:40
ptillet pushed a commit that referenced this pull request Apr 1, 2024
This avoids creating a separate linker each time to link a device
library to avoid the overhead of internal tracking.
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.

3 participants