fix(ci): use GCC 14 riscv64 cross-compiler for RVV tuple/zvfhmin intrinsics (#5653)

Summary:
fix(ci): use GCC 14 riscv64 cross-compiler for RVV tuple/zvfhmin intrinsics

The linux-riscv64-DD CI job installs the default cross-compiler from
Ubuntu noble, which resolves to GCC 13.3. GCC 13's <riscv_vector.h>
does not export the RVV tuple types (vuint8m1x3_t) nor the zvfhmin
f16 intrinsics (vfloat16m1_t, __riscv_vle16_v_f16m1,
__riscv_vfwcvt_f_f_v_f32m2) used by the SQ RVV kernels, so building
sq-rvv.cpp failed with "'vuint8m1x3_t' was not declared in this
scope" (and similar) in the Codec6bit software-pipelined loops and
the QuantizerFP16 fast paths.

The intrinsics used are all legal under -march=rv64gcv_zvfhmin (only
vle16/vse16/vfwcvt/vfncvt on f16) and are fully supported starting
with GCC 14, so no source changes are needed.

Explicitly install gcc-14-riscv64-linux-gnu / g++-14-riscv64-linux-gnu
and point the toolchain file at the versioned binaries, avoiding any
reliance on update-alternatives defaults. A version self-check in the
workflow makes the resolved compiler visible in the CI log.

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5653

Reviewed By: alibeklfc

Differential Revision: D120734761

Pulled By: mnorris11

fbshipit-source-id: d82cf2c99dfd6e8720f31bdadb718806f9e71044
This commit is contained in:
anthony-zy
2026-09-21 16:23:17 -07:00
committed by meta-codesync[bot]
parent 98af2cf627
commit bf8be4a79b
2 changed files with 11 additions and 4 deletions
+7 -2
View File
@@ -391,12 +391,17 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y -qq \
cmake \
gcc-riscv64-linux-gnu \
g++-riscv64-linux-gnu \
gcc-14-riscv64-linux-gnu \
g++-14-riscv64-linux-gnu \
libopenblas-dev:riscv64 \
libgomp1:riscv64 \
qemu-user-static
# GCC 13's <riscv_vector.h> lacks the RVV tuple types (e.g.
# vuint8m1x3_t) and the zvfhmin f16 intrinsics the SQ kernels use;
# GCC 14 is required. Fail fast if the default still points at 13.
riscv64-linux-gnu-g++-14 --version
# Bridge Ubuntu's multiarch library directory into the sysroot so
# that CMake's find_library() (ONLY mode, root=/usr/riscv64-linux-gnu)
# can reach packages installed as :riscv64.
+4 -2
View File
@@ -19,8 +19,10 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR riscv64)
set(CMAKE_C_COMPILER riscv64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER riscv64-linux-gnu-g++)
# GCC 14+: the RVV SQ kernels rely on tuple types (vuint8m1x3_t) and
# zvfhmin f16 intrinsics that GCC 13's <riscv_vector.h> does not export.
set(CMAKE_C_COMPILER riscv64-linux-gnu-gcc-14)
set(CMAKE_CXX_COMPILER riscv64-linux-gnu-g++-14)
# Cross-compiler sysroot provided by gcc-riscv64-linux-gnu.
set(CMAKE_FIND_ROOT_PATH /usr/riscv64-linux-gnu)