-
Notifications
You must be signed in to change notification settings - Fork 28
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
Massive performance degredation between v0.2.8 and v0.2.9 with LoopVectorization.jl #50
Comments
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. |
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... |
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! |
I think something is not being communicated correctly to LoopVectorization.jl on version 0.2.9:
Now, restarting julia,
The text was updated successfully, but these errors were encountered: