Skip to content

Added CI with RISC-V RVV1.0 Hardware #14439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
80 changes: 75 additions & 5 deletions .devops/cloud-v-pipeline
Original file line number Diff line number Diff line change
@@ -1,22 +1,92 @@
node('x86_runner1'){ // Running on x86 runner containing latest vector qemu, latest vector gcc and all the necessary libraries
node('jupiter-16G-1'){ // Running on x86 runner containing latest vector qemu, latest vector gcc and all the necessary libraries
stage('Cleanup'){
cleanWs() // Cleaning previous CI build in workspace
}
stage('Run system_info') {
sh '''#!/bin/bash
echo '============================================================='
echo ' CPU INFO START '
echo '============================================================='
cat /proc/cpuinfo
echo '============================================================='
echo ' CPU INFO END '
echo '============================================================='

echo '============================================================='
echo ' Kernel Info Start '
echo '============================================================='
uname -a
echo '============================================================='
echo ' Kernel Info End '
echo '============================================================='
echo '============================================================='
echo ' Glibc Version Start '
echo '============================================================='
ldd --version
echo '============================================================='
echo ' Glibc Version End '
echo '============================================================='
echo '============================================================='
echo ' OS Info Start '
echo '============================================================='
cat /etc/os-release
echo '============================================================='
echo ' OS Info End '
echo '============================================================='

echo '============================================================='
echo ' GCC Version '
echo '============================================================='
gcc --version
echo '============================================================='
echo ' GCC Version End '
echo '============================================================='
'''
}
stage('Install dependencies'){
sh'''
#!/bin/bash

set -x

sudo apt update
sudo apt install -y cmake build-essential git curl libcurl4-openssl-dev
'''
}
stage('checkout repo'){
retry(5){ // Retry if the cloning fails due to some reason
checkout scm // Clone the repo on Runner
}
}
stage('Compiling llama.cpp'){
sh'''#!/bin/bash
make RISCV=1 RISCV_CROSS_COMPILE=1 # Compiling llama for RISC-V

set -x

mkdir -p .compiler_override

# Create symlinks in this temp directory
ln -sf /usr/bin/gcc-14 .compiler_override/gcc
ln -sf /usr/bin/g++-14 .compiler_override/g++

export CC="/usr/bin/gcc-14"
export CXX="/usr/bin/g++-14"

# Prepend the temp directory to PATH for this script's execution
export PATH="$PWD/.compiler_override:$PATH"

gcc --version
g++ --version

cmake -B build
cmake --build build --config Release -j8 --target llama-cli llama-quantize
'''
}
stage('Running llama.cpp'){
sh'''#!/bin/bash
module load gnu-bin2/0.1 # loading latest versions of vector qemu and vector gcc
qemu-riscv64 -L /softwares/gnu-bin2/sysroot -cpu rv64,v=true,vlen=256,elen=64,vext_spec=v1.0 ./llama-cli -m /home/alitariq/codellama-7b.Q4_K_M.gguf -p "Anything" -n 9 > llama_log.txt # Running llama.cpp on vector qemu-riscv64
cat llama_log.txt # Printing results

set -x
./build/bin/llama-cli -m /home/jenkins_user/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf -p "Hi, how are you?" -n 10
'''
}
}