Merged
Conversation
support gelu normal mode on x86
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6604 +/- ##
==========================================
+ Coverage 93.41% 93.47% +0.05%
==========================================
Files 868 869 +1
Lines 275540 274712 -828
==========================================
- Hits 257391 256776 -615
+ Misses 18149 17936 -213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds SIMD-optimized erf function implementations for x86 (SSE, AVX, AVX512) and uses them to support the normal (non-fast) GELU activation mode with SIMD packing on x86, removing the previous fallback to scalar-only processing for normal GELU.
Changes:
- Added
erf_ps,erf256_ps, anderf512_psSIMD erf approximations in the respective mathfun headers - Added new
Erf_x86layer with SIMD-acceleratedforward_inplace - Extended
GELU_x86to support normal mode (erf-based) with SIMD, removing thesupport_packing = falseguard
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/layer/x86/sse_mathfun.h | Added SSE erf_ps polynomial approximation |
| src/layer/x86/avx_mathfun.h | Added AVX erf256_ps polynomial approximation |
| src/layer/x86/avx512_mathfun.h | Added AVX512 erf512_ps polynomial approximation |
| src/layer/x86/erf_x86.h | New Erf_x86 layer header |
| src/layer/x86/erf_x86.cpp | New Erf_x86 layer with SIMD forward_inplace |
| src/layer/x86/gelu_x86.cpp | Added normal GELU mode SIMD paths alongside existing fast GELU |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Thanks for your contribution ! |
chenglimin
pushed a commit
to chenglimin/ncnn
that referenced
this pull request
Apr 1, 2026
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.
support erf simd on x86
support gelu normal mode on x86