Skip to content

Add RVV implementation for exp#6637

Merged
nihui merged 2 commits into
Tencent:masterfrom
ihb2032:opt/rvv-exp
Apr 6, 2026
Merged

Add RVV implementation for exp#6637
nihui merged 2 commits into
Tencent:masterfrom
ihb2032:opt/rvv-exp

Conversation

@ihb2032
Copy link
Copy Markdown
Contributor

@ihb2032 ihb2032 commented Apr 4, 2026

Add exp operator implementation using RVV intrinsics.

@github-actions github-actions Bot added the riscv label Apr 4, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 68.64407% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.79%. Comparing base (3318da2) to head (877a97a).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
src/layer/riscv/exp_riscv_zfh.cpp 51.35% 36 Missing ⚠️
src/layer/riscv/exp_riscv.cpp 97.72% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6637      +/-   ##
==========================================
+ Coverage   93.75%   93.79%   +0.03%     
==========================================
  Files         907      913       +6     
  Lines      286651   288079    +1428     
==========================================
+ Hits       268761   270191    +1430     
+ Misses      17890    17888       -2     

☔ 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
Member

@nihui nihui left a comment

Choose a reason for hiding this comment

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

Legacy layers from the Caffe era, whether in PyTorch or ONNX, will no longer convert to ncnn's Exp and Log, but instead use UnaryOp. However, since you've already optimized them, I believe necessary unit tests are essential. You need to add code like test_exp and test_log to your tests; you can refer to other test implementations for examples.

Comment thread src/layer/riscv/exp_riscv.cpp
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
Copy link
Copy Markdown
Member

@nihui nihui left a comment

Choose a reason for hiding this comment

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

LGTM

@nihui nihui merged commit 74f3711 into Tencent:master Apr 6, 2026
95 of 97 checks passed
@nihui
Copy link
Copy Markdown
Member

nihui commented Apr 6, 2026

Thanks for your contribution !

@ihb2032 ihb2032 deleted the opt/rvv-exp branch April 6, 2026 05:01
vlordier pushed a commit to vlordier/ncnn that referenced this pull request Apr 10, 2026
* rvv: add exp
* add test

Signed-off-by: ihb2032 <hebome@foxmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants