Skip to content

Enzyme Julia 1.11 UndefVarError: CodeCache not defined in GPUCompiler #1527

@jakubMitura14

Description

@jakubMitura14

Hello I have some very slow compiling kernels , and wanted to use Ahead of Time Compilation [1] to save them. However before i started experimenting with that I have an issue that Enzyme will not work with Julia 1.11 . I was trying to add enzyme from github and registry and result the same.

Pkg.add(url="https://github.com/EnzymeAD/Enzyme.jl.git")

Main issue seems to be

UndefVarError: `CodeCache` not defined in `GPUCompiler`

full error.

Precompiling project...
  ✗ Enzyme
  ✗ Enzyme → EnzymeSpecialFunctionsExt
  ✗ Enzyme → EnzymeStaticArraysExt
  ✗ Enzyme → EnzymeChainRulesCoreExt
  ✗ EnzymeTestUtils
  0 dependencies successfully precompiled in 318 seconds. 376 already precompiled.

ERROR: The following 2 direct dependencies failed to precompile:

Enzyme 

Failed to precompile Enzyme [7da242da-08ed-463a-9acd-ee780be4f1d9] to "/home/jm/.julia/compiled/v1.11/Enzyme/jl_1NpqL9".
ERROR: LoadError: UndefVarError: `CodeCache` not defined in `GPUCompiler`
Stacktrace:
 [1] include(mod::Module, _path::String)
   @ Base ./Base.jl:558
 [2] include(x::String)
   @ Enzyme.Compiler ~/.julia/packages/Enzyme/wg4P7/src/compiler.jl:1
 [3] top-level scope
   @ ~/.julia/packages/Enzyme/wg4P7/src/compiler.jl:3000
 [4] include(mod::Module, _path::String)
   @ Base ./Base.jl:558
 [5] include(x::String)
   @ Enzyme ~/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:1
 [6] top-level scope
   @ ~/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:46
 [7] include
   @ ./Base.jl:558 [inlined]
 [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2721
 [9] top-level scope
   @ stdin:4
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/compiler/interpreter.jl:1
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/compiler.jl:1
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:1
in expression starting at stdin:4
EnzymeTestUtils 

Failed to precompile EnzymeTestUtils [12d8515a-0907-448a-8884-5fe00fdf1c5a] to "/home/jm/.julia/compiled/v1.11/EnzymeTestUtils/jl_zb7zYE".
ERROR: LoadError: UndefVarError: `CodeCache` not defined in `GPUCompiler`
Stacktrace:
 [1] include(mod::Module, _path::String)
   @ Base ./Base.jl:558
 [2] include(x::String)
   @ Enzyme.Compiler ~/.julia/packages/Enzyme/wg4P7/src/compiler.jl:1
 [3] top-level scope
   @ ~/.julia/packages/Enzyme/wg4P7/src/compiler.jl:3000
 [4] include(mod::Module, _path::String)
   @ Base ./Base.jl:558
 [5] include(x::String)
   @ Enzyme ~/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:1
 [6] top-level scope
   @ ~/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:46
 [7] include
   @ ./Base.jl:558 [inlined]
 [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
   @ Base ./loading.jl:2721
 [9] top-level scope
   @ stdin:4
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/compiler/interpreter.jl:1
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/compiler.jl:1
in expression starting at /home/jm/.julia/packages/Enzyme/wg4P7/src/Enzyme.jl:1
in expression starting at stdin:4
ERROR: LoadError: Failed to precompile Enzyme [7da242da-08ed-463a-9acd-ee780be4f1d9] to "/home/jm/.julia/compiled/v1.11/Enzyme/jl_siQ3O1".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64})
    @ Base ./loading.jl:3002
  [3] (::Base.var"#1082#1083"{Base.PkgId})()
    @ Base ./loading.jl:2389
  [4] mkpidlock(f::Base.var"#1082#1083"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.11.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:95
  [5] #mkpidlock#6
    @ ~/.julia/juliaup/julia-1.11.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:90 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.11.0-beta2+0.x64.linux.gnu/share/julia/stdlib/v1.11/FileWatching/src/pidfile.jl:116
  [7] #invokelatest#2
    @ ./essentials.jl:1033 [inlined]
  [8] invokelatest
    @ ./essentials.jl:1028 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#1082#1083"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3525
 [10] maybe_cachefile_lock
    @ ./loading.jl:3522 [inlined]
 [11] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2385
 [12] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2217
 [13] #invoke_in_world#3
    @ ./essentials.jl:1065 [inlined]
 [14] invoke_in_world
    @ ./essentials.jl:1062 [inlined]
 [15] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2208
 [16] macro expansion
    @ ./loading.jl:2148 [inlined]
 [17] macro expansion
    @ ./lock.jl:273 [inlined]
 [18] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2105
 [19] #invoke_in_world#3
    @ ./essentials.jl:1065 [inlined]
 [20] invoke_in_world
    @ ./essentials.jl:1062 [inlined]
 [21] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2098
 [22] include
    @ ./Base.jl:558 [inlined]
 [23] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2721
 [24] top-level scope
    @ stdin:4
in expression starting at /home/jm/.julia/packages/EnzymeTestUtils/5JRuz/src/EnzymeTestUtils.jl:1
in expression starting at stdin:4
  1. https://docs.julialang.org/en/v1.11-dev/devdocs/aot/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions