Skip to content

(Closes #2846) extend KernelModuleInlineTrans so that it re-names inlined routines#3290

Draft
arporter wants to merge 19 commits into
masterfrom
2846_rename_inlined_routines
Draft

(Closes #2846) extend KernelModuleInlineTrans so that it re-names inlined routines#3290
arporter wants to merge 19 commits into
masterfrom
2846_rename_inlined_routines

Conversation

@arporter
Copy link
Copy Markdown
Member

No description provided.

@arporter arporter self-assigned this Jan 19, 2026
@arporter arporter marked this pull request as draft January 19, 2026 19:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.95%. Comparing base (91d493f) to head (19be2f7).

❌ Your project check has failed because you have indirect coverage changes. Learn more about Unexpected Coverage Changes and reasons for indirect coverage changes.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3290      +/-   ##
==========================================
- Coverage   99.95%   99.95%   -0.01%     
==========================================
  Files         378      378              
  Lines       53764    53692      -72     
==========================================
- Hits        53742    53669      -73     
- Misses         22       23       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arporter arporter added the Blocked An issue/PR that is blocked by one or more issues/PRs. label Mar 25, 2026
@arporter
Copy link
Copy Markdown
Member Author

Somehow, #3294 got merged and that was a precursor to this (makes module-inline trans mandatory for kernel transformations). I think this must be because I created a branch from that branch to do #1734 and, since that new branch included all the commits for #3294 (some of which I had manually undone subsequently), merging #1734 automatically merged #3294?? Anyway, the upshot is that this is still blocked while I sort out the mess and get #3334 done.

@arporter arporter removed the Blocked An issue/PR that is blocked by one or more issues/PRs. label Apr 29, 2026
@arporter
Copy link
Copy Markdown
Member Author

arporter commented May 1, 2026

This is now proceeding OK. However, I've realised that, as things currently stand, we'll end up generating multiple OpenCL implementations of the same kernel (since the call to each is module-inlined separately and given a new name). This isn't ideal and the code duplication that could result from having multiple copies of the same kernel will substantially bloat the executable. We could have an option to the transformation to use a pre-existing version of the routine if it exists? What do @sergisiso @LonelyCat124 and @hiker think?

@arporter
Copy link
Copy Markdown
Member Author

arporter commented May 1, 2026

I realised over lunch that my question over-simplifies things - the very first time we module-inline a routine, it gets re-named so a simple check on the name of any subsequent target routine won't reveal that it was previously module inlined.

@sergisiso
Copy link
Copy Markdown
Collaborator

@arporter I believe the previous version was already doing a subroutine comparison (with the equal operator in the routine node) and decide if it was the same than the already existing or not. Could we do something similar? If the subroutine is equal in all but name* to the inlining candidate (e.g. after updating symbols), use the existing one.

  • the 'all by name' is tricky because its not what the equal operator does.

Another option is change the behaviour of ModuleInline so it updates ALL the calls to that subroutine.

@arporter
Copy link
Copy Markdown
Member Author

arporter commented May 5, 2026

Another option is change the behaviour of ModuleInline so it updates ALL the calls to that subroutine.

I like that idea. We can have it as an option so that users can do either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants