Skip to content

Commit 1c292bf

Browse files
Sentimentronxnnpack-bot
authored andcommitted
[gn] Test building AVX512
Because we don't test it in Github Actions, AVX512 support has bit-rotted in GN a bit. Should take care of a cluster of failures in the latest Chrome integration attempt. [1] Also simplify/unify things for 32-bit. [1] https://chromium-review.googlesource.com/c/chromium/src/+/7615883?tab=checks PiperOrigin-RevId: 916227360
1 parent c3ac56a commit 1c292bf

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,19 @@ jobs:
380380
run: |
381381
git cl format --presubmit --no-clang-format --no-python --diff
382382
working-directory: ${{ github.workspace }}/xnnpack
383-
- name: Generate build files
383+
- name: Generate build files (with AVX512)
384+
run: |
385+
gn gen --check --args="is_debug=false clang_use_chrome_plugins=false dcheck_always_on=true cc_wrapper=\"ccache\" symbol_level=0 xnnpack_enable_avx512=true target_cpu=\"x64\" use_siso=true" out/x64.dchecks
386+
working-directory: ${{ github.workspace }}/xnnpack
387+
- name: Build all targets (Release + debug checks, with AVX512)
388+
run: |
389+
autoninja -C out/x64.dchecks
390+
working-directory: ${{ github.workspace }}/xnnpack
391+
- name: Generate build files (no AVX512)
384392
run: |
385393
gn gen --check --args="is_debug=false clang_use_chrome_plugins=false dcheck_always_on=true cc_wrapper=\"ccache\" symbol_level=0 xnnpack_enable_avx512=false target_cpu=\"x64\" use_siso=true" out/x64.dchecks
386394
working-directory: ${{ github.workspace }}/xnnpack
387-
- name: Build all targets (Release + debug checks)
395+
- name: Build all targets (Release + debug checks, without AVX512)
388396
run: |
389397
autoninja -C out/x64.dchecks
390398
working-directory: ${{ github.workspace }}/xnnpack

BUILD.gn

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import("gen/avx256vnni_microkernels.bzl")
5151
import("gen/avx256vnnigfni_microkernels.bzl")
5252
import("gen/avx2_microkernels.bzl")
5353
import("gen/avx512amx_microkernels.bzl")
54+
import("gen/avx512bf16_microkernels.bzl")
5455
import("gen/avx512f_microkernels.bzl")
5556
import("gen/avx512fp16_microkernels.bzl")
5657
import("gen/avx512skx_microkernels.bzl")
@@ -617,14 +618,11 @@ if (current_cpu == "x64" || current_cpu == "x86") {
617618
sources += ALL_AVX512AMX_MICROKERNEL_SRCS
618619
sources += ALL_AVX512SKX_MICROKERNEL_SRCS
619620
sources += ALL_AVX512VBMI_MICROKERNEL_SRCS
620-
621-
if (current_cpu == "x64") {
622-
# VNNI extensions are only supported for x64
623-
sources += ALL_AVX256VNNI_MICROKERNEL_SRCS
624-
sources += ALL_AVX256VNNIGFNI_MICROKERNEL_SRCS
625-
sources += ALL_AVX512VNNI_MICROKERNEL_SRCS
626-
sources += ALL_AVX512VNNIGFNI_MICROKERNEL_SRCS
627-
}
621+
sources += ALL_AVX512BF16_MICROKERNEL_SRCS
622+
sources += ALL_AVX256VNNI_MICROKERNEL_SRCS
623+
sources += ALL_AVX256VNNIGFNI_MICROKERNEL_SRCS
624+
sources += ALL_AVX512VNNI_MICROKERNEL_SRCS
625+
sources += ALL_AVX512VNNIGFNI_MICROKERNEL_SRCS
628626

629627
cflags = [
630628
"-mavx512f",
@@ -635,14 +633,11 @@ if (current_cpu == "x64" || current_cpu == "x86") {
635633
"-mamx-int8",
636634
"-mgfni",
637635
"-mavx512vbmi",
636+
"-mavx512bf16",
637+
"-mavxvnniint8",
638+
"-mavxvnni",
639+
"-mavx512vnni",
638640
]
639-
if (current_cpu == "x64") {
640-
cflags += [
641-
"-mavxvnniint8",
642-
"-mavxvnni",
643-
"-mavx512vnni",
644-
]
645-
}
646641
}
647642
xnnpack_source_set("avx_microkernels") {
648643
deps = [

0 commit comments

Comments
 (0)