-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[feature request] Spectral norm support in torch.norm or factor out Power Iteration from spectralnormalization in some other place and orthogonalization from PowerSGD hook #12760
Comments
I like the idea. What API do you assume after supports |
NumPy does this by supporting additional
|
Ah, I'm concerned with how to handle u and v. |
|
@vadimkantorov, factoring out orthogonalization from PowerSGD is a good idea, but the orthogonalization operation there is currently much slower than it could be. Based on recommendations in the appendix of this paper (and with help from one of the authors), @younik is currently looking into replacing it with a custom CUDA kernel for the Householder method. It is work in progress, but we are seeing significant speedups. We hope to push a PR for this very soon. Speedups
|
PR on orthogonalize: #76673 |
Another consideration in broadening the applicability of spectral norm is either in documentation or implementation, control of convergence properties- for spectral norm and sister operations. For spectral norm, I believe it's tied to the ratio of top two eigenvalues for the power iteration method. I found today some torch documentation discussing how to handle such concerns in the
|
Currently PyTorch has a spectral matrix norm implementation based on power iteration hidden inside the SpectralNorm. Since new
torch.norm
supports matrix norms (e.g. nuclear norm), it may be good to move it there, so it's usable in other contexts too (e.g. for debugging/tracing spectral properties of neural net weights, and since PyTorch doesn't support truncated randomized SVD yet).The text was updated successfully, but these errors were encountered: