Skip to content

x86: add BinaryOp_x86 bf16s storage support with avx512bf16 dispatch#6591

Merged
nihui merged 6 commits intoTencent:masterfrom
nihui:binaryop-x86-bf16s
Mar 9, 2026
Merged

x86: add BinaryOp_x86 bf16s storage support with avx512bf16 dispatch#6591
nihui merged 6 commits intoTencent:masterfrom
nihui:binaryop-x86-bf16s

Conversation

@nihui
Copy link
Copy Markdown
Member

@nihui nihui commented Mar 9, 2026

No description provided.

@github-actions github-actions bot added the x86 label Mar 9, 2026
@tencent-adm
Copy link
Copy Markdown
Member

tencent-adm commented Mar 9, 2026

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@nihui nihui closed this Mar 9, 2026
@nihui nihui reopened this Mar 9, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 99.63031% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.83%. Comparing base (67a20c2) to head (f9b82ad).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/layer/x86/binaryop_bf16s.h 99.43% 1 Missing ⚠️
src/layer/x86/binaryop_x86.cpp 99.62% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6591      +/-   ##
==========================================
+ Coverage   92.71%   92.83%   +0.11%     
==========================================
  Files         846      849       +3     
  Lines      267472   268049     +577     
==========================================
+ Hits       247980   248834     +854     
+ Misses      19492    19215     -277     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds BF16 (bf16s) storage support to the x86 BinaryOp layer, including an AVX512-BF16 optimized implementation with runtime CPU dispatch.

Changes:

  • Refactors BinaryOp SIMD functors into a shared header (binaryop_x86_functor.h) for reuse across translation units.
  • Adds bf16s compute paths for BinaryOp (including broadcasting) and wires them into BinaryOp_x86 forward/forward_inplace.
  • Introduces an AVX512BF16-dispatched bf16s vector kernel implementation (binaryop_x86_avx512bf16.cpp).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/layer/x86/binaryop_x86_functor.h New shared SIMD functor definitions for BinaryOp operations.
src/layer/x86/binaryop_x86_bf16s.h New bf16s vector/broadcast kernels used by BinaryOp bf16 storage path.
src/layer/x86/binaryop_x86_avx512bf16.cpp AVX512BF16-optimized bf16s vector kernel entrypoint for runtime dispatch.
src/layer/x86/binaryop_x86.h Declares bf16s forward helpers on BinaryOp_x86 (guarded by NCNN_BF16).
src/layer/x86/binaryop_x86.cpp Wires bf16s support, functor refactor, and AVX512BF16 runtime dispatch into x86 BinaryOp.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nihui nihui merged commit 0137512 into Tencent:master Mar 9, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants