What is the difference between AVX2 and AVX-512?
Asked Answered
V

1

7

In terms of SIMD and parallelization, what is the difference between AVX2 and AVX-512? Are they the same thing or different? I just see that double8 is used in AVX-512 and double4 is used for AVX2?

I am using PyOpenCL to write kernel code in C and not sure what the difference would be.

Vu answered 2/12, 2019 at 20:34 Comment(0)
C
17

AVX2 is a 256 bit vector instruction set. You have 256 bit registers which can be interpreted several ways (8 floats, 4 doubles, 32 bytes, etc). AVX1 supports only floating point operations, AVX2 adds 256 bit integer operations. AVX-512 is a set of 512 bit vector instructions. There are only 2 flavors of AVX, plain old AVX and AVX2. AVX-512 comes in many different flavors. You may find Intel's Intrinsics Guide interesting.

The biggest difference is simply getting twice as many operations processed per instruction. Though, there are certain instructions in AVX-512 which may make some specific things more optimal (exponent approximations, for example).

Chinachinaberry answered 2/12, 2019 at 21:8 Comment(2)
AVX512 introduces masking so you can more cheaply blend as part of another operation. Or even efficient masked loads/stores with fault-suppression in case the data you need to skip was in an unmapped page. Also scatter stores, vs. AVX2 only having gather loads. Also, you might want to mention FMA which is separate from AVX. AVX512 always includes FMA.Psychiatry
You might find this paper interestingAluminous

© 2022 - 2024 — McMap. All rights reserved.