Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7806ef5
Switch to CompilerCaching for in-memory CI caching.
maleadt May 10, 2026
b5f742f
Widen cache_owner to include the target+params instances.
maleadt May 10, 2026
13e816f
Cache runtime library bitcode on the per-function CodeInstance.
maleadt May 10, 2026
554702c
Remove 1.10 from CI.
maleadt May 12, 2026
283e70e
Fix tests.
maleadt May 12, 2026
b318df0
Restore 1.10 compat.
maleadt May 14, 2026
f495422
Restore per-CI bitcode caching for the GPU runtime library.
maleadt May 14, 2026
b3d3898
Don't cache relocated GVs.
maleadt May 14, 2026
2b21abe
Null-out GV initializers on 1.12 to mirror 1.13+ behavior.
maleadt May 14, 2026
e8a74a8
Inline the CompilerCaching extension; delegate inference to it on 1.11+.
maleadt May 14, 2026
626c876
Reword GPUInterpreter docstring after extension removal.
maleadt May 14, 2026
6e3edde
Migrate to CompilerCaching's @setup_results + interp-form typeinf!.
maleadt May 14, 2026
de2d198
Replace bitcode/bitcode! traits with a generic cache_get/cache_put! p…
maleadt May 14, 2026
afcb27f
Rework the caching interface around per-job results structs.
maleadt Jun 10, 2026
3f0a3a0
Fix version.
maleadt Jun 11, 2026
77468a6
Specialize cache_owner and cached_results for the launch hot path.
maleadt Jun 11, 2026
a5741af
Store SPIR-V extensions as a feature string.
maleadt Jun 11, 2026
e84e9b3
Wipe session-dependent results before image serialization.
maleadt Jun 11, 2026
803592e
Clear the 1.10 CodeCache registry on load.
maleadt Jun 11, 2026
4d02d5a
Don't key runtime library jobs on the kernel's entry-point name.
maleadt Jun 11, 2026
2356a23
Fix stale comment about the removed 1.10 methodinstance generator.
maleadt Jun 11, 2026
209e3b1
Remove irrelevant TODOs.
maleadt Jun 16, 2026
19fb90d
Fixes.
maleadt Jun 17, 2026
501d2a7
Remove stale runtime_slug test references
maleadt Jul 3, 2026
a77d49d
Remove legacy link_libraries dispatch
maleadt Jul 3, 2026
76d6459
Key the runtime library cache on the derived runtime config.
maleadt Jul 6, 2026
cded096
Remove reset_runtime.
maleadt Jul 6, 2026
688de6a
Test persistence of edge-less CodeInstances.
maleadt Jul 6, 2026
9dba102
Review by Codex.
maleadt Jul 10, 2026
07aef08
Relocate constgv globals in the runtime library.
maleadt Jul 10, 2026
536691e
Simplify the caching interface.
maleadt Jul 10, 2026
5954d9b
Remove the runtime disk cache test.
maleadt Jul 10, 2026
02ebc13
Remove the invalid PTX bool-boxes test.
maleadt Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions LocalPreferences.toml

This file was deleted.

9 changes: 4 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name = "GPUCompiler"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "1.23.0"
version = "2.0.0"
authors = ["Tim Besard <tim.besard@gmail.com>"]

[workspace]
projects = ["test"]

[deps]
CompilerCaching = "9db33cc3-5358-4881-8759-fa4194144afd"
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
Expand All @@ -15,8 +16,6 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Tracy = "e689c965-62c8-4b79-b2c5-8359227902fd"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Expand All @@ -26,8 +25,10 @@ AMDGPU_LLVM_Backend_jll = "cc5c0156-bd05-5a77-8a68-bb0aafb29019"
LLVMDowngrader_jll = "f52de702-fb25-5922-94ba-81dd59b07444"
NVPTX_LLVM_Backend_jll = "ef6e0fe3-e6ef-59c0-bde6-4989574699e0"


