Conversation
|
Collecting on CuArrays is a bad idea generally. Is there an mwe to show the value in fixing the instability? |
Indeed -- hence my desire to find a better way to do this that doesn't involve
In my application, I have a call to |
|
Is this branch needed at all? What's returned here goes back into the adjoint of cholesky, presumably. Does it read the wrong triangle at all? Maybe something like |
|
What's the type of julia> using LinearAlgebra
julia> A = rand(2, 2);
julia> typeof(triu(A)) === typeof(tril(A)) === Matrix{Float64}
true
julia> typeof(triu(UpperTriangular(A))) === typeof(tril(UpperTriangular(A))) === UpperTriangular{Float64,Matrix{Float64}}
true
julia> typeof(triu(LowerTriangular(A))) === typeof(tril(LowerTriangular(A))) === LowerTriangular{Float64,Matrix{Float64}}
true |
|
Related: JuliaLang/julia#42920 - question on whether we could have
are you using PDMats.chol_lower? |
The methods for
literal_getpropertyon the Cholesky factorisation are type-unstable. This instability stems from the value ofuplonot being known at compile time as it's dynamic.The only way that I can see around this is to ensure that we arrive at the same type for the
factorsfield regardless whetheruplois:Lor:U.I'm not 100% happy with using
collect-- it feels like it'll be a bad option for things likeCuArrays, to which this rule does in principle apply I believe. @oxinabox @mcabbott @DhairyaLGandhi @devmotion any thoughts on another way of achieving the same thing?Note: this should not prevent us moving forward with #1114 as this doesn't interfere with the rrule for
choleskyitself.