Repository navigation
Support bf16 convolution in the subgraph and operator APIs - #11944
Open
JakeStevens wants to merge 2 commits into
Open
JakeStevens wants to merge 2 commits into
JakeStevens wants to merge 2 commits into
Conversation
This was referenced Nov 9, 2026
JakeStevens
force-pushed
the
bf16-conv-2
branch
2 times, most recently
from
November 23, 2026 16:57
7a43105 to
6693b04
Compare
Adds bf16 x bf16 -> fp32 scalar depthwise and c2 igemm micro-kernels, their
weight packers and micro-kernel tests, as the base for a native bf16
convolution. The scalar micro-kernels are reference implementations that test
the packers and aren't dispatched; the SIMD micro-kernels and the operator
follow in separate changes.
bf16-f32-dwconv-minmax-test # Apple M4 Max: [ PASSED ] 60 tests.
bf16-f32-igemm-minmax-test # Apple M4 Max: [ PASSED ] 52 tests.
Adds xnn_{create,reshape,setup}_convolution2d_nhwc_bf16_f32 and lets
xnn_define_{depthwise_,}convolution_2d accept bf16 inputs and filters, which
they previously rejected with xnn_status_unsupported_parameter (e.g. the
causal conv1d in Qwen3.5). The bf16 fallback keeps a convolution native, with
an fp32 output, when a bf16_f32 micro-kernel is available on a CPU with
hardware bf16 other than Apple's and its bias is absent or fp32. No configs
have micro-kernels yet, so for now bf16 convolutions run through the existing
fp32 rewrite. Also adds bf16_f32 operator tests (skipped until a config has
micro-kernels), BF16Convolution and BF16DepthwiseSeparable subgraph
benchmarks, and the CMake target for the existing subgraph convolution
benchmark.
convolution-2d-test # Apple M4 Max: [ PASSED ] 30 tests.
depthwise-convolution-2d-test # Apple M4 Max: [ PASSED ] 25 tests.
convolution-nhwc-test # Apple M4 Max: [ PASSED ] 911 tests (bf16_f32 skipped).
JakeStevens
force-pushed
the
bf16-conv-2
branch
from
November 24, 2026 15:16
6693b04 to
2788646
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds xnn_{create,reshape,setup}convolution2d_nhwc_bf16_f32 and lets
xnn_define{depthwise_,}convolution_2d accept bf16 inputs and filters, which
they previously rejected with xnn_status_unsupported_parameter (e.g. the
causal conv1d in Qwen3.5). The bf16 fallback keeps a convolution native, with
an fp32 output, when a bf16_f32 micro-kernel is available on a CPU with
hardware bf16 other than Apple's and its bias is absent or fp32. No configs
have micro-kernels yet, so for now bf16 convolutions run through the existing
fp32 rewrite. Also adds bf16_f32 operator tests (skipped until a config has
micro-kernels), BF16Convolution and BF16DepthwiseSeparable subgraph
benchmarks, and the CMake target for the existing subgraph convolution
benchmark.
Stacked on #11943; only the last commit is new.
Authored with Claude Code.