mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[AMD] use DC method for linalg.eigh (#140327)
Summary: Jacobi method has larger numerical errors, see D64997718, use divide-and-conquer method instead. Test Plan: CI Differential Revision: D65786796 Pull Request resolved: https://github.com/pytorch/pytorch/pull/140327 Approved by: https://github.com/jianyuh
This commit is contained in:
committed by
PyTorch MergeBot
parent
726424f4de
commit
cc8e832066
@ -1427,9 +1427,9 @@ static void linalg_eigh_cusolver_syevj_batched(const Tensor& eigenvalues, const
|
||||
}
|
||||
|
||||
void linalg_eigh_cusolver(const Tensor& eigenvalues, const Tensor& eigenvectors, const Tensor& infos, bool upper, bool compute_eigenvectors) {
|
||||
// for ROCm's hipSolver, syevj is fastest.
|
||||
#ifdef USE_ROCM
|
||||
linalg_eigh_cusolver_syevj(eigenvalues, eigenvectors, infos, upper, compute_eigenvectors);
|
||||
// syevj has larger numerical errors than syevd
|
||||
linalg_eigh_cusolver_syevd(eigenvalues, eigenvectors, infos, upper, compute_eigenvectors);
|
||||
#else
|
||||
if (use_cusolver_syevj_batched_ && batchCount(eigenvectors) > 1 && eigenvectors.size(-1) <= 32) {
|
||||
// Use syevjBatched for batched matrix operation when matrix size <= 32
|
||||
|
Reference in New Issue
Block a user