Skip to content

RVV1.0 Requantize Layer#6695

Merged
nihui merged 7 commits into
Tencent:masterfrom
Deepdive543443:requantize-riscv/PR
May 18, 2026
Merged

RVV1.0 Requantize Layer#6695
nihui merged 7 commits into
Tencent:masterfrom
Deepdive543443:requantize-riscv/PR

Conversation

@Deepdive543443
Copy link
Copy Markdown
Contributor

Road to int8 optimization Episode 3: Requantize Layer

@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 all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Deepdive543443
❌ nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

@nihui nihui requested a review from Copilot May 15, 2026 06:54
@nihui
Copy link
Copy Markdown
Member

nihui commented May 15, 2026

@codex review

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (9ee760d) to head (3614864).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6695      +/-   ##
==========================================
- Coverage   95.85%   95.46%   -0.39%     
==========================================
  Files         934      935       +1     
  Lines      312692   312277     -415     
==========================================
- Hits       299720   298122    -1598     
- Misses      12972    14155    +1183     

☔ 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 a RISC-V (RVV 1.0) implementation of the Requantize layer (third installment in the int8 optimization series), along with helper SIMD routines and updated tests for the new backend.

Changes:

  • Adds Requantize_riscv (header + cpp) implementing vectorized requantize + bias + activation + int8 conversion using RVV intrinsics, plus a scalar fallback.
  • Adds RVV helpers float2int8relu and float2int8leakyrelu (m4/m8 variants) to riscv_usability.h.
  • In tests/test_requantize.cpp, adds a new test_requantize helper (no forced pack8) and routes test_requantize_3 through it on __riscv builds instead of test_requantize_pack8.

Reviewed changes

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

File Description
src/layer/riscv/requantize_riscv.h Declares Requantize_riscv derived from base Requantize.
src/layer/riscv/requantize_riscv.cpp Vectorized requantize implementation with separate ReLU/LeakyReLU fast path and generic activation path; dim 1/2/3 forward.
src/layer/riscv/riscv_usability.h New float2int8relu and float2int8leakyrelu RVV helpers used by the new layer.
tests/test_requantize.cpp Adds a non-pack-forcing helper used in test_requantize_3 for __riscv to replace the pack8 cases.

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

Comment thread tests/test_requantize.cpp Outdated
Comment thread src/layer/riscv/requantize_riscv.cpp Outdated
Comment thread src/layer/riscv/riscv_usability.h Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e865d60338

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/layer/riscv/requantize_riscv.cpp
Comment thread src/layer/riscv/requantize_riscv.cpp Outdated
@nihui nihui merged commit b9c6e63 into Tencent:master May 18, 2026
94 of 97 checks passed
@nihui
Copy link
Copy Markdown
Member

nihui commented May 18, 2026

Thanks for your contribution !

@Deepdive543443 Deepdive543443 deleted the requantize-riscv/PR branch May 18, 2026 14:51
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.

5 participants