Fix always_inline via inlining policy override#795
Merged
Conversation
The inlining decision is gated by `is_inlineable(src)`, which reads the saturating `CodeInfo.inlining_cost` field. JuliaLang/julia#51599 narrowed that field from UInt16 to UInt8 on 1.13, but it was already saturating on 1.11/1.12 for sufficiently large kernels — the existing test just had a body small enough to slip under the UInt16 cap. Override `src_inlining_policy` (1.12+) / `inlining_policy` (1.11) on `GPUInterpreter` to force-allow inlining of any available source when `always_inline=true`, and disable `may_discard_trees` in that mode so the optimized IR survives for the policy to inline. Bump the test body so it now reproduces the bug on every supported version. Mirrors the workaround already used in cuTile. Fixes #527. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
maleadt
added a commit
that referenced
this pull request
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JuliaLang/julia#51599 narrowed the
CodeInfo.inlining_costfield from UInt16 to UInt8, so reasonably-sized callees saturate at MAX_INLINE_COST andis_inlineable(src)permanently rejects them — regardless of ourinline_cost_thresholdsetting. Overridesrc_inlining_policy(1.12+) /inlining_policy(1.11) onGPUInterpreterto force-allow inlining of any available source whenalways_inline=true, and disablemay_discard_treesin that mode so the optimized IR survives for the policy to inline. Mirrors the workaround already used in cuTile.Fixes #527.