Skip to content

rotaryembed/tanh/selu/mish/hardswish/hardsigmoid/gelu/erf/elu/eltwise/dropout/quantize/dequantize/bnll x86 support bf16 storage#6624

Merged
nihui merged 4 commits intoTencent:masterfrom
nihui:rope-x86-bf16s
Apr 1, 2026
Merged

Conversation

@nihui
Copy link
Copy Markdown
Member

@nihui nihui commented Mar 31, 2026

No description provided.

@github-actions github-actions bot added the x86 label Mar 31, 2026
@nihui nihui requested a review from Copilot March 31, 2026 08:09
@tencent-adm
Copy link
Copy Markdown
Member

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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 97.79710% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.17%. Comparing base (371bbad) to head (a6281e3).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/layer/x86/quantize_bf16s.h 87.26% 34 Missing ⚠️
src/layer/x86/dequantize_bf16s.h 99.29% 1 Missing ⚠️
src/layer/x86/dropout_x86.cpp 87.50% 1 Missing ⚠️
src/layer/x86/eltwise_x86.cpp 90.90% 1 Missing ⚠️
src/layer/x86/hardswish_bf16s.h 98.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6624      +/-   ##
==========================================
- Coverage   93.53%   93.17%   -0.36%     
==========================================
  Files         874      902      +28     
  Lines      281162   281968     +806     
==========================================
- Hits       262977   262720     -257     
- Misses      18185    19248    +1063     

☔ 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 x86-side bf16 storage support for the RotaryEmbed layer, including a bf16 implementation and an AVX512BF16 runtime-dispatched wrapper.

Changes:

  • Enable support_bf16_storage for RotaryEmbed_x86 and route bf16 inputs to a dedicated forward_bf16s() path.
  • Introduce rotaryembed_bf16s.h implementing the bf16 rotary-embedding kernel (with SIMD paths and optional AVX512BF16 runtime dispatch).
  • Add rotaryembed_x86_avx512bf16.cpp wrapper entrypoint for the AVX512BF16-dispatched bf16 kernel.

Reviewed changes

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

File Description
src/layer/x86/rotaryembed_x86.h Declares bf16 forward helper behind NCNN_BF16.
src/layer/x86/rotaryembed_x86.cpp Enables bf16 storage and dispatches to bf16 kernel when applicable.
src/layer/x86/rotaryembed_bf16s.h Adds bf16 kernel implementation + runtime AVX512BF16 dispatch hook.
src/layer/x86/rotaryembed_x86_avx512bf16.cpp Adds AVX512BF16 wrapper function for the runtime-dispatched bf16 path.

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

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

Copilot reviewed 56 out of 56 changed files in this pull request and generated 1 comment.


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

@nihui nihui changed the title rotaryembed x86 support bf16 storage rotaryembed/tanh/selu/mish/hardswish/hardsigmoid/gelu/erf/elu/eltwise/dropout/quantize/dequantize/bnll x86 support bf16 storage Mar 31, 2026
@nihui nihui merged commit 5bfcbfd into Tencent:master Apr 1, 2026
83 of 88 checks passed
chenglimin pushed a commit to chenglimin/ncnn that referenced this pull request Apr 1, 2026
…/dropout/quantize/dequantize/bnll x86 support bf16 storage (Tencent#6624)
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