Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/configs/ascend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
platform: ascend

# Docker image for this hardware
ci_image: harbor.baai.ac.cn/flagscale/vllm-plugin-fl:v0.2.0-ascend-ci
ci_image: harbor.baai.ac.cn/flagscale/vllm-plugin-fl:ascend-vllm0.20.2-a3-ci

# Runner labels for this hardware
runner_labels:
- self-hosted
- Linux
- ARM64
- ascend
- npu-16
- flagcicd-910c

# Container volumes (hardware-specific paths)
container_volumes:
Expand All @@ -44,6 +40,8 @@ container_options: >-
--hostname vllm-plugin-fl
--ipc=host
--privileged
--env ASCEND_RT_VISIBLE_DEVICES=14,15
--env VLLM_EXECUTE_MODEL_TIMEOUT_SECONDS=1800
--device /dev/davinci0
--device /dev/davinci1
--device /dev/davinci2
Expand Down
4 changes: 3 additions & 1 deletion .github/configs/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ platforms:
cuda:
enabled: true
ascend:
enabled: false
# Ascend uses a scarce self-hosted NPU runner; keep it enabled when
# validating Ascend changes in PR CI.
enabled: true
hygon:
enabled: true
metax:
Expand Down
38 changes: 36 additions & 2 deletions .github/scripts/ascend/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@
# Copyright (c) 2025 BAAI. All rights reserved.
# Check Huawei Ascend NPU availability.
set -euo pipefail

echo "=== Checking Ascend NPU availability ==="
# TODO: Replace with actual Ascend device check command.
npu-smi info || echo "WARNING: npu-smi not found. Ascend device check skipped."

if ! command -v npu-smi >/dev/null 2>&1; then
echo "::error::npu-smi is required but was not found in PATH."
exit 1
fi

if [[ -z "${ASCEND_RT_VISIBLE_DEVICES:-}" ]]; then
echo "::error::ASCEND_RT_VISIBLE_DEVICES is not set."
exit 1
fi

required_devices=(
"/dev/davinci_manager"
"/dev/devmm_svm"
"/dev/hisi_hdc"
)

IFS=',' read -r -a visible_devices <<< "${ASCEND_RT_VISIBLE_DEVICES}"
for device_id in "${visible_devices[@]}"; do
device_id="${device_id//[[:space:]]/}"
if [[ -z "${device_id}" ]]; then
continue
fi
required_devices+=("/dev/davinci${device_id}")
done

for device_path in "${required_devices[@]}"; do
if [[ ! -e "${device_path}" ]]; then
echo "::error::Missing Ascend device path: ${device_path}"
exit 1
fi
done

npu-smi info
echo "Ascend device check passed."
69 changes: 69 additions & 0 deletions .github/scripts/ascend/download_models.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash
# Copyright 2026 FlagOS Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Provision models on the host-mounted /data volume. Images must not contain
# model weights; every platform test refers to the same host path convention.
set -euo pipefail

export FL_MODEL_BASE_PATH="${FL_MODEL_BASE_PATH:-/data/models}"
export HF_ENDPOINT="${HF_ENDPOINT:-https://hf-mirror.com}"

QWEN_ROOT="${FL_MODEL_BASE_PATH}/Qwen"
HF_MODEL_ID="Qwen/Qwen3-0.6B"
MODELSCOPE_MODEL_IDS=(
"Qwen/Qwen3.6-27B"
"Qwen/Qwen3.6-35B-A3B"
)

mkdir -p "${QWEN_ROOT}"

MODEL_DIR="${QWEN_ROOT}/${HF_MODEL_ID#Qwen/}"
if [[ -f "${MODEL_DIR}/config.json" ]]; then
echo "Model already available: ${MODEL_DIR}"
else
export MODEL_ID="${HF_MODEL_ID}" MODEL_DIR
echo "Downloading ${MODEL_ID} from ${HF_ENDPOINT} to ${MODEL_DIR}"
python - <<'PY'
import os

from huggingface_hub import snapshot_download


snapshot_download(
repo_id=os.environ["MODEL_ID"],
local_dir=os.environ["MODEL_DIR"],
endpoint=os.environ["HF_ENDPOINT"],
)
PY
test -f "${MODEL_DIR}/config.json"
echo "Model ready: ${MODEL_DIR}"
fi

if ! command -v modelscope >/dev/null 2>&1; then
pip install modelscope --break-system-packages
fi

for MODEL_ID in "${MODELSCOPE_MODEL_IDS[@]}"; do
MODEL_DIR="${QWEN_ROOT}/${MODEL_ID#Qwen/}"
if [[ -f "${MODEL_DIR}/config.json" ]]; then
echo "Model already available: ${MODEL_DIR}"
continue
fi

echo "Downloading ${MODEL_ID} from ModelScope to ${MODEL_DIR}"
modelscope download --model "${MODEL_ID}" --local_dir "${MODEL_DIR}"
test -f "${MODEL_DIR}/config.json"
echo "Model ready: ${MODEL_DIR}"
done
17 changes: 16 additions & 1 deletion .github/scripts/ascend/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ set -euo pipefail
git config --global --add safe.directory "$(pwd)"

pip install --upgrade pip "setuptools>=77.0.3"
pip install --no-build-isolation -e ".[test]"
pip install \
--constraint requirements/ascend.txt \
--no-build-isolation \
--no-deps \
-e .

python - <<'PY'
import numpy

expected = "1.26.4"
if numpy.__version__ != expected:
raise RuntimeError(
f"Unexpected NumPy version: {numpy.__version__}; expected {expected}"
)
print(f"NumPy version: {numpy.__version__}")
PY
7 changes: 7 additions & 0 deletions .github/workflows/_e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ jobs:
- name: Check device availability
run: bash .github/scripts/${{ inputs.platform }}/check.sh

- name: Prepare host models
run: |
model_script=".github/scripts/${{ inputs.platform }}/download_models.sh"
if [ -f "${model_script}" ]; then
bash "${model_script}"
fi

- name: Install project
run: bash .github/scripts/${{ inputs.platform }}/setup.sh

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/ascend-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2026 FlagOS Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Ascend runners are scarce shared resources. Validate the image and selected
# cases directly on the host first, then dispatch this workflow when a recorded
# full CI result is needed.
name: Ascend Manual CI

on:
workflow_dispatch:
pull_request:
types: [labeled]

concurrency:
group: ascend-manual-${{ github.ref }}
cancel-in-progress: false

jobs:
test-ascend:
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.label.name == 'run-ascend-ci'
uses: ./.github/workflows/_platform_test.yml
with:
platform: ascend
secrets: inherit
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ All arguments are passed directly to `vllm bench throughput`.
Example:
```bash
python benchmarks/benchmark_throughput_autotune.py \
--model /models/Qwen3-Next-80B-A3B-Instruct \
--model /data/models/Qwen/Qwen3-Next-80B-A3B-Instruct \
--tensor-parallel-size 4 \
--dataset-name random \
--input-len 6144 \
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_throughput_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def main() -> None:
"No throughput arguments provided. "
"Pass them after the script args, e.g.: "
'python benchmark_gems_autotune.py --ops "silu_and_mul" -- '
"--model /models/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 ..."
"--model /data/models/Qwen/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 ..."
)

if args.background and not os.environ.get("FLAGGEMS_AUTOTUNE_BACKGROUND"):
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmark_throughput_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Usage:
# 1. Start the server as follows (adjust model path and args as needed):
# vllm serve /models/Qwen3.6-27B --tensor-parallel-size 2 --max-model-len 262144 --no-enable-log-requests --no-enable-prefix-caching
# vllm serve /data/models/Qwen/Qwen3.6-27B --tensor-parallel-size 2 --max-model-len 262144 --no-enable-log-requests --no-enable-prefix-caching

# 2. Run this benchmark script (default: 4 test cases):
# python benchmarks/benchmark_throughput_serve.py
Expand All @@ -35,7 +35,7 @@
from datetime import datetime
from statistics import mean

MODEL = "/models/Qwen3.6-27B"
MODEL = "/data/models/Qwen/Qwen3.6-27B"

# total runs for each case
RUNS = 4
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/flagos_eval/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
set -e

# Arguments
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_benchmark.sh /workspace/Qwen3-4B/"}
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_benchmark.sh /data/models/Qwen/Qwen3-4B/"}

# Output directory
OUTPUT_DIR=bench_results
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/flagos_eval/run_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
set -e

# Arguments
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_eval.sh /workspace/Qwen3-4B/ hf_xxx"}
HF_TOKEN=${2:?"Please provide HF_TOKEN, e.g.: ./run_eval.sh /workspace/Qwen3-4B/ hf_xxx"}
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_eval.sh /data/models/Qwen/Qwen3-4B/ hf_xxx"}
HF_TOKEN=${2:?"Please provide HF_TOKEN, e.g.: ./run_eval.sh /data/models/Qwen/Qwen3-4B/ hf_xxx"}

# Environment variables
export HF_ENDPOINT=https://hf-mirror.com # China mirror (can be removed for overseas)
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/flagos_eval/run_mixed_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ set -e
# seed: Random seed for shuffle (default: 42)
#
# Example:
# ./run_mixed_benchmark.sh /workspace/Qwen3-4B/
# ./run_mixed_benchmark.sh /workspace/Qwen3-4B/ 123
# ./run_mixed_benchmark.sh /data/models/Qwen/Qwen3-4B/
# ./run_mixed_benchmark.sh /data/models/Qwen/Qwen3-4B/ 123
# ============================================================================

# Arguments
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_mixed_benchmark.sh /workspace/Qwen3-4B/"}
MODEL_PATH=${1:?"Please provide model path, e.g.: ./run_mixed_benchmark.sh /data/models/Qwen/Qwen3-4B/"}
SEED=${2:-42}

# Output directory
Expand Down
Loading
Loading