JuliaSIMD / JuliaSIMD/LoopVectorization.jl
Increased execution time bug (Ryzen CPU only?)
- Lingua principale
- Julia
- Stelle
- 789
- Fork
- 73
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi,
I have found a slowdown upon using the `@turbo` macro
```
using LoopVectorization,BenchmarkTools
function testSum(indices,Vectors)
A,B,C,D = Vectors
sum = 0.
for ksum in eachindex(indices)
k = indices[ksum]
sum += A[k] * B[k] +C[k] * D[k]
end
return sum
end
function testSum_avx(indices,Vectors)
A,B,C,D = Vectors
sum = 0.
@turbo for ksum in eachindex(indices)
k = indices[ksum]
sum += A[k] * B[k] +C[k] * D[k]
end
return sum
end
N = 63
Vectors = Tuple(rand(N) for _ in 1:4);
indices = rand(1:N,500);
@btime testSum($indices,$Vectors)
@btime testSum_avx($indices,$Vectors)
```
The output is:
```
510.417 ns (0 allocations: 0 bytes)
871.698 ns (0 allocations: 0 bytes)
```
I found this behaviour on two Ryzen CPU's (Ryzen 2700 and Ryzen 5 3500U).
On an intel CPU (Xeon(R) Gold 6130), the avx version does run faster.
For reference, I have posted a question on this behaviour on https://discourse.julialang.org/t/loopvectorization-almost-doubles-execution-time/64333.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.