Skip to content

fix(ggml): correct RISC-V ISA string canonical ordering for RVV in CMake#20888

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
ihb2032:fix/riscv-isa-canonical-order
Mar 26, 2026
Merged

fix(ggml): correct RISC-V ISA string canonical ordering for RVV in CMake#20888
ggerganov merged 1 commit intoggml-org:masterfrom
ihb2032:fix/riscv-isa-canonical-order

Conversation

@ihb2032
Copy link
Copy Markdown
Contributor

@ihb2032 ihb2032 commented Mar 23, 2026

Motivation

When configuring the CMake build for RISC-V with both standard vector extensions GGML_RVV and multi-letter extensions, the generated -march string violates the RISC-V ISA canonical ordering rules.

Currently, the single-letter v extension is appended after the multi-letter z extensions, e.g., resulting in rv64gc_zfh_v.... Modern, strict compilers reject this non-canonical ISA string and fail to build the CPU backend with:
error: unexpected ISA string at end: ‘v_zvfh_zicbop_zihintpause’

Testing

Verified successful compilation on RISC-V using GCC 14.2 with -DGGML_RVV=ON and -DGGML_RV_ZFH=ON.Make sure to read the contributing guidelines before submitting a PR

@ihb2032 ihb2032 requested a review from ggerganov as a code owner March 23, 2026 06:58
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Mar 23, 2026
Comment thread ggml/src/ggml-cpu/CMakeLists.txt Outdated
@ggerganov ggerganov requested review from a team and ggerganov March 23, 2026 07:58
@ihb2032 ihb2032 force-pushed the fix/riscv-isa-canonical-order branch from b5f11ad to 05d5810 Compare March 23, 2026 08:32
@ggerganov ggerganov merged commit dc8d14c into ggml-org:master Mar 26, 2026
45 of 48 checks passed
@ihb2032 ihb2032 deleted the fix/riscv-isa-canonical-order branch March 26, 2026 13:14
slartibardfast pushed a commit to slartibardfast/llama.cpp that referenced this pull request Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants