Skip to content

feat: add foundational RISC-V and RVV support infrastructure - #311

Open
ihb2032 wants to merge 8 commits into
alibaba:mainfrom
ihb2032:feat/riscv-platform-init
Open

feat: add foundational RISC-V and RVV support infrastructure#311
ihb2032 wants to merge 8 commits into
alibaba:mainfrom
ihb2032:feat/riscv-platform-init

Conversation

@ihb2032

@ihb2032 ihb2032 commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

This PR introduces the fundamental infrastructure required to support the RISC-V 64-bit architecture and the RISC-V Vector Extension.

Adding this underlying scaffolding paves the way for significant performance optimizations. Preliminary downstream testing with RVV intrinsics has already demonstrated massive potential, including nearly 9x QPS improvements in int8 workloads without any drop in recall. This PR is the necessary first step to upstream those gains safely and cleanly.

Performance Context:

  • Hardware Platform: Muse Pi Pro (16GB RAM + 128GB Storage)
  • Dataset: Cohere 1M
  • Note: The specific algorithmic optimizations and detailed benchmark reports will be provided in subsequent PRs relying on this foundation.

What's Next?

This is part 1 of a planned series of PRs. Once this foundational PR is merged, follow-up PRs will introduce the actual algorithmic optimizations that utilize these new cpu_features APIs.

Testing Performed

  • Successfully compiled and linked natively in a RISC-V environment.
  • Verified basic runtime detection and execution stability on the Muse Pi Pro platform.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@ihb2032 ihb2032 removed their assignment Apr 3, 2026
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 3301f43 to 72b31fc Compare April 30, 2026 06:40
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 72b31fc to be471c0 Compare May 13, 2026 00:32
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch 8 times, most recently from c5e8cc9 to 8a3c5f5 Compare June 8, 2026 09:45
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 8a3c5f5 to 4c7cb3d Compare June 9, 2026 06:46
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 4c7cb3d to 08dc67a Compare June 11, 2026 09:53
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 4f4daba to 36a392b Compare June 24, 2026 14:17
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch 3 times, most recently from fb38a6c to a22b486 Compare July 7, 2026 23:50
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from a22b486 to 018112f Compare July 17, 2026 00:47
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
Signed-off-by: ihb2032 <hebome@foxmail.com>
@ihb2032
ihb2032 force-pushed the feat/riscv-platform-init branch from 018112f to eec6056 Compare August 17, 2026 05:48
ihb2032 and others added 2 commits August 27, 2026 14:37
Conflict resolution policy: keep upstream (main) for shared code,
retain this branch's changes only for RISC-V/RVV-related parts.

- src/ailego/CMakeLists.txt: keep upstream's restructured per-arch
  per-file march block (incl. MSVC ARM64 NEON comment); re-add the
  riscv64 *_rvv.cc glob with setup_compiler_march_for_riscv64_rvv().
- src/ailego/internal/cpu_features.cc: keep upstream's includes and
  simplified compiler guards; retain the riscv_hwprobe-based runtime
  detection (RISCV_VECTOR/RISCV_ZVFH) and the riscv CpuFlags ctor.
- src/include/zvec/ailego/internal/platform.h: keep upstream's
  AILEGO_ARM64/AILEGO_HAVE_NEON structure; retain riscv64 in AILEGO_M64,
  riscv_vector.h include, zihintpause ailego_yield, and the
  __riscv_vector tier in ailego_malloc.
- src/ailego/internal/cpu_features.h: drop stale conflict markers
  committed earlier; keep both NEON (upstream) and the new
  RISCV_VECTOR/RISCV_ZVFH static flags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants