question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make use of pytorch's batched symeig

See original GitHub issue

batched 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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gpleisscommented, Jul 23, 2019

I have a branch that creates a C wrapper for cusolver’s batch symeig (from 4 months ago). I can try to revive it.

1reaction
vishwakftwcommented, Jul 22, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found