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

Cassette doesn't recurse through into Core._apply_iterate #155

Closed
KristofferC opened this issue Jan 3, 2020 · 2 comments · Fixed by #158
Closed

Cassette doesn't recurse through into Core._apply_iterate #155

KristofferC opened this issue Jan 3, 2020 · 2 comments · Fixed by #158

Comments

@KristofferC
Copy link
Contributor

This caused the following downstream issue: triscale-innov/GFlops.jl#6.

JuliaInterpreter also had to deal with this (JuliaDebug/JuliaInterpreter.jl#350).

@ffevotte
Copy link

Hi, I'd like to re-open this since the aforementioned downstream issue has not disappeared: triscale-innov/GFlops.jl#6.

Here is a minimal example, which is working with Cassette v0.3.1 and Julia 1.3 but not with Julia nightly:

using Cassette
Cassette.@context Ctx;

function Cassette.prehook(ctx::Ctx,
                          op::Any,
                          a::T1, b::T2) where {T1, T2}
    println((op, T1, T2))
end

ctx = Ctx()
Cassette.overdub(ctx, ()->pi*2.0)

we would expect to see a call to *(::Float64, ::Float64) somewhere in the list of method calls seen by Cassette, but it is not seen (with Julia nightly):

(*, Irrational{:π}, Float64)
(promote, Irrational{:π}, Float64)
(Base._promote, Irrational{:π}, Float64)
(promote_type, DataType, DataType)
(promote_rule, DataType, DataType)
(promote_type, DataType, DataType)
(promote_rule, DataType, DataType)
(promote_type, DataType, Core.TypeofBottom)
(convert, DataType, Irrational{:π})
(convert, DataType, Float64)
(tuple, Float64, Float64)
(Base.indexed_iterate, Tuple{Float64,Float64}, Int64)
(getfield, Tuple{Float64,Float64}, Int64)
(+, Int64, Int64)
(Core.Intrinsics.add_int, Int64, Int64)
(tuple, Float64, Int64)
(getfield, Tuple{Float64,Int64}, Int64)
(getfield, Tuple{Float64,Int64}, Int64)
(getfield, Tuple{Float64,Float64}, Int64)
(+, Int64, Int64)
(Core.Intrinsics.add_int, Int64, Int64)
(tuple, Float64, Int64)
(getfield, Tuple{Float64,Int64}, Int64)
(tuple, Irrational{:π}, Float64)
(tuple, Float64, Float64)
(Base.not_sametype, Tuple{Irrational{:π},Float64}, Tuple{Float64,Float64})
(tuple, Float64, Float64)

I could of course change GFlops.jl tests so that this (admittedly infrequent) case is not tested, but I feel like this might perhaps indicate that there are still deeper issues affecting Cassette with Julia nightly...

Please don't hesitate to tell me if I can do anything to help!

@ffevotte
Copy link

Oh, I just noticed that this was fixed in #162 and #163. Sorry for the noise.

Is there a patch release planned for Cassette any time soon?

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

Successfully merging a pull request may close this issue.

2 participants