mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-06-27 20:05:20 +00:00
ci: [MUSA] add CI and update doc (#12562)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
39
ci/README.md
39
ci/README.md
@ -26,4 +26,43 @@ GG_BUILD_CUDA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
|||||||
# with SYCL support
|
# with SYCL support
|
||||||
source /opt/intel/oneapi/setvars.sh
|
source /opt/intel/oneapi/setvars.sh
|
||||||
GG_BUILD_SYCL=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
GG_BUILD_SYCL=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
||||||
|
|
||||||
|
# with MUSA support
|
||||||
|
GG_BUILD_MUSA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running MUSA CI in a Docker Container
|
||||||
|
|
||||||
|
Assuming `$PWD` is the root of the `llama.cpp` repository, follow these steps to set up and run MUSA CI in a Docker container:
|
||||||
|
|
||||||
|
### 1. Create a local directory to store cached models, configuration files and venv:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p $HOME/llama.cpp/ci-cache
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Create a local directory to store CI run results:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p $HOME/llama.cpp/ci-results
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Start a Docker container and run the CI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --privileged -it \
|
||||||
|
-v $HOME/llama.cpp/ci-cache:/ci-cache \
|
||||||
|
-v $HOME/llama.cpp/ci-results:/ci-results \
|
||||||
|
-v $PWD:/ws -w /ws \
|
||||||
|
mthreads/musa:rc3.1.1-devel-ubuntu22.04
|
||||||
|
```
|
||||||
|
|
||||||
|
Inside the container, execute the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt update -y && apt install -y cmake git python3.10-venv wget
|
||||||
|
git config --global --add safe.directory /ws
|
||||||
|
GG_BUILD_MUSA=1 bash ./ci/run.sh /ci-results /ci-cache
|
||||||
|
```
|
||||||
|
|
||||||
|
This setup ensures that the CI runs within an isolated Docker environment while maintaining cached files and results across runs.
|
||||||
|
11
ci/run.sh
11
ci/run.sh
@ -16,6 +16,9 @@
|
|||||||
# # with VULKAN support
|
# # with VULKAN support
|
||||||
# GG_BUILD_VULKAN=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
# GG_BUILD_VULKAN=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
||||||
#
|
#
|
||||||
|
# # with MUSA support
|
||||||
|
# GG_BUILD_MUSA=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
|
||||||
|
#
|
||||||
|
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
echo "usage: $0 <output-dir> <mnt-dir>"
|
echo "usage: $0 <output-dir> <mnt-dir>"
|
||||||
@ -62,6 +65,12 @@ fi
|
|||||||
if [ ! -z ${GG_BUILD_VULKAN} ]; then
|
if [ ! -z ${GG_BUILD_VULKAN} ]; then
|
||||||
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_VULKAN=1"
|
CMAKE_EXTRA="${CMAKE_EXTRA} -DGGML_VULKAN=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z ${GG_BUILD_MUSA} ]; then
|
||||||
|
# Use qy1 by default (MTT S80)
|
||||||
|
MUSA_ARCH=${MUSA_ARCH:-21}
|
||||||
|
CMAKE_EXTRA="-DGGML_MUSA=ON -DMUSA_ARCHITECTURES=${MUSA_ARCH}"
|
||||||
|
fi
|
||||||
## helpers
|
## helpers
|
||||||
|
|
||||||
# download a file if it does not exist or if it is outdated
|
# download a file if it does not exist or if it is outdated
|
||||||
@ -811,7 +820,7 @@ export LLAMA_LOG_PREFIX=1
|
|||||||
export LLAMA_LOG_TIMESTAMPS=1
|
export LLAMA_LOG_TIMESTAMPS=1
|
||||||
|
|
||||||
if [ -z ${GG_BUILD_LOW_PERF} ]; then
|
if [ -z ${GG_BUILD_LOW_PERF} ]; then
|
||||||
# Create symlink: ./llama.cpp/models-mnt -> $MNT/models/models-mnt
|
# Create symlink: ./llama.cpp/models-mnt -> $MNT/models
|
||||||
rm -rf ${SRC}/models-mnt
|
rm -rf ${SRC}/models-mnt
|
||||||
mnt_models=${MNT}/models
|
mnt_models=${MNT}/models
|
||||||
mkdir -p ${mnt_models}
|
mkdir -p ${mnt_models}
|
||||||
|
Reference in New Issue
Block a user