Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Vararg warning in test #2570

Open
CarloLucibello opened this issue Dec 31, 2024 · 4 comments
Open

fix Vararg warning in test #2570

CarloLucibello opened this issue Dec 31, 2024 · 4 comments
Labels

Comments

@CarloLucibello
Copy link
Member

Tests print a lot of


WARNING: Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).
You may need to write `f(x::Vararg{T})` rather than `f(x::Vararg{<:T})` or `f(x::Vararg{T}) where T` instead of `f(x::Vararg{T} where T)`.

We need to find the source of this and fix it

@ToucheSir
Copy link
Member

Can we trigger a CI run with julia --depwarn=error to enumerate these?

@mcabbott
Copy link
Member

mcabbott commented Dec 31, 2024

Yes you can, xref JuliaLang/julia#56662

I think they are from inside Enzyme somewhere... ok I found where I looked, and the pointer was this line:

https://github.com/EnzymeAD/Enzyme.jl/blob/main/src/absint.jl#L98

on 23 November, at least:

Enzyme grad check Chain(Dense, Dense): Error During Test at /Users/me/.julia/dev/Flux/test/ext_enzyme/enzyme.jl:115
  Got exception outside of a @test
  Wrapping `Vararg` directly in UnionAll is deprecated (wrap the tuple instead).
  You may need to write `f(x::Vararg{T})` rather than `f(x::Vararg{<:T})` or `f(x::Vararg{T}) where T` instead of `f(x::Vararg{T} where T)`.
  Stacktrace:
    [1] UnionAll(v::TypeVar, t::Any)
      @ Core ./boot.jl:256
    [2] absint(arg::LLVM.CallInst, partial::Bool)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/absint.jl:98
    [3] abs_typeof(arg::LLVM.CallInst, partial::Bool, seenphis::Set{LLVM.PHIInst})
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/absint.jl:716
    [4] abs_typeof(arg::LLVM.CallInst, partial::Bool)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/absint.jl:283
    [5] codegen(output::Symbol, job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:7169
    [6] codegen
      @ ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:6146 [inlined]
    [7] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:8468
    [8] _thunk
      @ ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:8468 [inlined]
    [9] cached_compilation
      @ ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:8509 [inlined]
   [10] thunkbase(ctx::LLVM.Context, mi::Core.MethodInstance, ::Val{0x0000000000007d08}, ::Type{Const{var"#loss#402"}}, ::Type{Active}, tt::Type{Tuple{Duplicated{Chain{Tuple{Dense{typeof(tanh), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}}, Duplicated{Vector{Float32}}}}, ::Val{Enzyme.API.DEM_ReverseModeCombined}, ::Val{1}, ::Val{(false, false, false)}, ::Val{true}, ::Val{false}, ::Type{EnzymeCore.FFIABI}, ::Val{true}, ::Val{false})
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:8641
   [11] #s2103#19072
      @ ~/.julia/packages/Enzyme/RTS5U/src/compiler.jl:8778 [inlined]
   [12] var"#s2103#19072"(FA::Any, A::Any, TT::Any, Mode::Any, ModifiedBetween::Any, width::Any, ReturnPrimal::Any, ShadowInit::Any, World::Any, ABI::Any, ErrIfFuncWritten::Any, RuntimeActivity::Any, ::Any, ::Type, ::Type, ::Type, tt::Any, ::Type, ::Type, ::Type, ::Type, ::Type, ::Type, ::Type, ::Any)
      @ Enzyme.Compiler ./none:0
   [13] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
      @ Core ./boot.jl:602
   [14] autodiff
      @ ~/.julia/packages/Enzyme/RTS5U/src/Enzyme.jl:473 [inlined]
   [15] autodiff(::EnzymeCore.ReverseMode{true, false, EnzymeCore.FFIABI, false, false}, ::var"#loss#402", ::Type{Active}, ::Duplicated{Chain{Tuple{Dense{typeof(tanh), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}}, ::Duplicated{Vector{Float32}})
      @ Enzyme ~/.julia/packages/Enzyme/RTS5U/src/Enzyme.jl:512
   [16] gradient_ez(::Function, ::Chain{Tuple{Dense{typeof(tanh), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}, ::Vararg{Any})
      @ Main ~/.julia/dev/Flux/test/ext_enzyme/enzyme.jl:30
   [17] test_enzyme_grad(loss::var"#loss#402", model::Chain{Tuple{Dense{typeof(tanh), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}, x::Vector{Float32})
      @ Main ~/.julia/dev/Flux/test/ext_enzyme/enzyme.jl:53

@CarloLucibello
Copy link
Member Author

I think they are from inside Enzyme somewhere... ok I found where I looked, and the pointer was this line:
https://github.com/EnzymeAD/Enzyme.jl/blob/main/src/absint.jl#L98

@wsmoses can this be fixed?

@wsmoses
Copy link
Contributor

wsmoses commented Jan 1, 2025

Yeah, can you find a MWE so we can figure out how to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants