[CI] Quick fix mooncake for nightly-ci (#4028)

### What this PR does / why we need it?
Since we have upgraded to CANN 8.3rc1, we will no longer use the
privately maintained Mooncake repository, but instead use the official
release released by Mooncake:
https://github.com/kvcache-ai/Mooncake/releases/tag/v0.3.7.post2 .

Next step: this is only a temporary solution. We will integrate mooncake
into the vllm-ascend base image later for easier use. see
https://github.com/vllm-project/vllm-ascend/pull/3989
### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

- vLLM version: v0.11.0
- vLLM main:
83f478bb19

---------

Signed-off-by: wangli <wangli858794774@gmail.com>
This commit is contained in:
Li Wang
2025-11-06 18:46:00 +08:00
committed by GitHub
parent 34b278a339
commit 259eb25f88
3 changed files with 29 additions and 94 deletions

View File

@@ -57,23 +57,14 @@ for i in {0..15}; do hccn_tool -i $i -ping -g address x.x.x.x;done
Mooncake is the serving platform for Kimi, a leading LLM service provided by Moonshot AI. First, we need to obtain the Mooncake project. Refer to the following command:
```shell
git clone https://github.com/kvcache-ai/Mooncake.git
git clone -b v0.3.7.post2 --depth 1 https://github.com/kvcache-ai/Mooncake.git
```
Update and install Python
```shell
apt-get update
apt-get install python3
```
Modify Mooncake compilation option
(Optional) Replace go install url if the network is poor
```shell
cd Mooncake
vi mooncake-common/common.cmake
# find this row and set USE_ASCEND_DIRECT ON.
option(USE_ASCEND_DIRECT "option for using ascend npu with adxl engine" ON)
sed -i 's|https://go.dev/dl/|https://golang.google.cn/dl/|g' dependencies.sh
```
Install mpi
@@ -93,7 +84,7 @@ Compile and install
```shell
mkdir build
cd build
cmake ..
cmake .. -USE_ASCEND_DIRECT=ON
make -j
make install
```

View File

@@ -9,15 +9,13 @@ YELLOW="\033[0;33m"
RED="\033[0;31m"
NC="\033[0m" # No Color
branch=${1:-pooling_async_memecpy_v1}
point=${2:-8fce1ffab3930fec2a8b8d3be282564dfa1bb186}
branch=${1:-v0.3.7.post2}
repo_url="https://github.com/AscendTransport/Mooncake"
repo_url="https://github.com/kvcache-ai/Mooncake"
repo_name="Mooncake"
state_file=".build_state"
echo "[INFO] Branch: $branch"
echo "[INFO] Commit: $point"
echo "-------------------------------------------"
@@ -29,22 +27,36 @@ if ! is_done "clone"; then
if [ -d "$repo_name" ]; then
echo "[WARN] Directory $repo_name already exists, skipping clone."
else
git clone -b "$branch" "$repo_url" "$repo_name"
git clone --branch "$branch" --depth 1 "$repo_url" "$repo_name"
fi
cd "$repo_name"
git fetch --all
git checkout "$point" || { echo "[ERROR] Checkout failed."; exit 1; }
cd ..
mark_done "clone"
else
echo "[SKIP] Clone step already done."
fi
init_ascend_env() {
cann_in_sys_path=/usr/local/Ascend/ascend-toolkit; \
cann_in_user_path=$HOME/Ascend/ascend-toolkit; \
uname_m=$(uname -m) && \
if [ -f "${cann_in_sys_path}/set_env.sh" ]; then \
source ${cann_in_sys_path}/set_env.sh; \
export LD_LIBRARY_PATH=${cann_in_sys_path}/latest/lib64:${cann_in_sys_path}/latest/${uname_m}-linux/devlib:${LD_LIBRARY_PATH} ; \
elif [ -f "${cann_in_user_path}/set_env.sh" ]; then \
source "$HOME/Ascend/ascend-toolkit/set_env.sh"; \
export LD_LIBRARY_PATH=${cann_in_user_path}/latest/lib64:${cann_in_user_path}/latest/${uname_m}-linux/devlib:${LD_LIBRARY_PATH}; \
else \
echo "No Ascend Toolkit found"; \
exit 1; \
fi
}
init_ascend_env
if ! is_done "deps"; then
cd "$repo_name"
echo "[STEP]Installing dependencies (ignore Go failure)..."
yes | bash dependencies.sh || echo "⚠️ dependencies.sh failed (Go install likely failed), continuing..."
echo "[STEP]Installing dependencies..."
sed -i 's|https://go.dev/dl/|https://golang.google.cn/dl/|g' dependencies.sh
bash dependencies.sh -y
cd ..
mark_done "deps"
else
@@ -74,7 +86,7 @@ if ! is_done "build"; then
fi
mkdir build && cd build
cmake .. || { echo "[ERROR] cmake failed."; exit 1; }
cmake .. -USE_ASCEND_DIRECT=ON || { echo "[ERROR] cmake failed."; exit 1; }
make -j || { echo "[ERROR] make failed."; exit 1; }
make install || { echo "[ERROR] make install failed."; exit 1; }
mark_done "build"
@@ -83,19 +95,6 @@ else
fi
if ! is_done "copy_lib"; then
echo "[STEP] Copy library files..."
cp mooncake-transfer-engine/src/transport/ascend_transport/hccl_transport/ascend_transport_c/libascend_transport_mem.so \
/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/
cp mooncake-transfer-engine/src/libtransfer_engine.so \
/usr/local/Ascend/ascend-toolkit/latest/python/site-packages/
cd ..
mark_done "copy_lib"
else
echo "[SKIP] Library copy already done."
fi
if ! grep -q "export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages:$LD_LIBRARY_PATH" ~/.bashrc; then
echo -e "${YELLOW}Adding LD_LIBRARY_PATH to your PATH in ~/.bashrc${NC}"
echo 'export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/python/site-packages:$LD_LIBRARY_PATH' >> ~/.bashrc

View File

@@ -9,7 +9,6 @@ RED="\033[0;31m"
NC="\033[0m" # No Color
# Configuration
GOVER=1.23.8
LOG_DIR="/root/.cache/tests/logs"
OVERWRITE_LOGS=true
SRC_DIR="$WORKSPACE/source_code"
@@ -97,34 +96,6 @@ install_vllm() {
pip install -r "$SRC_DIR/vllm-ascend/requirements-dev.txt"
}
download_go() {
ARCH=$(uname -m)
GOVER=1.23.8
if [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
elif [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
# Download Go
echo "Downloading Go $GOVER..."
wget -q --show-progress https://golang.google.cn/dl/go$GOVER.linux-$ARCH.tar.gz
check_success "Failed to download Go $GOVER"
# Install Go
echo "Installing Go $GOVER..."
tar -C /usr/local -xzf go$GOVER.linux-$ARCH.tar.gz
check_success "Failed to install Go $GOVER"
# Clean up downloaded file
rm -f go$GOVER.linux-$ARCH.tar.gz
check_success "Failed to clean up Go installation file"
print_success "Go $GOVER installed successfully"
}
install_ais_bench() {
local AIS_BENCH="$SRC_DIR/vllm-ascend/benchmark"
git clone https://gitee.com/aisbench/benchmark.git $AIS_BENCH
@@ -136,29 +107,6 @@ install_ais_bench() {
cd -
}
install_go() {
# Check if Go is already installed
if command -v go &> /dev/null; then
GO_VERSION=$(go version | awk '{print $3}')
if [[ "$GO_VERSION" == "go$GOVER" ]]; then
echo -e "${YELLOW}Go $GOVER is already installed. Skipping...${NC}"
else
echo -e "${YELLOW}Found Go $GO_VERSION. Will install Go $GOVER...${NC}"
download_go
fi
else
download_go
fi
# Add Go to PATH if not already there
if ! grep -q "export PATH=\$PATH:/usr/local/go/bin" ~/.bashrc; then
echo -e "${YELLOW}Adding Go to your PATH in ~/.bashrc${NC}"
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
echo -e "${YELLOW}Please run 'source ~/.bashrc' or start a new terminal to use Go${NC}"
fi
export PATH=$PATH:/usr/local/go/bin
}
kill_npu_processes() {
pgrep python3 | xargs -r kill -9
pgrep VLLM | xargs -r kill -9
@@ -193,11 +141,8 @@ main() {
install_sys_dependencies
install_vllm
install_ais_bench
# to speed up mooncake build process, install Go here
install_go
cd "$WORKSPACE/source_code"
. $SRC_DIR/vllm-ascend/tests/e2e/nightly/multi_node/scripts/build_mooncake.sh \
"pooling_async_memecpy_v1" "8fce1ffab3930fec2a8b8d3be282564dfa1bb186"
. $SRC_DIR/vllm-ascend/tests/e2e/nightly/multi_node/scripts/build_mooncake.sh
cd "$WORKSPACE/source_code/vllm-ascend"
run_tests_with_log
}