Make use of pytorch's batched symeig
See original GitHub issuebatched symeig
is supported since https://github.com/pytorch/pytorch/pull/21858
We should update batch_symeig
to use this new feature (we still want to manually offload to cpu for small matrices for now, until pytorch does it. See discussion here: https://github.com/pytorch/pytorch/issues/22573
We can keep things backward-compatible by catching the exception emitted by the old implementation.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
torch.symeig — PyTorch 1.13 documentation
This function returns eigenvalues and eigenvectors of a real symmetric or complex Hermitian matrix input or a batch thereof, represented by a namedtuple...
Read more >Source code for xitorch.linalg.symeig
Source code for xitorch.linalg.symeig. import warnings import torch from typing import Union, Mapping, Any, Optional, Tuple, Callable from xitorch import ...
Read more >Port symeig to ATen and enable batching of inputs (#21858 ...
Summary: Changelog: - Port `symeig` from TH/THC to ATen - Enable batching of matrix inputs for `symeig` - Modify derivative computation ...
Read more >Symeig — torch_symeig • torch
Arguments. self. (Tensor) the input tensor of size (∗,n,n) where * is zero or more batch dimensions consisting of symmetric matrices. eigenvectors.
Read more >Batch-efficient EigenDecomposition for Small and Medium ...
One crucial bottleneck limiting its usage is the. ... matrices in a mini-batch as the speed can be made consistent by shifting.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a branch that creates a C wrapper for cusolver’s batch symeig (from 4 months ago). I can try to revive it.
Just to chime in here: while it is still a for loop internally, the batched symeig implementation saves a lot of time by performing just one clone to get column major matrices, while a naive implementation using a loop would perform as many clones as there are batches. There’s also the reshaping cost (but I’m not sure how high the overhead would be).
On the CPU, I can see a significant improvement in computation times for matrix sizes <= 32 between batched symeig and the naive implementation batched symeig.
As discussed on Slack, a cuSolver based implementation would be really helpful, but it could be beyond the scope of the next release.