Skip to content

Gate RVV code on the target extension - #31607

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
catap:riscv64
Nov 4, 2026
Merged

ggerganov merged 1 commit into
ggml-org:masterfrom
catap:riscv64

Conversation

@catap

@catap catap commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

The RISC-V vector intrinsic specification requires __riscv_v_intrinsic to be defined when the compiler supports the API, even when the vector extension is not selected. Clang therefore defines it for rv64gc, causing ggml to enter RVV branches where vector types are rejected because the required ISA extensions are absent.

Use __riscv_v for optional RVV implementations; this macro represents the selected target ISA. Retain __riscv_v_intrinsic checks in SpaceMIT sources, where they validate mandatory compiler API support rather than select optional vector code.

Additional information

Closes: ggml-org/ggml#1535
Moved: ggml-org/ggml#1571

Requirements

The RISC-V vector intrinsic specification requires __riscv_v_intrinsic
to be defined when the compiler supports the API, even when the vector
extension is not selected. Clang therefore defines it for rv64gc,
causing ggml to enter RVV branches where vector types are rejected
because the required ISA extensions are absent.

Use __riscv_v for optional RVV implementations; this macro represents
the selected target ISA. Retain __riscv_v_intrinsic checks in SpaceMIT
sources, where they validate mandatory compiler API support rather than
select optional vector code.

Closes: ggml-org/ggml#1535
@catap
catap requested a review from ggerganov as a code owner November 3, 2026 14:05
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Nov 3, 2026
@ggerganov
ggerganov merged commit feaf800 into ggml-org:master Nov 4, 2026
41 of 42 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Nov 6, 2026
The RISC-V vector intrinsic specification requires __riscv_v_intrinsic
to be defined when the compiler supports the API, even when the vector
extension is not selected. Clang therefore defines it for rv64gc,
causing ggml to enter RVV branches where vector types are rejected
because the required ISA extensions are absent.

Use __riscv_v for optional RVV implementations; this macro represents
the selected target ISA. Retain __riscv_v_intrinsic checks in SpaceMIT
sources, where they validate mandatory compiler API support rather than
select optional vector code.

Closes: ggml-org/ggml#1535
(cherry picked from commit feaf800)
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.

ggml-0.14.0 build fails on OpenBSD/riscv64

2 participants