Skip to content

Commit 301e135

Browse files
committed
update main
2 parents c47511b + d1327ae commit 301e135

85 files changed

Lines changed: 7666 additions & 381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/configs/hygon.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
platform: hygon
1919

2020
# Docker image for this hardware.
21-
ci_image: harbor.sourcefind.cn:5443/dcu/admin/base/custom:vllm0.20.0-ubuntu22.04-dtk26.04-py3.10-MiniCPM-V-4.6
21+
ci_image: harbor.baai.ac.cn/flagos-dev/vllm-plugin-fl:vllm-plugin-fl-hygon-vllm0.20.2-dtk26.04-py3.10-ci
2222

2323
# Runner labels for this hardware.
2424
runner_labels:
@@ -27,6 +27,7 @@ runner_labels:
2727
# Container volumes (hardware-specific paths).
2828
container_volumes:
2929
- /opt/hyhal:/opt/hyhal
30+
- /usr/local/hyhal:/usr/local/hyhal
3031
- /data:/data
3132
- /workspace:/workspace
3233

@@ -42,7 +43,7 @@ container_options: >-
4243
--env HIP_CLANG_PATH=/opt/dtk/llvm/bin
4344
--env DEVICE_LIB_PATH=/opt/dtk/amdgcn/bitcode
4445
--env PATH=/opt/dtk/bin:/opt/dtk/hip/bin:/opt/dtk/llvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
45-
--env LD_LIBRARY_PATH=/opt/hyhal/lib/criu:/opt/hyhal/lib/rocprofiler:/opt/hyhal/lib:/opt/dtk/hip/lib:/opt/dtk/lib:/opt/dtk/llvm/lib:/opt/dtk/dcc/lib:/opt/dtk/aillvm/lib:/opt/dtk/hsa/lib
46+
--env LD_LIBRARY_PATH=/opt/hyhal/lib/criu:/opt/hyhal/lib/rocprofiler:/opt/hyhal/lib:/usr/local/hyhal/lib:/opt/dtk/hip/lib:/opt/dtk/lib:/opt/dtk/llvm/lib:/opt/dtk/dcc/lib:/opt/dtk/aillvm/lib:/opt/dtk/hsa/lib
4647
--device=/dev/kfd
4748
--device=/dev/mkfd
4849
--device=/dev/dri

.github/configs/metax.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2026 FlagOS Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# MetaX Hardware Configuration
16+
# This file defines CI/CD settings for MetaX C550 testing
17+
18+
platform: metax
19+
20+
# Docker image for this hardware.
21+
ci_image: harbor.baai.ac.cn/flagos-dev/vllm-plugin-fl:v0.20.2-metax-ci
22+
23+
# Runner labels for this hardware.
24+
# Keep this aligned with the MetaX C550 runner label.
25+
runner_labels:
26+
- metax-c550-124
27+
28+
# Container volumes (hardware-specific paths).
29+
container_volumes:
30+
- /data:/data
31+
32+
# Container options (hardware-specific settings).
33+
container_options: >-
34+
--hostname vllm-plugin-fl
35+
--ipc=host
36+
--shm-size=64g
37+
--device /dev/dri:/dev/dri:rwm
38+
--device /dev/mxcd:/dev/mxcd:rwm
39+
--env GEMS_VENDOR=metax
40+
--env VLLM_PLUGINS=fl
41+
--env MACA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7

.github/configs/platforms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ platforms:
2626
enabled: false
2727
hygon:
2828
enabled: true
29+
metax:
30+
enabled: true

.github/scripts/hygon/setup.sh

Lines changed: 84 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,97 +5,104 @@ set -euo pipefail
55

66
git config --global --add safe.directory "$(pwd)"
77

8-
export GEMS_VENDOR="${GEMS_VENDOR:-hygon}"
9-
export DTK_HOME="${DTK_HOME:-/opt/dtk}"
10-
export ROCM_PATH="${ROCM_PATH:-${DTK_HOME}}"
11-
export HIP_PATH="${HIP_PATH:-${DTK_HOME}/hip}"
12-
export HSA_PATH="${HSA_PATH:-${DTK_HOME}/hsa}"
13-
export HIP_CLANG_PATH="${HIP_CLANG_PATH:-${DTK_HOME}/llvm/bin}"
14-
export DEVICE_LIB_PATH="${DEVICE_LIB_PATH:-${DTK_HOME}/amdgcn/bitcode}"
15-
16-
DTK_PATH="${DTK_HOME}/bin:${HIP_PATH}/bin:${HIP_CLANG_PATH}"
17-
DTK_LIBRARY_PATH="/opt/hyhal/lib/criu:/opt/hyhal/lib/rocprofiler:/opt/hyhal/lib:${HIP_PATH}/lib:${DTK_HOME}/lib:${DTK_HOME}/llvm/lib:${DTK_HOME}/dcc/lib:${DTK_HOME}/aillvm/lib:${HSA_PATH}/lib"
18-
export PATH="${DTK_PATH}:${PATH}"
19-
export LD_LIBRARY_PATH="${DTK_LIBRARY_PATH}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
20-
21-
if [[ -n "${GITHUB_ENV:-}" ]]; then
22-
for name in \
23-
GEMS_VENDOR \
24-
DTK_HOME \
25-
ROCM_PATH \
26-
HIP_PATH \
27-
HSA_PATH \
28-
HIP_CLANG_PATH \
29-
DEVICE_LIB_PATH \
30-
PATH \
31-
LD_LIBRARY_PATH; do
32-
echo "${name}=${!name}" >> "${GITHUB_ENV}"
33-
done
34-
fi
8+
: "${GEMS_VENDOR:?GEMS_VENDOR is not set}"
9+
: "${VLLM_PLUGINS:?VLLM_PLUGINS is not set}"
10+
: "${DTK_HOME:?DTK_HOME is not set}"
11+
: "${ROCM_PATH:?ROCM_PATH is not set}"
12+
: "${HIP_PATH:?HIP_PATH is not set}"
13+
: "${HSA_PATH:?HSA_PATH is not set}"
14+
: "${HIP_CLANG_PATH:?HIP_CLANG_PATH is not set}"
15+
: "${DEVICE_LIB_PATH:?DEVICE_LIB_PATH is not set}"
16+
: "${LD_LIBRARY_PATH:?LD_LIBRARY_PATH is not set}"
3517

36-
echo "DTK_HOME=${DTK_HOME}"
37-
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
38-
test -e "${HIP_PATH}/lib/libgalaxyhip.so.5"
39-
test -e "${DTK_HOME}/llvm/lib/libomp.so"
18+
USE_IMAGE_PLUGIN="${HYGON_USE_IMAGE_PLUGIN:-1}"
4019

41-
TEST_DEPS=(
42-
pytest
43-
pytest-cov
44-
pytest-timeout
45-
pytest-json-report
46-
scikit-build-core==0.11
47-
pybind11
48-
ninja
49-
cmake
50-
numpy
51-
requests
52-
openai
53-
decorator
54-
pyyaml
55-
sqlalchemy
56-
)
57-
58-
FLAGGEMS_REF="8d23621eb1381ae96b315a9287ce3cc555433824"
59-
FLAGGEMS_SOURCE="${FLAGGEMS_PATH:-/workspace/FlagGems}"
60-
61-
if command -v uv >/dev/null 2>&1; then
62-
uv pip install --system --upgrade pip
63-
uv pip install --system --no-build-isolation -e . --no-deps
64-
uv pip install --system "${TEST_DEPS[@]}"
65-
else
66-
python -m pip install --upgrade pip
67-
python -m pip install --no-build-isolation -e . --no-deps
68-
python -m pip install "${TEST_DEPS[@]}"
69-
fi
20+
if [[ "${USE_IMAGE_PLUGIN}" == "1" ]]; then
21+
IMAGE_PLUGIN_ROOT="${VLLM_FL_IMAGE_PLUGIN_ROOT:-/opt/vllm-src/vllm-plugin-FL}"
22+
test -d "${IMAGE_PLUGIN_ROOT}/vllm_fl"
7023

71-
test -d "${FLAGGEMS_SOURCE}/src/flag_gems"
72-
git config --global --add safe.directory "${FLAGGEMS_SOURCE}"
24+
# The Hygon CI image already contains the validated plugin commit. Keep the
25+
# checkout available for tests and configs, but load vllm_fl from the image.
26+
HYGON_SITE_DIR="${RUNNER_TEMP:-/tmp}/hygon-python-site"
27+
mkdir -p "${HYGON_SITE_DIR}"
28+
cat > "${HYGON_SITE_DIR}/sitecustomize.py" <<'PY'
29+
import importlib.abc
30+
import importlib.util
31+
import os
32+
import sys
33+
from pathlib import Path
7334
74-
FLAGGEMS_HEAD="$(git -C "${FLAGGEMS_SOURCE}" rev-parse HEAD)"
75-
if [[ "${FLAGGEMS_HEAD}" != "${FLAGGEMS_REF}" ]]; then
76-
echo "Unexpected FlagGems commit: ${FLAGGEMS_HEAD}; expected ${FLAGGEMS_REF}."
77-
exit 1
78-
fi
7935
80-
if ! grep -q 'kwargs.pop("num_ldmatrixes", None)' \
81-
"${FLAGGEMS_SOURCE}/src/flag_gems/runtime/configloader.py"; then
82-
echo "FlagGems num_ldmatrixes compatibility patch is missing."
83-
exit 1
84-
fi
36+
class _ImageVllmFLFinder(importlib.abc.MetaPathFinder):
37+
def __init__(self, root):
38+
self.package_dir = Path(root) / "vllm_fl"
39+
40+
def find_spec(self, fullname, path=None, target=None):
41+
if fullname != "vllm_fl":
42+
return None
43+
init_file = self.package_dir / "__init__.py"
44+
if not init_file.exists():
45+
return None
46+
return importlib.util.spec_from_file_location(
47+
fullname,
48+
init_file,
49+
submodule_search_locations=[str(self.package_dir)],
50+
)
51+
8552
86-
FLAGGEMS_DIR="$(mktemp -d)/FlagGems"
87-
cp -a "${FLAGGEMS_SOURCE}" "${FLAGGEMS_DIR}"
53+
_root = os.environ.get("VLLM_FL_IMAGE_PLUGIN_ROOT")
54+
if _root:
55+
sys.meta_path.insert(0, _ImageVllmFLFinder(_root))
56+
PY
57+
58+
export VLLM_FL_IMAGE_PLUGIN_ROOT="${IMAGE_PLUGIN_ROOT}"
59+
export PYTHONPATH="${HYGON_SITE_DIR}${PYTHONPATH:+:${PYTHONPATH}}"
8860

89-
if command -v uv >/dev/null 2>&1; then
90-
uv pip install --system --no-build-isolation -e "${FLAGGEMS_DIR}" --no-deps
61+
if [[ -n "${GITHUB_ENV:-}" ]]; then
62+
{
63+
echo "VLLM_FL_IMAGE_PLUGIN_ROOT=${VLLM_FL_IMAGE_PLUGIN_ROOT}"
64+
echo "PYTHONPATH=${PYTHONPATH}"
65+
} >> "${GITHUB_ENV}"
66+
fi
9167
else
92-
python -m pip install --no-build-isolation -e "${FLAGGEMS_DIR}" --no-deps
68+
unset VLLM_FL_IMAGE_PLUGIN_ROOT
9369
fi
9470

71+
export HYGON_USE_IMAGE_PLUGIN="${USE_IMAGE_PLUGIN}"
72+
73+
echo "DTK_HOME=${DTK_HOME}"
74+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
75+
echo "HYGON_USE_IMAGE_PLUGIN=${HYGON_USE_IMAGE_PLUGIN}"
76+
if [[ "${USE_IMAGE_PLUGIN}" == "1" ]]; then
77+
echo "VLLM_FL_IMAGE_PLUGIN_ROOT=${VLLM_FL_IMAGE_PLUGIN_ROOT}"
78+
echo "PYTHONPATH=${PYTHONPATH}"
79+
fi
80+
test -e "${HIP_PATH}/lib/libgalaxyhip.so.5"
81+
test -e "${DTK_HOME}/llvm/lib/libomp.so"
82+
9583
python - <<'PY'
84+
import os
85+
from pathlib import Path
86+
9687
import flag_gems
9788
import torch
89+
import vllm
90+
import vllm_fl
91+
92+
if os.environ.get("HYGON_USE_IMAGE_PLUGIN", "1") == "1":
93+
image_plugin_root = Path(os.environ["VLLM_FL_IMAGE_PLUGIN_ROOT"]).resolve()
94+
expected_package = image_plugin_root / "vllm_fl"
95+
plugin_file = Path(vllm_fl.__file__).resolve()
96+
if (
97+
plugin_file != expected_package / "__init__.py"
98+
and expected_package not in plugin_file.parents
99+
):
100+
raise RuntimeError(
101+
f"Unexpected vllm_fl path: {plugin_file}; expected under {expected_package}"
102+
)
98103
104+
print(f"vLLM import ok: {vllm.__version__}")
105+
print(f"vLLM-FL import ok: {vllm_fl.__file__}")
99106
print(f"FlagGems import ok: {getattr(flag_gems, '__version__', 'unknown')}")
100107
print(f"Torch import ok: {torch.__version__}")
101108
print(f"Accelerator available: {torch.cuda.is_available()}")

.github/scripts/metax/check.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# Copyright (c) 2025 BAAI. All rights reserved.
3+
# Check MetaX C550 availability.
4+
set -euo pipefail
5+
6+
echo "Current time: $(date '+%Y-%m-%d %H:%M:%S')"
7+
echo "=== Checking MetaX C550 availability ==="
8+
9+
MX_SMI_BIN=""
10+
if command -v mx-smi >/dev/null 2>&1; then
11+
MX_SMI_BIN="$(command -v mx-smi)"
12+
fi
13+
14+
if [[ -n "${MX_SMI_BIN}" ]]; then
15+
echo "Using mx-smi: ${MX_SMI_BIN}"
16+
"${MX_SMI_BIN}" || true
17+
else
18+
echo "::warning::mx-smi not found in PATH; skipping SMI output."
19+
fi
20+
21+
test -d /dev/dri
22+
test -e /dev/mxcd

.github/scripts/metax/setup.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
# Copyright (c) 2025 BAAI. All rights reserved.
3+
# Setup script for MetaX C550 CI environment.
4+
set -euo pipefail
5+
6+
export PATH="/opt/conda/bin:${PATH}"
7+
8+
: "${GEMS_VENDOR:?GEMS_VENDOR is not set}"
9+
: "${VLLM_PLUGINS:?VLLM_PLUGINS is not set}"
10+
: "${MACA_VISIBLE_DEVICES:?MACA_VISIBLE_DEVICES is not set}"
11+
12+
git config --global --add safe.directory "$(pwd)"
13+
14+
if [[ -n "${GITHUB_ENV:-}" ]]; then
15+
for name in \
16+
PATH \
17+
GEMS_VENDOR \
18+
VLLM_PLUGINS \
19+
MACA_VISIBLE_DEVICES; do
20+
echo "${name}=${!name}" >> "${GITHUB_ENV}"
21+
done
22+
fi
23+
24+
# vLLM, FlagGems, and test dependencies are provided by the CI image.
25+
# Only install the checked-out plugin source for this workflow run.
26+
python -m pip install --no-build-isolation --no-deps -e .
27+
28+
python - <<'PY'
29+
import flag_gems
30+
import torch
31+
import vllm
32+
import vllm_fl
33+
34+
print(f"vLLM import ok: {vllm.__version__}")
35+
print(f"vLLM-FL import ok: {vllm_fl.__file__}")
36+
print(f"FlagGems import ok: {getattr(flag_gems, '__version__', 'unknown')}")
37+
print(f"Torch import ok: {torch.__version__}")
38+
print(f"Accelerator available: {torch.cuda.is_available()}")
39+
print(f"Accelerator count: {torch.cuda.device_count()}")
40+
PY

.github/workflows/_benchmark_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
- name: Upload test results
9191
if: always()
9292
uses: actions/upload-artifact@v4
93+
continue-on-error: true
9394
with:
9495
name: benchmark-${{ inputs.platform }}
9596
path: |

.github/workflows/_build_wheel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ jobs:
7777
- name: Upload wheel
7878
if: inputs.upload-artifact
7979
uses: actions/upload-artifact@v4
80+
continue-on-error: true
8081
with:
8182
name: wheel
8283
path: dist/*.whl

.github/workflows/_e2e_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
- name: Upload test results
109109
if: always()
110110
uses: actions/upload-artifact@v4
111+
continue-on-error: true
111112
with:
112113
name: e2e-${{ inputs.platform }}-${{ inputs.device }}-${{ inputs.task }}
113114
path: |

.github/workflows/_functional_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
- name: Upload test results
9191
if: always()
9292
uses: actions/upload-artifact@v4
93+
continue-on-error: true
9394
with:
9495
name: functional-${{ inputs.platform }}
9596
path: |

0 commit comments

Comments
 (0)