-
Notifications
You must be signed in to change notification settings - Fork 29
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
Spurious printing of "DiffRules._abs_deriv" when LoopVectorization.jl loaded #26
Spurious printing of "DiffRules._abs_deriv" when LoopVectorization.jl loaded #26
Comments
What's going on is that it tries to expand julia> let v = [-1, 0, 1, 2]
@tullio out := abs(v[i]) verbose=true
end
┌ Info: symbolic gradients
│ inbody =
│ 1-element Array{Any,1}:
└ :(𝛥v[i] = 𝛥v[i] + conj(conj(𝛥ℛ[1]) * DiffRules._abs_deriv(v[i])))
DiffRules._abs_deriv
┌ Warning: LoopVectorization failed (symbolic gradient)
│ err =
│ LoadError: "Expression not recognized."
│ in expression starting at /Users/me/.julia/packages/Tullio/MpOl9/src/macro.jl:856
└ @ Tullio ~/.julia/packages/Tullio/MpOl9/src/macro.jl:864 And just before it fails, it helpfully prints out the problematic expression: It seems a little un-Junlian to need try/catch, but it seems otherwise hard to predict what will or won't work. I'm not even sure why it dislikes julia> let v = [-1, 0, 1, 2]
@tullio a[i] := Tullio.DiffRules._abs_deriv(v[i])
end
ERROR: TypeError: non-boolean (VectorizationBase.Mask{4,UInt8}) used in boolean context
Stacktrace:
[1] _abs_deriv at /Users/me/.julia/packages/DiffRules/5QwtC/src/rules.jl:72 [inlined]
|
This particular case is silenced by 3d6d677. |
Hm, won't there be a performance overhead from the |
Sure, but I don't think it's the biggest concern. On a fresh session, it takes about this long to run the macro:
and with LoopVectorization:
I would love this to be quicker, but don't know how. Slightly sad comparison:
(Edit -- replaced with If I'm doing this right, the try-catch itself costs about 60μs, compared to 1ms. I guess the cost of expanding |
Oh, I didn't realize the |
Is this maybe some
println
debugging that didn't get removed?The text was updated successfully, but these errors were encountered: