Skip to content

Make GPUCompiler IR relocatable across Julia sessions#878

Open
maleadt wants to merge 31 commits into
mainfrom
tb/relocations
Open

Make GPUCompiler IR relocatable across Julia sessions#878
maleadt wants to merge 31 commits into
mainfrom
tb/relocations

Conversation

@maleadt

@maleadt maleadt commented Jul 14, 2026

Copy link
Copy Markdown
Member

Keep Julia values and libjulia runtime globals as symbolic relocations until final backend lowering, instead of persisting session-specific host addresses in IR or cached code. Relocations can target Julia object identities or named runtime globals, through either dedicated pointer-sized slots or words embedded in device-side object representations.

Relocation metadata remains associated with the IR through linking and optimization, with stable, collision-safe slot names. Backends may preserve relocations for their loader to resolve and patch at runtime, while the default lowering eagerly embeds addresses from the current Julia session.

CUDA.jl uses this in JuliaGPU/CUDA.jl#3200 to materialize relocations as CuGlobal slots populated at load time, allowing generated PTX to be cached across Julia sessions. Other backends retain the existing eager behavior.

Supersedes #125 and #348

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.93281% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.13%. Comparing base (4a4be52) to head (19091ac).

Files with missing lines Patch % Lines
src/jlgen.jl 84.34% 18 Missing ⚠️
src/validation.jl 81.57% 7 Missing ⚠️
src/interface.jl 85.71% 2 Missing ⚠️
src/mcgen.jl 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
+ Coverage   81.75%   82.13%   +0.37%     
==========================================
  Files          26       26              
  Lines        4879     5032     +153     
==========================================
+ Hits         3989     4133     +144     
- Misses        890      899       +9     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread src/interface.jl Outdated
@maleadt
maleadt marked this pull request as ready for review July 15, 2026 20:34
@maleadt

maleadt commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Okay, this is starting to look good. IR should be fully relocatable after this, at least for back-ends supporting run-time relocations.

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.

2 participants