Skip to content

Switch to CompilerCaching.jl.#593

Merged
maleadt merged 1 commit into
mainfrom
tb/compilercaching
Jul 13, 2026
Merged

Switch to CompilerCaching.jl.#593
maleadt merged 1 commit into
mainfrom
tb/compilercaching

Conversation

@maleadt

@maleadt maleadt commented Jul 3, 2026

Copy link
Copy Markdown
Member

No description provided.

@maleadt maleadt force-pushed the tb/compilercaching branch from 5b18115 to dd6aebc Compare July 3, 2026 07:48
@maleadt maleadt force-pushed the tb/compilercaching branch 2 times, most recently from 72dc013 to fc976ae Compare July 10, 2026 14:28
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.72727% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.03%. Comparing base (4725303) to head (714dcab).

Files with missing lines Patch % Lines
src/compiler/precompile.jl 69.23% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #593      +/-   ##
==========================================
+ Coverage   79.00%   79.03%   +0.02%     
==========================================
  Files          49       50       +1     
  Lines        3334     3362      +28     
==========================================
+ Hits         2634     2657      +23     
- Misses        700      705       +5     

☔ 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.

@maleadt maleadt force-pushed the tb/compilercaching branch from fc976ae to 714dcab Compare July 13, 2026 09:08
@maleadt maleadt marked this pull request as ready for review July 13, 2026 10:04
@github-actions

Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/src/array.jl b/src/array.jl
index 569da01..53b0c8e 100644
--- a/src/array.jl
+++ b/src/array.jl
@@ -28,7 +28,7 @@ function contains_eltype(T, X)
     return false
 end
 
-function _device_supports_bfloat16(dev=device())
+function _device_supports_bfloat16(dev = device())
     # check the driver extension first
     if haskey(
             oneL0.extension_properties(dev.driver),
diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl
index 5a398a6..42a0fc8 100644
--- a/src/compiler/compilation.jl
+++ b/src/compiler/compilation.jl
@@ -309,7 +309,7 @@ function compiler_config(dev; kwargs...)
     return config
 end
 # Whether the driver's SPIR-V runtime accepts the SPV_KHR_bfloat16 extension.
-function _driver_supports_bfloat16_spirv(dev=device())
+function _driver_supports_bfloat16_spirv(dev = device())
     return @static if isdefined(Core, :BFloat16)
         haskey(
             oneL0.extension_properties(dev.driver),
@@ -336,7 +336,7 @@ end
     extensions_str = join(map(ext -> "+$ext", extensions), ",")
 
     # create GPUCompiler objects
-    target = SPIRVCompilerTarget(; extensions=extensions_str, supports_fp16, supports_fp64, supports_bfloat16, kwargs...)
+    target = SPIRVCompilerTarget(; extensions = extensions_str, supports_fp16, supports_fp64, supports_bfloat16, kwargs...)
     params = oneAPICompilerParams()
     CompilerConfig(target, params; kernel, name, always_inline)
 end
@@ -355,5 +355,5 @@ end
 # link the SPIR-V bytes into a session-local `ZeKernel` on the given context and device.
 function link_kernel(image::Vector{UInt8}, entry::String, ctx::ZeContext, dev::ZeDevice)
     mod = ZeModule(ctx, dev, image)
-    kernels(mod)[entry]
+    return kernels(mod)[entry]
 end
diff --git a/src/compiler/execution.jl b/src/compiler/execution.jl
index cc8d331..8dd415e 100644
--- a/src/compiler/execution.jl
+++ b/src/compiler/execution.jl
@@ -240,7 +240,7 @@ end
 
 const zefunction_lock = ReentrantLock()
 
-function zefunction(f::F, tt::TT=Tuple{}; kwargs...) where {F,TT}
+function zefunction(f::F, tt::TT = Tuple{}; kwargs...) where {F, TT}
     Base.@lock zefunction_lock begin
         ctx = context()
         dev = device()
@@ -273,8 +273,8 @@ function zefunction(f::F, tt::TT=Tuple{}; kwargs...) where {F,TT}
         # about world age here, as GPUCompiler already does and will return a different object
         h = hash(fun, hash(f, hash(tt)))
         get!(_kernel_instances, h) do
-            HostKernel{F,tt}(f, fun)
-        end::HostKernel{F,tt}
+            HostKernel{F, tt}(f, fun)
+        end::HostKernel{F, tt}
     end
 end
 
diff --git a/src/compiler/precompile.jl b/src/compiler/precompile.jl
index 4a8493c..d5d3edb 100644
--- a/src/compiler/precompile.jl
+++ b/src/compiler/precompile.jl
@@ -16,13 +16,17 @@ if SPIRV_LLVM_Backend_jll.is_available()
             # Build a device-independent compiler config. `_compiler_config` normally derives
             # these knobs from the device; here we use conservative, portable defaults (the
             # workload only exercises the pipeline, it does not target a specific device).
-            target = SPIRVCompilerTarget(; extensions="", supports_fp16=true,
-                                          supports_fp64=true, supports_bfloat16=false)
+            target = SPIRVCompilerTarget(;
+                extensions = "", supports_fp16 = true,
+                supports_fp64 = true, supports_bfloat16 = false
+            )
             params = oneAPICompilerParams()
-            config = CompilerConfig(target, params; kernel=true, name=nothing,
-                                    always_inline=false)
+            config = CompilerConfig(
+                target, params; kernel = true, name = nothing,
+                always_inline = false
+            )
 
-            tt = Tuple{oneDeviceArray{Float32,1,AS.CrossWorkgroup}}
+            tt = Tuple{oneDeviceArray{Float32, 1, AS.CrossWorkgroup}}
             source = methodinstance(typeof(_precompile_kernel), tt)
             job = CompilerJob(source, config)
 

@maleadt maleadt merged commit f4b93ba into main Jul 13, 2026
6 checks passed
@maleadt maleadt deleted the tb/compilercaching branch July 13, 2026 10:33
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.

1 participant