Skip to content

Fix always_inline via inlining policy override#795

Merged
maleadt merged 1 commit into
masterfrom
tb/always_inline
May 12, 2026
Merged

Fix always_inline via inlining policy override#795
maleadt merged 1 commit into
masterfrom
tb/always_inline

Conversation

@maleadt
Copy link
Copy Markdown
Member

@maleadt maleadt commented May 12, 2026

JuliaLang/julia#51599 narrowed the CodeInfo.inlining_cost field from UInt16 to UInt8, so reasonably-sized callees saturate at MAX_INLINE_COST and is_inlineable(src) permanently rejects them — regardless of our inline_cost_threshold setting. 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. Mirrors the workaround already used in cuTile.

Fixes #527.

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 maleadt force-pushed the tb/always_inline branch from 9953fcd to 614f526 Compare May 12, 2026 10:55
@maleadt maleadt merged commit 5099d9d into master May 12, 2026
30 of 37 checks passed
@maleadt maleadt deleted the tb/always_inline branch May 12, 2026 12:08
maleadt added a commit that referenced this pull request May 13, 2026
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.

always_inline is broken on 1.11

1 participant