-
-
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
Make adjoint and solve work for most factorizations #40899
Conversation
18fe185
to
998072a
Compare
9e122d5
to
1d6cba1
Compare
d87949b fixes JuliaLang/LinearAlgebra.jl#853 so that one should be backported. @KristofferC would you prefer that I move that commit to a separate PR? |
bfa3dc8
to
e94e695
Compare
This one is ready |
Factorizations to make \ work for adjoint LQ.
for Factorizations
systems to LAPACK factorizations
then new \ for LAPACKFactorizations.
7195baa
to
a6f222c
Compare
The only failure here is a download failure on Mac due to connectivity issue so I think it's ready. |
* Add adjoint for Cholesky * Implement adjoint for BunchKaufman * Fix ldiv! for adjoints of Hessenbergs * Add adjoint of LDLt * Fix return for tall problems in fallback \ method for adjoint of Factorizations to make \ work for adjoint LQ. * Fix qr(A)'\b * Define adjoint for SVD * Improve promotion in fallback by defining general convert methods for Factorizations * Fix ldiv! for SVD * Restrict the general \ definition that handles over- and underdetermined systems to LAPACK factorizations * Remove redundant \ definitions in diagonal.jl * Add Factorization constructors for SVD * Disambiguate between the specialized \ for real lhs-complex rhs and then new \ for LAPACKFactorizations. * Adjustments based on review * Fixes for new pivoting syntax
This PR 'broke' CUDA.jl, because it switched from calling @andreasnoack suggestions on a fix? Should this code in Base use |
I think something like |
I guess we could just change the Maybe we need test LinearAlgebra with a custom array type to ensure that we don't break CUDA. It'll probably be a lot of work so we should fix the immediate issue first. |
* Add adjoint for Cholesky * Implement adjoint for BunchKaufman * Fix ldiv! for adjoints of Hessenbergs * Add adjoint of LDLt * Fix return for tall problems in fallback \ method for adjoint of Factorizations to make \ work for adjoint LQ. * Fix qr(A)'\b * Define adjoint for SVD * Improve promotion in fallback by defining general convert methods for Factorizations * Fix ldiv! for SVD * Restrict the general \ definition that handles over- and underdetermined systems to LAPACK factorizations * Remove redundant \ definitions in diagonal.jl * Add Factorization constructors for SVD * Disambiguate between the specialized \ for real lhs-complex rhs and then new \ for LAPACKFactorizations. * Adjustments based on review * Fixes for new pivoting syntax
Assume this makes |
This should handle the dense cases in JuliaLang/LinearAlgebra.jl#776 for which
ldiv!
is defined. A few commentsBunchKaufman
, I've decided to error out onadjoint
for factorizations of complex symmetric matrices. I'm not sure that there is a nice way to applyadjoint
to such matrices and I'm pretty sure that the use of it will be minimal.Adjoint{LQ}
even though it's the same as a QR which has the least square behavior. Lately, there has been some discussion about the least squares behavior of\
being too magical so for now it's an error forAdjoint{LQ}
.Adjoint{<:QRFamily}
since it came almost for free.\
generic and therefore possible to remove definitions for\
that were specific toLQ
andQRFamily
.cc @oxinabox