-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
zillions of allocations in eig? #16751
Comments
The issue is on 0.4 and master. I am pretty sure there was a PR for a type stable eig. |
The issue is discussed in #4006. Making
It should also be noted that the type stability doesn't matter much for non-small problems. Most of the time is spent in LAPACK. Compare julia> A = rand(1000,1000);
julia> @time eig(A);
2.258325 seconds (9.33 k allocations: 76.175 MB, 1.38% gc time)
julia> @time LAPACK.geev!('N', 'V', copy(A));
2.409304 seconds (20 allocations: 15.534 MB, 3.63% gc time)
julia> @time eig(A);
2.224663 seconds (9.33 k allocations: 76.175 MB, 0.28% gc time)
julia> @time LAPACK.geev!('N', 'V', copy(A));
2.209915 seconds (20 allocations: 15.534 MB, 0.17% gc time)
julia> @time eig(A);
2.229527 seconds (9.33 k allocations: 76.175 MB, 0.87% gc time)
julia> @time LAPACK.geev!('N', 'V', copy(A));
2.277948 seconds (20 allocations: 15.534 MB, 3.28% gc time) |
There could be a special version of |
I think the reason to do something about this is exactly for the small linear algebra case. |
My #13362 is marginally related (dealing with the number of outputs at the lapack wrapper level) and I've been meaning to get back to that. Half-joking, maybe we could return the imaginary component as a nullable? |
@andreasnoack, even if the result of |
The loop in if103: ; preds = %L51
store %jl_value_t* %103, %jl_value_t** %81, align 8
store %jl_value_t* inttoptr (i64 140328436789640 to %jl_value_t*), %jl_value_t** %7, align 8
store %jl_value_t* inttoptr (i64 140328434551472 to %jl_value_t*), %jl_value_t** %82, align 8
%285 = call %jl_value_t* @jl_box_int64(i64 signext %storemerge148)
store %jl_value_t* %285, %jl_value_t** %83, align 8
%286 = call %jl_value_t* @julia__unsafe_getindex_50342(%jl_value_t* inttoptr (i64 140328442456464 to %jl_value_t*), %jl_value_t** %7, i32 4)
store %jl_value_t* %286, %jl_value_t** %63, align 8
store %jl_value_t* %103, %jl_value_t** %64, align 8
br i1 %272, label %L55, label %if106 |
Yesterday, I looked at the output of On Saturday, June 4, 2016, Steven G. Johnson [email protected]
|
Yes. It's creating a ton of temporaries when there are complex values. I'll prepare a PR. |
The 10,000 allocations required in
eig
look suspicious, considering that all the work should occur in LAPACK. Is there a type instability ineig
somewhere? cc @andreasnoackThe text was updated successfully, but these errors were encountered: