Skip to content

Add shuffle channel rvv optimization #6243

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AtomAlpaca
Copy link
Contributor

主要改动:

参考 #4907 添加了 shuffle channel rvv 优化
几乎没有对原 pr 的代码逻辑进行改动

close #6206

@github-actions github-actions bot added the riscv label Aug 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (9b91fe5) to head (c9075d1).
⚠️ Report is 2 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (9b91fe5) and HEAD (c9075d1). Click for more details.

HEAD has 26 uploads less than BASE
Flag BASE (9b91fe5) HEAD (c9075d1)
31 5
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6243       +/-   ##
===========================================
- Coverage   95.92%   90.71%    -5.21%     
===========================================
  Files         836      292      -544     
  Lines      264899    89584   -175315     
===========================================
- Hits       254098    81265   -172833     
+ Misses      10801     8319     -2482     

☔ 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

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15648008 15648008 0 😘
armhf 6649020 6649020 0 😘
aarch64 9987736 9987736 0 😘

@nihui nihui requested a review from Copilot August 11, 2025 02:09
Copy link

@Copilot 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

This PR adds RISC-V vector (RVV) optimization for the ShuffleChannel layer operation. It introduces optimized implementations for both fp32 and fp16/bf16 data types, leveraging RISC-V vector extensions to improve performance compared to scalar implementations.

  • Adds RVV-optimized shuffle channel operations with support for different element packing sizes
  • Implements specialized code paths for common group sizes (2, 4, 8) using vector gather operations
  • Provides fallback to unpacked processing for complex group configurations

Reviewed Changes

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

File Description
src/layer/riscv/shufflechannel_riscv.h Header file defining the RISC-V-specific ShuffleChannel class with forward declaration methods
src/layer/riscv/shufflechannel_riscv.cpp Main implementation with RVV optimizations for fp32 and fp16/bf16 shuffle operations

@AtomAlpaca AtomAlpaca changed the title Add shuffle channel rvv optmization Add shuffle channel rvv optimization Aug 11, 2025
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.

Update RVV intrinsic code from 0.7.1 to 1.0 standard in PR #4907
2 participants