Skip to content

Commit d1df092

Browse files
authored
Bump vendored XNNPACK to include qd8_bf16_qb4w subgraph FC (pytorch#21400)
## Summary Bumps the vendored XNNPACK submodule (`backends/xnnpack/third-party/XNNPACK`) from `1adaa7c` to `92a7ad5` (current `google/XNNPACK` master). The key change picked up in this range is [google/XNNPACK#10818](google/XNNPACK#10818), which adds the **`qd8_bf16_qb4w` fully-connected path to the subgraph layer**. Before this, XNNPACK's subgraph layer could build `qd8_f32_qb4w` and `qd8_f16_qb4w` dynamic-quant FC subgraphs but had no bf16-scale variant, so a bf16 activation feeding an `8da4w` (int8-dynamic-activation / int4-weight, blockwise) linear could not be lowered/run through XNNPACK. This bump is a prerequisite for bf16 dynamic-quant (`8da4w`) delegation to XNNPACK; the ExecuTorch-side backend changes that consume it are in a follow-up PR. ## Test plan - Built ExecuTorch with the bumped submodule (x86, XNNPACK backend). - Exported `google/gemma-3-1b-it` with `--dtype bfloat16 --qlinear 8da4w --qembedding 8w` via `optimum-executorch` (XNNPACK recipe, custom SDPA + KV cache) — lowering succeeds and the FC nodes delegate as `qd8_bf16_qb4w`. - Runtime forward on the resulting `.pte` produces finite `bfloat16` logits with argmax matching the fp32 and bf16-no-quant baselines. cc @GregoryComer @digantdesai @cbilgin
1 parent a88ef35 commit d1df092

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎backends/xnnpack/cmake/Dependencies.cmake‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ if(WIN32)
6666
set_overridable_option(XNNPACK_ENABLE_AVX256VNNI OFF)
6767
set_overridable_option(XNNPACK_ENABLE_AVX256VNNIGFNI OFF)
6868
set_overridable_option(XNNPACK_ENABLE_AVX512BF16 OFF)
69+
# clang-cl (reported by CMake as Clang, not MSVC, so XNNPACK's own MSVC gate
70+
# does not catch it) crashes with an internal codegen error compiling some of
71+
# the AVX512-FP16 micro-kernels, so disable them on Windows.
72+
set_overridable_option(XNNPACK_ENABLE_AVX512FP16 OFF)
6973
endif()
7074

7175
set(XNNPACK_BUILD_ALL_MICROKERNELS
Submodule XNNPACK updated 2852 files

‎backends/xnnpack/third-party/xnnpack.buck.bzl‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ def define_xnnpack():
7070
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
7171
native.cxx_library(
7272
name = "subgraph",
73-
srcs = SUBGRAPH_SRCS + ["XNNPACK/src/datatype.c"],
73+
srcs = SUBGRAPH_SRCS + [
74+
"XNNPACK/src/datatype.c",
75+
"XNNPACK/src/subgraph/rewrites/cvt_to_fp32.cc",
76+
],
7477
compiler_flags = [
7578
"-Wno-error=missing-braces", # required since the SGX toolchain does not have this by default
7679
],
@@ -1150,6 +1153,7 @@ def define_xnnpack():
11501153
"XNNPACK/src/init.c",
11511154
"XNNPACK/src/params.c",
11521155
"XNNPACK/src/configs/hardware-config.c",
1156+
"XNNPACK/src/xnnpack/init-once.c",
11531157
"XNNPACK/src/microparams-init.c",
11541158
"XNNPACK/src/microkernel-utils.c",
11551159
"XNNPACK/src/reference/binary-elementwise.cc",

0 commit comments

Comments
 (0)