ci: add riscv64 to release binaries#20991
Conversation
Nevertheless, can you provide a link to successful release on your fork? |
We already have a RISC-V runner from Cloud-V, should be able to use that? |
|
Relevant info: #16682 (comment) |
|
Good to know the Cloud-V runners are back up. That simplifies things since they are already configured on ggml-org. 👍 One question: what GCC version do the Cloud-V RISCV64 runners have? The release build needs GCC 14+ because GCC 13 cannot parse the full ISA string from /proc/cpuinfo and rejects _Float16 in pedantic mode (at least on the rise runner). I hit both issues when testing on RISE runners (which run GCC 13.3.0 on Ubuntu 24.04). If the Cloud-V runners have GCC 14, the release build should work with the same flags as x64/s390x. If not, we would need to either disable GGML_NATIVE and LLAMA_FATAL_WARNINGS, or install GCC 14 as a setup step. I will update the PR to use runs-on: RISCV64 once I know the GCC version. |
|
|
As requested by @/CISC, any chance you had a successful run in your fork? Can you share a link? |
|
The release workflow only triggers on tags and workflow_dispatch, not on PRs, so CI did not run on this PR. I cannot trigger it on my fork either because the workflow needs the RISCV64 Cloud-V runners which are only configured on ggml-org. I am building locally on native riscv64 hardware (BananaPi F3, GCC 14.2.0, rv64gc+RVV) and will share the results shortly. The existing CI (build-riscv.yml) also validates riscv64 builds on Cloud-V runners, so the release build should work with the same infrastructure. Would a maintainer be able to trigger a manual workflow_dispatch run to validate the release matrix change? |
|
Native riscv64 build succeeded on a BananaPi F3 (SpacemiT K1, GCC 14.2.0, rv64gc+RVV):
The Cloud-V RISCV64 runners also have GCC 14.2.0, so the release build should work with the same toolchain. |
|
Rebased from upstream master and switched the approach: the original version used RISE Project The practical reason: we measured build times on both. Native riscv64 (RISE runner) takes ~49 minutes for the build step. Cross-compiling with The only dependency added is |
Cross-compile riscv64 binaries from ubuntu-24.04 using gcc-14-riscv64-linux-gnu. Builds with GGML_CPU_ALL_VARIANTS=ON for runtime ISA detection (RVV etc.) and LLAMA_OPENSSL=OFF to avoid multiarch dependency setup. Adds release download link for Ubuntu riscv64 (CPU). Signed-off-by: Bruno Verachten <gounthar@gmail.com>
70776e3 to
8e7d7b4
Compare
CISC
left a comment
There was a problem hiding this comment.
Please provide a link to a successful release on your fork (disable s390x to allow it to complete).
| -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH | ||
| -DLLAMA_OPENSSL=OFF |
There was a problem hiding this comment.
Either make it link against the right libssl, or build with boringssl, we don't want a release without.
| -DGGML_NATIVE=OFF \ | ||
| -DGGML_CPU_ALL_VARIANTS=ON \ | ||
| -DLLAMA_FATAL_WARNINGS=ON \ | ||
| ${{ matrix.cmake_cross || '' }} \ |
There was a problem hiding this comment.
| ${{ matrix.cmake_cross || '' }} \ | |
| ${{ matrix.cmake_cross }} \ |
Doesn't it already evaluate to an empty string if not defined?
Overview
Add riscv64 to the Ubuntu CPU release matrix using cross-compilation from a standard
ubuntu-24.04runner withgcc-14-riscv64-linux-gnu.Changes:
riscv64/ubuntu-24.04matrix entry with cross-compile flagsgcc-14-riscv64-linux-gnu)matrix.cmake_crossinto the cmake configure stepriscv64line to release notes templateCloses #20988
Why cross-compilation rather than a native riscv64 runner?
We benchmarked both approaches on the same codebase. On RISE Project
ubuntu-24.04-riscvrunners, a full Release build takes roughly 49 minutes (build step alone). Cross-compiling fromubuntu-24.04x86_64 with agcc-14RISC-V cross-compiler takes roughly 5 minutes total — about a 10x difference. Using a standard GitHub-hosted runner also avoids any dependency on runner availability or a third-party GitHub App installation.What the binary supports
GGML_CPU_ALL_VARIANTS=ON— multiple ISA code paths compiled in; runtime detection selects the best available (RVV, ZVFH, etc.)LLAMA_OPENSSL=OFF— avoids thelibssl-dev:riscv64multiarch setup needed for cross-compilation; the binary is fully functional without itLLAMA_FATAL_WARNINGS=ON— kept consistent with other ubuntu-cpu builds;gcc-14cross-compiler handles_Float16without warnings on riscv64Additional information
Requirements