-
Notifications
You must be signed in to change notification settings - Fork 66
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
Unconditional max_methods=1 #462
Conversation
Well, it doesn't seem to help either. julia> @time @eval function AmulB!(C,A,B)
@turbo for n ∈ indices((C,B),2), m ∈ indices((C,A),1)
Cmn = zero(eltype(C))
for k ∈ indices((A,B),(2,1))
Cmn += A[m,k] * B[k,n]
end
C[m,n] = Cmn
end
end
0.023787 seconds (4.70 k allocations: 271.455 KiB, 76.64% compilation time)
AmulB! (generic function with 1 method)
julia> M = K = N = 71; A = rand(M,K); B = rand(K,N); C1 = A*B; C0 = zero(C1);
julia> @time @eval AmulB!(C0, A, B);
2.113024 seconds (4.32 M allocations: 261.378 MiB, 3.93% gc time, 99.99% compilation time) Latest release: julia> @time @eval function AmulB!(C,A,B)
@turbo for n ∈ indices((C,B),2), m ∈ indices((C,A),1)
Cmn = zero(eltype(C))
for k ∈ indices((A,B),(2,1))
Cmn += A[m,k] * B[k,n]
end
C[m,n] = Cmn
end
end
0.024604 seconds (4.70 k allocations: 271.307 KiB, 76.93% compilation time)
AmulB! (generic function with 1 method)
julia> M = K = N = 71; A = rand(M,K); B = rand(K,N); C1 = A*B; C0 = zero(C1);
julia> @time @eval AmulB!(C0, A, B);
2.093600 seconds (4.30 M allocations: 260.192 MiB, 4.07% gc time, 99.99% compilation time) Of course, there is a ton of type unstable code in LV to process expressions. Maybe I should merge this anyway as a symbolic gesture. |
I was wondering if it could effect compilation downstream though when it's being hit behind a function barrier (due to the autoswitch solvers). That's really tedious to test though. |
Which is why I was thinking this may help.
I'm going to But I think For reference: JuliaLang/julia#44426 But I think we should also see more examples where it helps before going all out. |
I run into type instabilities immediately. |
There should be some due to the auto-switch, which does manual branching in order to get around the way it would dispatch, but I'm not sure it gives good precompilation. |
Even without autoswitch EDIT: false alarm |
Codecov ReportBase: 87.00% // Head: 86.84% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #462 +/- ##
==========================================
- Coverage 87.00% 86.84% -0.17%
==========================================
Files 38 38
Lines 9372 9372
==========================================
- Hits 8154 8139 -15
- Misses 1218 1233 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@ChrisRackauckas no fear
max_methods=1
can't hurt you ifyou're pure of hearttype stable.