Skip to content

Commit bc89f91

Browse files
authored
Merge pull request #519 from JuliaGPU/ecore
Adapt to pending Enzymecore changes
2 parents d9062a3 + e4d702f commit bc89f91

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

.buildkite/pipeline.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ steps:
3030
matrix:
3131
setup:
3232
version:
33-
- "1.8"
34-
- "1.9"
3533
- "1.10"
3634
- "1.11"
3735
plugins:
@@ -42,8 +40,12 @@ steps:
4240
command: |
4341
julia -e 'println("--- :julia: Instantiating project")
4442
using Pkg
45-
Pkg.develop(; path=pwd())
46-
Pkg.add(["CUDA", "Enzyme"])' || exit 3
43+
try
44+
Pkg.develop([PackageSpec(; path=pwd()), PackageSpec("Enzyme"), PackageSpec("CUDA")])
45+
catch err
46+
Pkg.develop(; path=pwd())
47+
Pkg.add(["CUDA", "Enzyme"])
48+
end' || exit 3
4749
4850
julia -e 'println("+++ :julia: Running tests")
4951
using CUDA

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "KernelAbstractions"
22
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
33
authors = ["Valentin Churavy <v.churavy@gmail.com> and contributors"]
4-
version = "0.9.26"
4+
version = "0.9.27"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -21,7 +21,7 @@ UnsafeAtomicsLLVM = "d80eeb9a-aca5-4d75-85e5-170c8b632249"
2121
[compat]
2222
Adapt = "0.4, 1.0, 2.0, 3.0, 4"
2323
Atomix = "0.1"
24-
EnzymeCore = "0.7.5"
24+
EnzymeCore = "0.8.1"
2525
InteractiveUtils = "1.6"
2626
LinearAlgebra = "1.6"
2727
MacroTools = "0.5"

ext/EnzymeExt.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,18 @@ EnzymeRules.inactive(::Type{StaticSize}, x...) = nothing
4444
# https://github.com/EnzymeAD/Enzyme.jl/issues/1516
4545
# On the CPU `autodiff_deferred` can deadlock.
4646
# Hence a specialized CPU version
47-
function cpu_fwd(ctx, f, args...)
48-
EnzymeCore.autodiff(Forward, Const(f), Const{Nothing}, Const(ctx), args...)
47+
function cpu_fwd(ctx, config, f, args...)
48+
EnzymeCore.autodiff(EnzymeCore.set_runtime_activity(Forward, config), Const(f), Const{Nothing}, Const(ctx), args...)
4949
return nothing
5050
end
5151

52-
function gpu_fwd(ctx, f, args...)
53-
EnzymeCore.autodiff_deferred(Forward, Const(f), Const{Nothing}, Const(ctx), args...)
52+
function gpu_fwd(ctx, config, f, args...)
53+
EnzymeCore.autodiff_deferred(EnzymeCore.set_runtime_activity(Forward, config), Const(f), Const{Nothing}, Const(ctx), args...)
5454
return nothing
5555
end
5656

5757
function EnzymeRules.forward(
58+
config,
5859
func::Const{<:Kernel{CPU}},
5960
::Type{Const{Nothing}},
6061
args...;
@@ -65,10 +66,11 @@ function EnzymeRules.forward(
6566
f = kernel.f
6667
fwd_kernel = similar(kernel, cpu_fwd)
6768

68-
fwd_kernel(f, args...; ndrange, workgroupsize)
69+
fwd_kernel(config, f, args...; ndrange, workgroupsize)
6970
end
7071

7172
function EnzymeRules.forward(
73+
config,
7274
func::Const{<:Kernel{<:GPU}},
7375
::Type{Const{Nothing}},
7476
args...;
@@ -79,7 +81,7 @@ function EnzymeRules.forward(
7981
f = kernel.f
8082
fwd_kernel = similar(kernel, gpu_fwd)
8183

82-
fwd_kernel(f, args...; ndrange, workgroupsize)
84+
fwd_kernel(config, f, args...; ndrange, workgroupsize)
8385
end
8486

8587
_enzyme_mkcontext(kernel::Kernel{CPU}, ndrange, iterspace, dynamic) =
@@ -253,7 +255,7 @@ function gpu_rev(
253255
end
254256

255257
function EnzymeRules.augmented_primal(
256-
config::Config,
258+
config::RevConfig,
257259
func::Const{<:Kernel},
258260
::Type{Const{Nothing}},
259261
args::Vararg{Any, N};
@@ -311,7 +313,7 @@ function EnzymeRules.augmented_primal(
311313
end
312314

313315
function EnzymeRules.reverse(
314-
config::Config,
316+
config::RevConfig,
315317
func::Const{<:Kernel},
316318
::Type{<:EnzymeCore.Annotation},
317319
tape,
@@ -364,7 +366,7 @@ end
364366
# synchronize rule and then synchronize where the launch was. However, with the current
365367
# kernel semantics this ensures correctness for now.
366368
function EnzymeRules.augmented_primal(
367-
config::Config,
369+
config::RevConfig,
368370
func::Const{typeof(synchronize)},
369371
::Type{Const{Nothing}},
370372
backend::T,
@@ -374,7 +376,7 @@ function EnzymeRules.augmented_primal(
374376
end
375377

376378
function EnzymeRules.reverse(
377-
config::Config,
379+
config::RevConfig,
378380
func::Const{typeof(synchronize)},
379381
::Type{Const{Nothing}},
380382
tape,

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1010
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1111

1212
[compat]
13-
Enzyme = "0.12"
13+
Enzyme = "0.13"

0 commit comments

Comments
 (0)