public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Intel AVX10.1 Compiler Design and Support
@ 2023-08-08  7:13 Haochen Jiang
  2023-08-08  7:13 ` [PATCH 1/3] Initial support for AVX10.1 Haochen Jiang
                   ` (12 more replies)
  0 siblings, 13 replies; 88+ messages in thread
From: Haochen Jiang @ 2023-08-08  7:13 UTC (permalink / raw)
  To: gcc-patches; +Cc: ubizjak, hongtao.liu

Hi all,

We will send out our initial support of AVX10 and some sample patches in this
mailing thread. And there will be more coming up afterwards. Therefore, we would
like to share our proposed AVX10 design in GCC.

Here is a quick introduction to AVX10:
  - AVX10 is the first major new ISA since the introduction of AVX512 in 2013.
  - Since the introduction of AVX10, we would like to establish a common,
    converged vector instruction set across all Intel architectures, including
    Xeon Server, Atom Server and Clients.
  - The default maximum vector size for AVX10 will be 256 bit, while 512 bit is
    optional.
  - AVX10.1 will include all existing AVX512 instructions in Granite Rapids.
  - There will be no new AVX512 CPUID introduced in future. All EVEX vector
    instructions will be under AVX10 umbrella.
  - AVX10 will be version-based ISA instead of tons of different CPUIDs like
    AVX512BW, AVX512DQ, AVX512FP16, etc.
  - Based on AVX10.1, AVX10.2 will introduce ymm embedded rounding, SAE
    (Suppressed All Exceptions) control and new instructions.

If you would like to have a closed look at the details, please follow the links
below:

Intel Advanced Vector Extensions 10 (Intel AVX10) Architecture Specification 
It describes the Intel Advanced Vector Extensions 10 Instruction Set
Architecture.
https://cdrdv2.intel.com/v1/dl/getContent/784267

The Converged Vector ISA: Intel Advanced Vector Extensions 10 Technical Paper
It provides introductory information regarding the converged vector ISA: Intel
Advanced Vector Extensions 10.
https://cdrdv2.intel.com/v1/dl/getContent/784343

Hence, we will have several compiler design ground rules for AVX10:
  - AVX10 is a converged ISA feature set.
    We will not provide -m[no-]xxx to enable/disable each single vector feature
    in one version as we used to before. Instead, a simple option -m[no-]avx10.x
    is used. If 512 bit version is needed, -mavx10.x-512 is all you need. Also,
    maximum vector width should be the same when different version of AVX10 is
    used. For example, enabling AVX10.1 with 512 bit vector width while enabling
    AVX10.2 with only 256 bit vector width is not a desired behavior.
  - AVX10 is an evolving ISA feature set.
    Every feature showed up in the current version will always show up in future
    version.
  - AVX10 is an independent ISA feature set.
    Although sharing the same instructions and encodings, AVX10 and AVX512 are
    conceptual independent features, which means they are orthogonal.

Since AVX10 will have several benefits like bringing AVX512 features on Atom
Server and Clients and getting rid of tons of AVX512 CPUIDs but a simple AVX10
option to enable features, we lean towards the adoption of AVX10 instead of
AVX512 from now on.

Based on all we got, we would like to introduce the following compiler options:
  - -mavx10.x: The option will enable AVX10.1-AVX10.x features with a default
    256 bit vector width to make sure the compatibility on all platforms.
  - -mavx10.x-512: The option will enable AVX10.1-AVX10.x features with 512 bit
    vector width. “-mno-avx10.x-512” option will not be provided to avoid
    confusion of disabling 512 vector width or avx10.x itself.
  - -mavx10.x-256: The option will enable AVX10.1-AVX10.x features with 256 bit
    vector width. But it will disable 512 bit vector width since the vector size
    is indicated in option. “-mno-avx10.x-256” option will not be provided to
    keep align with the 512 ones.
  - -mno-avx10.x: The option will disable all the features introduced >=avx10.x
    (both 256 and 512 bit) and keep features <avx10.x if enabled, just like how
    -mno- options behave previously.

When there comes an option combination of various vector size indicated
(e.g. -mavx10.x-512 -mavx10.y-256), we would like to emit a warning since the
vector size conflicts under this scenario. Also in the warning message, we will
indicate the last mentioned vector size will be picked. The ISA set will be the
highest one.

For the auto dispatch support including function __builtin_cpu_supports (),
function multi versioning, function attribute usage, the behavior will be
identical to compiler options, which means we will have avx10.x, avx10.x-256,
avx10.x-512 and no-avx10.x.

As we have mentioned before, we lean towards the adoption of AVX10 instead of
AVX512 from now on. Hence, we don’t recommend users to combine the AVX10 and
legacy AVX512 options since different users will have different opinions on
compiler behavior with option combinations like “-m[no-]avx10.1 -m[no-]avx512f"
and it is hard to tell whether compiler should open or close the feature under
those scenarios. Furthermore, we don't guarantee that the behavior is
consistent between GCC and LLVM/ICX.

From our understanding, we propose to maintain the independency between AVX10
and AVX512 switches. Therefore, opening one of them will turn on the feature,
no matter the other one is opened or not. We will emit a warning when user
enables one feature but disable the other afterwards. Some typical examples are
given to help better understand that:
  - -mno-avx512xxx: It will check if AVX10.1 is disabled when handling the
    option. If AVX10.1 is  disabled, it is valid and then disables AVX512xxx.
    If AVX10.1 not disabled, a warning will be emitted and -mno-avx512xxx will
    be ignored.
  - -mno-avx10.1: It will check if all AVX512 features in Granite Rapids are
    disabled when handling the option. If all disabled, it is valid and then
    disables all the features. If not, a warning will be emitted and
    -mno-avx10.1 will be ignored.
  - -mno-avx10.x (x >= 2): It is always valid.

Also, since we maintain the independency between AVX10 and AVX512 switches,
when using a compiler option of “-mavx10.x[-256] -mavx512xxx”, it will actually
open all the AVX10.x 128/256 bit vector instruction support and 512 bit vector
instruction support for AVX512xxx.

Last thing needed to be mentioned is -march options. We will imply AVX10
features for future platforms with AVX10 available, i.e., AVX10/512 for
Xeon Servers and AVX10/256 for Atom Servers and Clients. We purpose to change
the current -march=graniterapids/graniterapids-d from implying AVX512 features
to AVX10.1/512. No obvious behavior changes will happen for these two -march.

There will be a minor open after implying change: when we are using
-march=graniterapids -mno-avx512f or -mno-avx512f -march=graniterapids, it will
not disable AVX512F and it is a change in behavior. Should we emit a warning
for that? Our current behavior is not to emit a warning but I am open for
changes. However, I suppose if we finally choose to emit a warning, it should
only happen in Granite Rapids and Granite Rapids D since for the next
generation Xeon Server product, user should be aware of AVX10 change.

For the following nine patches, first three of them will be the initial support
for AVX10.1 while the latter six is the AVX10.1 support for AVX512DQ+AVX512VL.

If you have any questions, feel free to ask in this thread. Also, if you are
working on AVX512 related patterns during AVX10 upstreaming, especially
constraints, target check and iterators related, please kindly cc me in the
patches since there might be some conflicts.

Thx,
Haochen



^ permalink raw reply	[flat|nested] 88+ messages in thread

