# CPU slower than GPU on small networks

**URL:** <https://discuss.pytorch.org/t/cpu-slower-than-gpu-on-small-networks/11988>\
**Category:** Uncategorized\
**Created:** [January 7, 2018, 5:24pm UTC](https://discuss.pytorch.org/t/cpu-slower-than-gpu-on-small-networks/11988 "2018-01-07T17:24:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefanonardo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/stefanonardo/32/2322_2.png) [@stefanonardo](https://discuss.pytorch.org/u/stefanonardo)\
**Post date:** [January 7, 2018, 5:24pm UTC](https://discuss.pytorch.org/t/cpu-slower-than-gpu-on-small-networks/11988/1 "2018-01-07T17:24:23Z")

</div>

My CPU is always slower than the GPU on the training of 10 units RNN. The dataset is a timeseries with both input and output dimension 1. No matter how many timesteps I choose for training, 200 or 4000, CPU is always slower.  
Is it normal? Am I missing any library to install?

CPU: i5 4690k  
GPU: GTX 1060

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [January 8, 2018, 2:27pm UTC](https://discuss.pytorch.org/t/cpu-slower-than-gpu-on-small-networks/11988/2 "2018-01-08T14:27:28Z")

</div>

10-unit RNNs are quite small, it seems weird that CPU is slower.

Try:

`OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 python [yourscript.py]`

---

<div class="post-metadata">

**Author:** ![stefanonardo](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/stefanonardo/32/2322_2.png) [@stefanonardo](https://discuss.pytorch.org/u/stefanonardo)\
**Post date:** [January 8, 2018, 3:16pm UTC](https://discuss.pytorch.org/t/cpu-slower-than-gpu-on-small-networks/11988/3 "2018-01-08T15:16:52Z")

</div>

@smth Still the same.
