-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add bias_riscv #6025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bias_riscv #6025
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6025 +/- ##
===========================================
+ Coverage 94.69% 95.64% +0.94%
===========================================
Files 769 414 -355
Lines 238897 111121 -127776
===========================================
- Hits 226227 106280 -119947
+ Misses 12670 4841 -7829 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The binary size change of libncnn.so (bytes)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a RISC-V optimized implementation for applying bias in neural network layers, targeting improved performance with FP16 support. Key changes include:
- Addition of a new source file (bias_riscv_zfh.cpp) implementing vectorized FP16 bias application using RISC-V intrinsics.
- Extension of the Bias_riscv class in the header (bias_riscv.h) to declare the FP16-specific function.
- Update of the Bias_riscv implementation (bias_riscv.cpp) to use the new FP16 vectorized function when appropriate.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/layer/riscv/bias_riscv_zfh.cpp | New FP16 vectorized bias addition implementation using __riscv_zvfh intrinsics with a fallback scalar loop. |
src/layer/riscv/bias_riscv.h | Declaration of the new forward_inplace_fp16s function within the Bias_riscv class. |
src/layer/riscv/bias_riscv.cpp | Modifications to invoke the FP16 optimized function based on runtime conditions. |
Thanks for your contribution ! |
添加 bias 的 riscv 优化