[compat]
AMDGPU_LLVM_Backend_jll = "22"
CompilerCaching = "0.3"
ExprTools = "0.1"
InteractiveUtils = "1"
LLVM = "9.9"
Expand All @@ -38,8 +39,6 @@ NVPTX_LLVM_Backend_jll = "22"
PrecompileTools = "1"
Preferences = "1"
REPL = "1"
Scratch = "1"
Serialization = "1"
TOML = "1"
Tracy = "0.1.4"
UUIDs = "1"
Expand Down
39 changes: 23 additions & 16 deletions src/GPUCompiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ using ExprTools: splitdef, combinedef

using Libdl

using Serialization
using Scratch: @get_scratch!
using Preferences

const ENABLE_TRACY = parse(Bool, @load_preference("tracy", "false"))
Expand All @@ -35,8 +33,21 @@ end
const CC = Core.Compiler
using Core: MethodInstance, CodeInstance, CodeInfo

compile_cache = nothing # set during __init__()
const pkgver = Base.pkgversion(GPUCompiler)
# `HAS_INTEGRATED_CACHE` distinguishes 1.11+ (owner-keyed `Core.Compiler.InternalCodeCache`)
# from 1.10 (per-interpreter `CodeCache` IdDict + invalidation callbacks). The two have
# disjoint shapes; everything cache-related fans on this flag.
const HAS_INTEGRATED_CACHE = VERSION >= v"1.11.0-DEV.1552"

# Loads as an empty shell on 1.10; on 1.11+ provides `CacheView`, `typeinf!`,
# `get_codeinfos`, `lookup`, `results`, etc. We `import` the module name (not its
# exports) to avoid clashing with `LLVM.lookup`; internal call sites qualify with
# `CompilerCaching.`.
import CompilerCaching

# Optional callback invoked from `compile(...)` / `cached_compilation(...)` before
# compilation runs. Set by `@device_code_*` reflection macros. Defined here (early)
# so the legacy `cached_compilation` in deprecated.jl can reference it.
const compile_hook = Ref{Union{Nothing,Function}}(nothing)

include("utils.jl")
include("mangling.jl")
Expand All @@ -54,6 +65,7 @@ include("metal.jl")
include("runtime.jl")

# compiler implementation
include("deprecated.jl")
include("jlgen.jl")
include("irgen.jl")
include("optim.jl")
Expand All @@ -67,24 +79,19 @@ include("driver.jl")
include("execution.jl")
include("reflection.jl")

include("deprecated.jl")

include("precompile.jl")

function __init__()
STDERR_HAS_COLOR[] = get(stderr, :color, false)

dir = @get_scratch!("compiled")
## add the Julia version
dir = joinpath(dir, "v$(VERSION.major).$(VERSION.minor)")
## also add the package version
if pkgver !== nothing
# XXX: `Base.pkgversion` is buggy and sometimes returns `nothing`, see e.g.
# JuliaLang/PackageCompiler.jl#896 and JuliaGPU/GPUCompiler.jl#593
dir = joinpath(dir, "v$(pkgver.major).$(pkgver.minor)")
@static if !HAS_INTEGRATED_CACHE
# session-local results keyed by objectid+world; entries serialized during
# GPUCompiler's own precompilation can never be valid in a later session
empty!(job_results)
# ditto for the in-process CodeCaches: CIs deposited by our own precompile
# workload carry world ages from the precompilation process
empty!(GLOBAL_CI_CACHES)
end
mkpath(dir)
global compile_cache = dir

@static if ENABLE_TRACY
Tracy.@register_tracepoints()
Expand Down
2 changes: 0 additions & 2 deletions src/bpf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ end

## job

runtime_slug(job::CompilerJob{BPFCompilerTarget}) = "bpf"

const bpf_intrinsics = () # TODO
isintrinsic(::CompilerJob{BPFCompilerTarget}, fn::String) = in(fn, bpf_intrinsics)

Expand Down
Loading