Skip to content

Bump vendored XNNPACK to include qd8_bf16_qb4w subgraph FC - #21400

Open
JakeStevens wants to merge 1 commit into
pytorch:mainfrom
JakeStevens:xnnpack-vendor-bump
Open

Bump vendored XNNPACK to include qd8_bf16_qb4w subgraph FC#21400
JakeStevens wants to merge 1 commit into
pytorch:mainfrom
JakeStevens:xnnpack-vendor-bump

Conversation

@JakeStevens

@JakeStevens JakeStevens commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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, 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

@JakeStevens
JakeStevens requested a review from digantdesai as a code owner July 27, 2026 16:07
@pytorch-bot

pytorch-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21400

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 65f9e4a with merge base 1a770b8 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 27, 2026
@JakeStevens JakeStevens added module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ release notes: xnnpack Changes to the XNNPack backend delegate labels Jul 27, 2026
@JakeStevens
JakeStevens force-pushed the xnnpack-vendor-bump branch from 9eddde7 to 094ceb2 Compare July 27, 2026 17:20
Bumps backends/xnnpack/third-party/XNNPACK from 1adaa7c to 92a7ad5
(google/XNNPACK master, PR pytorch#10818), adding the qd8_bf16_qb4w
fully-connected path to the subgraph layer. Required for bf16 dynamic
quant (8da4w) to lower and run via XNNPACK.

This XNNPACK revision splits two new source files out of existing
translation units, so the ExecuTorch Buck build (which enumerates
sources explicitly rather than via CMake) must list them or linking
fails with undefined symbols:
- src/subgraph/rewrites/cvt_to_fp32.cc (fp16/bf16 -> fp32 fallback
  rewrite; defines xnn_subgraph_fallback_from_{fp16,bf16}_to_fp32 and
  xnn_subgraph_alias_fp32_fallback_data) -> added to the 'subgraph' target.
- src/xnnpack/init-once.c (defines xnn_init_once_impl /
  xnn_reset_all_init_guards; in CMake it is part of the
  xnnpack-hardware-config object lib) -> added to the 'XNNPACK' target
  next to configs/hardware-config.c.

It also adds new AVX512-FP16 micro-kernels (e.g. f16-vapproxgelu) that
crash clang-cl 18's codegen on Windows. clang-cl is reported to CMake as
Clang (not MSVC), so XNNPACK's own MSVC gate for AVX512FP16 does not
apply; disable XNNPACK_ENABLE_AVX512FP16 on Windows in the existing
WIN32 block alongside the other options that don't build there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: xnnpack Issues related to xnnpack delegation and the code under backends/xnnpack/ release notes: xnnpack Changes to the XNNPack backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant