Giter VIP home page Giter VIP logo

Comments (3)

mcabbott avatar mcabbott commented on May 23, 2024

Thanks for the report, and for narrowing it down.

I think I see what's going on now. My fix for #46 was to interpolate many basic functions, which results in this:

julia> :(zero(T)) |> dump
Expr
  head: Symbol call
  args: Array{Any}((2,))
    1: Symbol zero
    2: Symbol T

julia> :($zero(T)) |> dump
Expr
  head: Symbol call
  args: Array{Any}((2,))
    1: zero (function of type typeof(zero))
    2: Symbol T

And LoopVectorization doesn't like that at all:

lex1 = quote
    @avx for i in 1:10
        acc = zero(T)
        for j in 1:10
            acc += A[i,j]
        end
        B[i] = acc
    end
end

lex2 = quote
    @avx for i in 1:10
        acc = $zero(T)
        for j in 1:10
            acc += A[i,j]
        end
        B[i] = acc
    end
end

macroexpand(Main, lex1) # ok

macroexpand(Main, lex2) # MethodError: no method matching instruction!(::LoopVectorization.LoopSet, ::typeof(zero))

The error during expansion is caught, so you get only the slow Base version:

julia> using Tullio, LoopVectorization

julia> A, B, C = rand(9,9), rand(9,9), rand(9,9);

julia> @tullio C[i, j] = A[i, k] * B[k, j] grad=false verbose=1;
┌ Warning: LoopVectorization failed 
│   err =
│    LoadError: MethodError: no method matching instruction!(::LoopVectorization.LoopSet, ::typeof(zero))
...

I'm not sure which side the fix should be on. Perhaps I should undo some of these interpolations in the meantime.

from tullio.jl.

MasonProtter avatar MasonProtter commented on May 23, 2024

Ah of course. Yeah, this is a good example of a way in which LoopVectorization.jl is operating kinda at the wrong level of abstraction. Hopefully we can remedy this with the new compiler technology, but that'll have to wait and see...

from tullio.jl.

mcabbott avatar mcabbott commented on May 23, 2024

I'm going to mark this as closed, since I think v0.2.10 fixes it.

And will make a note to check that any further work on #46 doesn't break this!

from tullio.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.