GithubHelp home page GithubHelp logo

Comments (6)

jrevels avatar jrevels commented on August 16, 2024

That issue name 😂 Yeah, the "better" in that commit referred to a correctness improvement rather than a performance improvement 😛

Thanks for finding/cataloging these regressions, it's extremely useful.

from cassette.jl.

jrevels avatar jrevels commented on August 16, 2024

With #40 + JuliaLang/julia#26826 + a hack to also ignore Overdub{Execute} in the recursion limiting heuristic [1], this goes back to your "before" case...which is still inferring as Any.

Sigh.

[1] This is a separate hack from the spoofing we're using to ignore Overdub{Transform}...we haven't decided how to do it in a not hacky way yet.

from cassette.jl.

jrevels avatar jrevels commented on August 16, 2024

Okay, JuliaLang/julia#26826 now implements the recursion limiting spoofing in a way that fixes the problem we were hacking around, so with #40 and JuliaLang/julia#26826 this becomes:

julia> code_warntype(Cassette.overdub(Ctx, unsafe_load), Tuple{Ptr{Float32}})
Variables:
  o<optimized out>
  x1::Ptr{Float32}
  i<optimized out>

Body:
  begin
      Core.SSAValue(119) = (typeassert)(1, Int64)::Int64
      Core.SSAValue(192) = (pointerref)(x1::Ptr{Float32}, Core.SSAValue(119), 1)::Any
      return Core.SSAValue(192)
  end::Any

from cassette.jl.

maleadt avatar maleadt commented on August 16, 2024

Yay, looking good. Any idea which limit/deficiency prevents pointerref from being inferred?

from cassette.jl.

jrevels avatar jrevels commented on August 16, 2024

Any idea which limit/deficiency prevents pointerref from being inferred?

The problem was that intrinsics don't each have their own type - they're all of type Core.IntrinsicFunction, so inference relies on constant propagation in order to infer calls to them. However, Cassette's splatting was thwarting the compiler's ability to constant propagate. JuliaLang/julia#26826 enables varargs constant propagation (and adds another patch on top of the recursion limiting heuristic), thus allowing this case to be inferred.

Leveraging this required refactoring Cassette's overdub implementation a bit (#41), because storing the function in an intermediate Overdub struct was also getting in the way of constant propagation (and is no longer necessary, anyway, since I've been told that other compiler patches have since fixed the problems that struct was hacking around).

from cassette.jl.

jrevels avatar jrevels commented on August 16, 2024

closed by #41

from cassette.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.