# Torch.svd is slow in GPU compared to CPU

**URL:** <https://discuss.pytorch.org/t/torch-svd-is-slow-in-gpu-compared-to-cpu/10770>\
**Category:** Uncategorized\
**Created:** [December 4, 2017, 6:58pm UTC](https://discuss.pytorch.org/t/torch-svd-is-slow-in-gpu-compared-to-cpu/10770 "2017-12-04T18:58:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![SimonW](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/simonw/32/1702_2.png) [@SimonW](https://discuss.pytorch.org/u/SimonW)\
**Post date:** [December 4, 2017, 7:06pm UTC](https://discuss.pytorch.org/t/torch-svd-is-slow-in-gpu-compared-to-cpu/10770/2 "2017-12-04T19:06:17Z")

</div>

This is because magma’s implementation of ?gesvd is used under the hood. Unfortunately, the implementation is not purely on GPU and still calls LAPACK/BLAS functions ([https://github.com/maxhutch/magma/blob/master/src/dgesvd.cpp](https://github.com/maxhutch/magma/blob/master/src/dgesvd.cpp)). That is probably why you are seeing these idle times on GPU.

---

_[View the full topic](https://discuss.pytorch.org/t/torch-svd-is-slow-in-gpu-compared-to-cpu/10770)._
