Skip to content

Conversation

@alitariq4589
Copy link
Contributor

This PR adds tests supported for RISC-V

Tests which are added for execution with RISC-V

debian-cpu-cmake-rv64-native
debian-trixie-cmake-sanitizer-riscv64-native * 3
debian-trixie-llguidance-riscv64-native
debian-trixie-cmake-rpc-riscv64-native
ggml-ci-riscv64-native-cpu-low-perf

Dependencies which are not yet supported for RISC-V:

rocblas-dev
hipblas-dev
vulkan-sdk
mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64
intel-oneapi-compiler-dpcpp-cpp
intel-oneapi-mkl-devel
cuda
macOS*
windows*
torch

Tests which are not added for RISC-V due to above unmet dependencies:

macOS-latest-cmake-arm64
macOS-latest-cmake-x64
macOS-latest-cmake-arm64-webgpu
ubuntu-24-cmake-vulkan
ubuntu-22-cmake-webgpu
ubuntu-22-cmake-hip
ubuntu-22-cmake-musa
ubuntu-22-cmake-sycl
ubuntu-22-cmake-sycl-fp16
macOS-latest-cmake-ios
macOS-latest-cmake-tvos
macOS-latest-cmake-visionos
macOS-latest-swift
windows-msys2
windows-latest-cmake
ubuntu-latest-cmake-cuda
windows-2022-cmake-cuda
windows-latest-cmake-sycl
windows-latest-cmake-hip
ios-xcode-build
android-build
openEuler-latest-cmake-cann
ggml-ci-x64-nvidia-cuda
ggml-ci-x64-nvidia-vulkan-cm
ggml-ci-x64-nvidia-vulkan-cm2
ggml-ci-x64-cpu-amx
ggml-ci-mac-metal
ggml-ci-mac-vulkan
ggml-ci-arm64-cpu-high-perf-sve
ggml-ci-riscv64-native-cpu-high-perf

Additional Notes

Note 1

Due to a warning (treated as error) related to RISC-V simd mappings

In file included from ../../../ggml/src/ggml-cpu/arch/riscv/quants.c:6:
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp16_to_fp32':
../../../ggml/src/ggml-cpu/simd-mappings.h:101:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  101 |         _Float16 hf;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp32_to_fp16':
../../../ggml/src/ggml-cpu/simd-mappings.h:108:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h:108:24: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |                        ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:261: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/arch/riscv/quants.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../../ggml/src/ggml-cpu/quants.c:5:
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp16_to_fp32':
../../../ggml/src/ggml-cpu/simd-mappings.h:101:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  101 |         _Float16 hf;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp32_to_fp16':
../../../ggml/src/ggml-cpu/simd-mappings.h:108:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h:108:24: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |                        ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:135: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/quants.c.o] Error 1
In file included from ../../../ggml/src/ggml-cpu/common.h:7,
                 from ../../../ggml/src/ggml-cpu/unary-ops.h:3,
                 from ../../../ggml/src/ggml-cpu/ggml-cpu.c:12:
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp16_to_fp32':
../../../ggml/src/ggml-cpu/simd-mappings.h:101:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  101 |         _Float16 hf;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h: In function 'riscv_compute_fp32_to_fp16':
../../../ggml/src/ggml-cpu/simd-mappings.h:108:9: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |         ^~~~~~~~
../../../ggml/src/ggml-cpu/simd-mappings.h:108:24: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
  108 |         _Float16 hf = (_Float16)f;
      |                        ^~~~~~~~
../../../ggml/src/ggml-cpu/ggml-cpu.c: In function 'ggml_cpu_fp32_to_fp16':
../../../ggml/src/ggml-cpu/ggml-cpu.c:3239:32: error: ISO C does not support the '_Float16' type before C23 [-Werror=pedantic]
 3239 |         __riscv_vse16_v_f16m1((_Float16 *)&y[i], vy, vl);
      |                                ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:79: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.c.o] Error 1
../../../ggml/src/ggml-cpu/vec.cpp: In function 'void ggml_vec_dot_f32(int, float*, size_t, const float*, size_t, const float*, size_t, int)':
../../../ggml/src/ggml-cpu/vec.cpp:93:41: error: 'vsum' may be used uninitialized [-Werror=maybe-uninitialized]
   93 |         vsum = __riscv_vfmv_v_f_f32m8_tu(vsum, 0.0f, vl);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
../../../ggml/src/ggml-cpu/vec.cpp:90:22: note: 'vsum' was declared here
   90 |         vfloat32m8_t vsum;
      |                      ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [ggml/src/CMakeFiles/ggml-cpu.dir/build.make:219: ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/vec.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2199: ggml/src/CMakeFiles/ggml-cpu.dir/all] Error 2

-DLLAMA_FATAL_WARNINGS=ON has to be turned off for all the tests otherwise CI fails

(This can be created a separated issue. I can track the contributor and ping him if you want)

Note 2

One RISC-V board may not be optimal for running all these tests so by the end of RISC-V summit North America, we are expecting more boards to arrive (around mid of November). So this PR can be treated as draft for reviews till then.

@github-actions github-actions bot added the devops improvements to build systems and github actions label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops improvements to build systems and github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant