Switch to CompilerCaching.jl.#593
Merged
Merged
Conversation
5b18115 to
dd6aebc
Compare
72dc013 to
fc976ae
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
fc976ae to
714dcab
Compare
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. 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)
|
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.
No description provided.