JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Increased execution time bug (Ryzen CPU only?)

Offen
#299 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
789
Forks
73
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.