# 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:** 15

<div class="post-metadata">

### Author: ![d1cker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/d1cker/32/9816_2.png) [@d1cker](https://discourse.julialang.org/u/d1cker)
#### Post date: [July 8, 2020, 2:05pm UTC](https://discourse.julialang.org/t/flux-vs-pytorch-cpu-performance/42667/15 "2020-07-08T14:05:51Z")

</div>

```julia
julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

```

Benchmarks:

```julia
julia> @btime $ww * $xx;
  21.679 μs (2 allocations: 125.08 KiB)

julia> @btime tanh.($xx);
  1.256 ms (2 allocations: 250.08 KiB)

julia> @btime @avx tanh.($xx);
  142.913 μs (2 allocations: 250.08 KiB)

```

Don’t think it is only the avx stuff that make pytorch fast because of the 10x(0.3ms vs 3ms) difference. I wonder what other optimization pytorch has 🤔

---

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