# Incorporating SVD factorization into GPUs with CUDA

**URL:** <https://discourse.julialang.org/t/incorporating-svd-factorization-into-gpus-with-cuda/99252>\
**Category:** Machine Learning\
**Tags:** question, cuda, svd\
**Created:** [May 22, 2023, 10:07pm UTC](https://discourse.julialang.org/t/incorporating-svd-factorization-into-gpus-with-cuda/99252 "2023-05-22T22:07:54Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jarroyoe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jarroyoe/32/42482_2.png) [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Post date:** [May 23, 2023, 1:12am UTC](https://discourse.julialang.org/t/incorporating-svd-factorization-into-gpus-with-cuda/99252/5 "2023-05-23T01:12:24Z")

</div>

I tried using the `opnorm` function, which would be the most efficient scenario. Sadly, Zygote doesn’t have chain rule rules for it. This link suggested using SVD instead.

> [@Implementation of Spectral Normalization for Machine Learning](https://discourse.julialang.org/t/implementation-of-spectral-normalization-for-machine-learning/76074/4):
>
> The problem is that there is currently no rrule defined for svdvals. A workaround would be to define: function snorm(X) return svd(X).S[1] end Which does a full svd (for which there is an rrule defined)

Power iterations may be an alternative, but I’d be concerned in convergence speed.

---

_[View the full topic](https://discourse.julialang.org/t/incorporating-svd-factorization-into-gpus-with-cuda/99252)._
