# Flux vs pytorch cpu performance

**URL:** <https://discourse.julialang.org/t/flux-vs-pytorch-cpu-performance/42667>\
**Category:** Machine Learning\
**Tags:** first-steps, flux\
**Created:** [July 7, 2020, 10:10am UTC](https://discourse.julialang.org/t/flux-vs-pytorch-cpu-performance/42667 "2020-07-07T10:10:52Z")\
**Posts on this page:** 1\
**Showing post:** 50

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [July 20, 2020, 9:29pm UTC](https://discourse.julialang.org/t/flux-vs-pytorch-cpu-performance/42667/50 "2020-07-20T21:29:15Z")

</div>

Did you use `@avx` with SLEEFPirates? It will not reliably SIMD without it.

EDIT:  
Also, FWIW, the relative error in the example we provided is:

```julia
julia> tanh(0.0001)
9.999999966666668e-5

julia> (SLEEFPirates.tanh_fast(0.0001) - ans)/ans
2.8135046469782325e-13

```

Ideally, we want to be within a few units in last place (ulp). I.e., `prevfload(x, n)` should get you the exact answer with `abs(n) <= 4` or so.

---

_[View the full topic](https://discourse.julialang.org/t/flux-vs-pytorch-cpu-performance/42667)._
