Skip to content

Improve speed of convertSequences() and get1BlockSummary() using RVV #4399

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

Merged
merged 1 commit into from
Jun 8, 2025

Conversation

zijianli1234
Copy link
Contributor

This PR improves the speed of convertSequences() and get1BlockSummary() when compiled with RVV support on RISCV and pass test on qemu with vlen=128,256,512. Modeled after PR #4232 , this change brings similar functionality to the RISC-V architecture.

For illustration, here are some benchmark numbers, on a Spacemit(R) X60 @1.6 Ghz, using enwik5 (100KB) and the sequences produced by level 5.

dataset compiler convertSequences (1st block) on dev convertSequences (1st block) with RVV enabled get1BlockSummary (1st block) on dev get1BlockSummary (1st block) with RVV enabled
enwik5, level 5 gcc v14.2 1328.0 MB/s 2149.9 MB/s 1715.6 MB/s 2783.6 MB/s

This vector code can reduce the overhead of translating the Sequence public format into the internal one to optimize perference on RISCV.

@facebook-github-bot
Copy link

Hi @zijianli1234!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@Cyan4973 Cyan4973 self-assigned this Jun 2, 2025
@Cyan4973
Copy link
Contributor

Cyan4973 commented Jun 2, 2025

It looks great @zijianli1234 !
It's clean and sufficiently documented.

Please note that the CLA signing process is compulsory to merge your contribution,
we'll have to wait for this step to complete in order to move forward.

@zijianli1234 zijianli1234 changed the title Improve speed of ZSTD_compressSequencesAndLiterals() using RVV Improve speed of convertSequences() and get1BlockSummary() using RVV Jun 3, 2025
@zijianli1234
Copy link
Contributor Author

zijianli1234 commented Jun 5, 2025

Hi, @Cyan4973 ,I have signed CLA, please move forward,thank you so much.

@Cyan4973 Cyan4973 merged commit e23d0a9 into facebook:dev Jun 8, 2025
101 checks passed
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