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

active_reg_inner crashes on Tuple{X} where {X} #1923

Open
mofeing opened this issue Sep 29, 2024 · 3 comments
Open

active_reg_inner crashes on Tuple{X} where {X} #1923

mofeing opened this issue Sep 29, 2024 · 3 comments

Comments

@mofeing
Copy link
Contributor

mofeing commented Sep 29, 2024

If you run this code:

Enzyme.Compiler.active_reg_inner(Vector{Tuple{Code}} where {Code<:Integer}, (), nothing)

it fails like this:

UndefVarError: `T` not defined

Stacktrace:
 [1] ptreltype(::Type{Array{Tuple{Code}, 1} where Code<:Integer})
   @ Enzyme.Compiler ~/.julia/packages/Enzyme/HXYPU/src/compiler.jl:519
 [2] active_reg_inner
   @ ~/.julia/packages/Enzyme/HXYPU/src/compiler.jl:643 [inlined]
 [3] active_reg_inner (repeats 2 times)
   @ ~/.julia/packages/Enzyme/HXYPU/src/compiler.jl:603 [inlined]
 [4] active_reg_inner(::Type{Array{Tuple{Code}, 1} where Code<:Integer}, seen::Tuple{}, world::Nothing)
   @ Enzyme.Compiler ~/.julia/packages/Enzyme/HXYPU/src/compiler.jl:603
 [5] top-level scope
   @ ~/Developer/k-local-gradient-descent/notebooks/jl_notebook_cell_df34fa98e69747e1a8f8a730347b8e2f_X53sZmlsZQ
@wsmoses
Copy link
Member

wsmoses commented Sep 29, 2024

julia> T = (Vector{Tuple{Code}} where {Code<:Integer})
Array{Tuple{Code}, 1} where Code<:Integer

julia> eltype(T)
Any

julia> @inline ptreltype(::Type{Array{T,N}}) where {T,N} = T
ptreltype (generic function with 1 method)

julia> ptreltype(T)
ERROR: UndefVarError: `T` not defined
Stacktrace:
 [1] ptreltype(::Type{Array{Tuple{Code}, 1} where Code<:Integer})
   @ Main ./REPL[6]:1
 [2] top-level scope
   @ REPL[7]:1

@wsmoses
Copy link
Member

wsmoses commented Sep 29, 2024

seems like a julia issue: JuliaLang/julia#55933

@mofeing
Copy link
Contributor Author

mofeing commented Oct 29, 2024

The fix has been identified and seems like it will appear in Julia 1.10.6 1.10.7 (didn't get in the cut by a matter of a couple of days)

Should we close this?

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

No branches or pull requests

2 participants