# Slowdown due to subnormal float, coming from neural net training

**URL:** https://discourse.julialang.org/t/slowdown-due-to-subnormal-float-coming-from-neural-net-training/89286
**Category:** Performance
**Created:** [October 26, 2022, 9:28am UTC](https://discourse.julialang.org/t/slowdown-due-to-subnormal-float-coming-from-neural-net-training/89286 "2022-10-26T09:28:21Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [October 27, 2022, 11:03am UTC](https://discourse.julialang.org/t/slowdown-due-to-subnormal-float-coming-from-neural-net-training/89286/21 "2022-10-27T11:03:04Z")

</div>

> [@Elrod](#):
>
> Comparing to the gfortran timing above isn’t fair without at least `-O3 -march=native`, though.

I was not planing to compare anything except to see that this is effectively the default behavior in another language I develop (please let us not give fuel to another pointless “fairness” benchmark discussion). Of course we can tune that with compiler flags.

Edit, for the records:

```julia
julia> @btime subnormal_fortran!($C,$A2,$B,$b); # no opt flags
  116.997 μs (0 allocations: 0 bytes)

julia> @btime subnormal_fortranmarchnative!($C,$A2,$B,$b); # -march=native
  117.876 μs (0 allocations: 0 bytes)

julia> @btime subnormal_fortranO3!($C,$A2,$B,$b); # -O3
  26.371 μs (0 allocations: 0 bytes)

julia> @btime subnormal_fortranO3marchnative!($C,$A2,$B,$b); # -O3 -march=native
  13.739 μs (0 allocations: 0 bytes)

julia> @btime subnormal_fortranOfast!($C,$A2,$B,$b); # -Ofast
  753.076 ns (0 allocations: 0 bytes)

julia> @btime subnormal_fortranOfastmarchnative!($C,$A2,$B,$b); # -Ofast -march=native
  341.280 ns (0 allocations: 0 bytes)

```

[Previous page](https://discourse.julialang.org/t/slowdown-due-to-subnormal-float-coming-from-neural-net-training/89286.md?page=1)