end of thread, other threads:[~2023-08-23  8:48 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08  7:13 Intel AVX10.1 Compiler Design and Support Haochen Jiang
2023-08-08  7:13 ` [PATCH 1/3] Initial support for AVX10.1 Haochen Jiang
2023-08-16  2:29   ` Hongtao Liu
2023-08-08  7:13 ` [PATCH 2/3] Emit a warning when disabling AVX512 with AVX10 enabled or disabling AVX10 with AVX512 enabled Haochen Jiang
2023-08-16  2:30   ` Hongtao Liu
2023-08-08  7:13 ` [PATCH 3/3] Emit a warning when AVX10 options conflict in vector width Haochen Jiang
2023-08-16  2:30   ` Hongtao Liu
2023-08-08  7:19 ` [PATCH 1/6] Support AVX10.1 for AVX512DQ+AVX512VL intrins Haochen Jiang
2023-08-08  7:20 ` [PATCH 2/6] " Haochen Jiang
2023-08-08  7:20 ` [PATCH 3/6] " Haochen Jiang
2023-08-08  7:20 ` [PATCH 4/6] " Haochen Jiang
2023-08-08  7:20 ` [PATCH 5/6] " Haochen Jiang
2023-08-08  7:20 ` [PATCH 6/6] " Haochen Jiang
2023-08-16  2:36   ` Hongtao Liu
2023-08-08  7:42 ` Intel AVX10.1 Compiler Design and Support Jakub Jelinek
2023-08-08  8:14   ` Jiang, Haochen
2023-08-08 12:44     ` Richard Biener
2023-08-09  2:06       ` Hongtao Liu
2023-08-09  2:08         ` Hongtao Liu
2023-08-09  6:30       ` Jiang, Haochen
2023-08-08 19:55 ` Joseph Myers
2023-08-09  1:21   ` Hongtao Liu
2023-08-09  2:14     ` Hongtao Liu
2023-08-09  2:18       ` Hongtao Liu
2023-08-09  3:59         ` Wang, Phoebe
2023-08-09 20:43           ` Joseph Myers
2023-08-09 20:49             ` Jakub Jelinek
2023-08-10 12:36             ` Phoebe Wang
2023-08-10 12:45               ` Richard Biener
2023-08-10 13:12                 ` Phoebe Wang
2023-08-10 13:30                   ` Jan Beulich
2023-08-10 13:52                     ` Richard Biener
2023-08-10 14:15                     ` Jiang, Haochen
2023-08-10 15:08                       ` Zhang, Annita
2023-08-10 15:18                         ` Jakub Jelinek
2023-08-10 22:16                 ` Joseph Myers
2023-08-09  4:01         ` Phoebe Wang
2023-08-09  5:37           ` Richard Biener
2023-08-09  6:24             ` Jiang, Haochen
2023-08-09  8:14             ` Florian Weimer
2023-08-09  8:24               ` Hongtao Liu
2023-08-09  7:17       ` Jan Beulich
2023-08-09  7:38         ` Hongtao Liu
2023-08-09  8:04           ` Jan Beulich
2023-08-09  9:15           ` Florian Weimer
2023-08-09 10:15             ` Hongtao Liu
2023-08-09 10:17             ` Zhang, Annita
2023-08-09 13:54               ` Michael Matz
2023-08-09 14:34                 ` Zhang, Annita
2023-08-10 15:08 ` Jiang, Haochen
2023-08-10 16:00   ` Jakub Jelinek
2023-08-19 22:44 ` ZiNgA BuRgA
2023-08-20  5:44   ` Richard Biener
2023-08-21  1:19   ` Hongtao Liu
2023-08-21  7:36     ` Richard Biener
2023-08-21  8:09       ` Jakub Jelinek
2023-08-21  8:28         ` Hongtao Liu
2023-08-21  8:37           ` Jakub Jelinek
2023-08-21  8:46             ` Hongtao Liu
2023-08-21  9:34           ` Richard Biener
2023-08-21  9:36             ` Richard Biener
2023-08-21  9:50             ` Hongtao Liu
2023-08-21  9:26       ` ZiNgA BuRgA
2023-08-22  3:20         ` Jiang, Haochen
2023-08-22  7:36           ` Richard Biener
2023-08-22  8:34             ` Jakub Jelinek
2023-08-22  8:35               ` Richard Biener
2023-08-22  8:52                 ` Jiang, Haochen
2023-08-22  9:23                   ` Richard Biener
2023-08-22 13:02               ` Hongtao Liu
2023-08-22 13:16                 ` Jakub Jelinek
2023-08-22 13:23                   ` Richard Biener
2023-08-22 13:35                     ` Hongtao Liu
2023-08-22 13:54                       ` Jakub Jelinek
2023-08-22 14:35                         ` Hongtao Liu
2023-08-22 15:01                           ` Jakub Jelinek
2023-08-23  1:57                             ` Jiang, Haochen
2023-08-23  2:19                               ` Hongtao Liu
2023-08-23  6:47                                 ` Jiang, Haochen
2023-08-23  8:16                               ` Jakub Jelinek
2023-08-23  8:27                                 ` Hongtao Liu
2023-08-23  7:32                           ` Richard Biener
2023-08-23  8:03                             ` Jiang, Haochen
2023-08-23  8:31                               ` Jakub Jelinek
2023-08-23  8:47                                 ` Hongtao Liu
2023-08-23  8:24                             ` Hongtao Liu
2023-08-22 14:39                       ` Hongtao Liu
2023-08-21  7:49     ` ZiNgA BuRgA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).