Skip to content

Commit 4b5ab52

Browse files
Merge remote-tracking branch 'origin/main' into elastic
2 parents dd33ead + 5f91b8e commit 4b5ab52

443 files changed

Lines changed: 15466 additions & 69674 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/workflows/all-tests-metax.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Set Environment Variable
2828
id: set-env # Assign an ID to this step
2929
run: |
30-
echo "ci_image=localhost:5000/flagscale:maca.ai2.33.0.13-torch2.6-py310-ubuntu22.04-amd64-time2508051515" >> $GITHUB_OUTPUT # Set output variable
30+
echo "ci_image=localhost:5000/flagscale:maca.ai3.0.0.5-torch2.6-py310-ubuntu22.04-amd64-time2508201730" >> $GITHUB_OUTPUT # Set output variable
3131
3232
functional-tests-inference:
3333
needs:
@@ -38,7 +38,7 @@ jobs:
3838
task:
3939
- deepseek_r1_distill_qwen-metax
4040
# TODO: Need update for flaggems@v3.0
41-
- deepseek_r1_distill_qwen-flaggems-metax
41+
# - deepseek_r1_distill_qwen-flaggems-metax # TODO: test need fix
4242
- opi_llama3_1_instruct-metax
4343
- opi_llama3_1_instruct-flaggems-metax
4444
- qwen3-metax

.github/workflows/all-tests-nvidia.yml

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,26 @@ name: All Tests Nvidia
33
on:
44
push:
55
branches: ["main"]
6+
paths-ignore:
7+
- 'hardware/BI_V150/**'
8+
- 'hardware/Cambricon_MLU/**'
9+
- 'hardware/Huawei_Atlas800TA3/**'
10+
- 'hardware/Hygon_BW1000/**'
11+
- 'hardware/Kunlunxin_R310p/**'
12+
- 'hardware/MUSA_S5000/**'
13+
- 'hardware/Metax_C550/**'
14+
- 'hardware/Tsing_micro/**'
615
pull_request:
716
branches: ["main"]
17+
paths-ignore:
18+
- 'hardware/BI_V150/**'
19+
- 'hardware/Cambricon_MLU/**'
20+
- 'hardware/Huawei_Atlas800TA3/**'
21+
- 'hardware/Hygon_BW1000/**'
22+
- 'hardware/Kunlunxin_R310p/**'
23+
- 'hardware/MUSA_S5000/**'
24+
- 'hardware/Metax_C550/**'
25+
- 'hardware/Tsing_micro/**'
826

927
concurrency:
1028
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.actor }}
@@ -21,8 +39,8 @@ jobs:
2139
run: |
2240
echo "ci_image=localhost:5000/flagscale:cuda12.8.1-cudnn9.7.1-python3.12-torch2.7.0-time2507111538" >> $GITHUB_OUTPUT # Set output variable
2341
24-
# Megatron Unit Tests with Matrix
25-
megatron-unit-tests:
42+
# Train Megatron Unit Tests with Matrix
43+
unit_tests_train_megatron:
2644
needs:
2745
- set-env
2846
uses: ./.github/workflows/unit-tests-nvidia.yml
@@ -43,34 +61,51 @@ jobs:
4361
- transformer/moe
4462
- transformer
4563
- ./
46-
name: "megatron-${{ matrix.subset == './' && 'root' || matrix.subset }}"
64+
name: "train_megatron-${{ matrix.subset == './' && 'root' || matrix.subset }}"
4765
with:
48-
backend: megatron
66+
backend: train_megatron
4967
subset: ${{ matrix.subset }}
5068
image: ${{ needs.set-env.outputs.ci_image }}
5169

52-
# Flagscale Unit Tests with Matrix
53-
flagscale-unit-tests:
70+
# Train Flagscale Unit Tests with Matrix
71+
unit_tests_train_flagscale:
5472
needs:
5573
- set-env
56-
- megatron-unit-tests
74+
- unit_tests_train_megatron
5775
uses: ./.github/workflows/unit-tests-nvidia.yml
5876
strategy:
5977
matrix:
6078
subset:
6179
- runner
6280
- ./
63-
name: "flagscale-${{ matrix.subset == './' && 'root' || matrix.subset }}"
81+
name: "train_flagscale-${{ matrix.subset == './' && 'root' || matrix.subset }}"
6482
with:
65-
backend: flagscale
83+
backend: train_flagscale
84+
subset: ${{ matrix.subset }}
85+
image: ${{ needs.set-env.outputs.ci_image }}
86+
87+
# Inference Flagscale Unit Tests with Matrix
88+
unit_tests_inference_flagscale:
89+
needs:
90+
- set-env
91+
- unit_tests_train_flagscale
92+
uses: ./.github/workflows/unit-tests-nvidia.yml
93+
strategy:
94+
matrix:
95+
subset:
96+
- inference
97+
- transforms
98+
name: "inference_flagscale-${{ matrix.subset == './' && 'root' || matrix.subset }}"
99+
with:
100+
backend: inference_flagscale
66101
subset: ${{ matrix.subset }}
67102
image: ${{ needs.set-env.outputs.ci_image }}
68103

69104
# Functional Tests with Mision and Type Matrix
70-
functional-tests-train:
105+
functional_tests_train:
71106
needs:
72107
- set-env
73-
- flagscale-unit-tests
108+
- unit_tests_inference_flagscale
74109
uses: ./.github/workflows/functional-tests-nvidia.yml
75110
strategy:
76111
matrix:
@@ -85,10 +120,10 @@ jobs:
85120
type: train
86121
image: ${{ needs.set-env.outputs.ci_image }}
87122

88-
functional-tests-hetero:
123+
functional_tests_hetero:
89124
needs:
90125
- set-env
91-
- functional-tests-train
126+
- functional_tests_train
92127
# TODO: test need fix
93128
uses: ./.github/workflows/functional-tests-nvidia.yml
94129
strategy:
@@ -101,10 +136,10 @@ jobs:
101136
type: hetero_train
102137
image: ${{ needs.set-env.outputs.ci_image }}
103138

104-
functional-tests-inference:
139+
functional_tests_inference:
105140
needs:
106141
- set-env
107-
- functional-tests-hetero
142+
- functional_tests_hetero
108143
uses: ./.github/workflows/functional-tests-nvidia.yml
109144
strategy:
110145
matrix:
@@ -119,10 +154,10 @@ jobs:
119154
type: inference
120155
image: ${{ needs.set-env.outputs.ci_image }}
121156

122-
functional-tests-serve:
157+
functional_tests_serve:
123158
needs:
124159
- set-env
125-
- functional-tests-inference
160+
- functional_tests_inference
126161
uses: ./.github/workflows/functional-tests-nvidia.yml
127162
strategy:
128163
matrix:
@@ -135,10 +170,10 @@ jobs:
135170
type: serve
136171
image: ${{ needs.set-env.outputs.ci_image }}
137172

138-
functional-tests-rl:
173+
functional_tests_rl:
139174
needs:
140175
- set-env
141-
- functional-tests-serve
176+
- functional_tests_serve
142177
uses: ./.github/workflows/functional-tests-nvidia.yml
143178
strategy:
144179
matrix:
@@ -153,13 +188,14 @@ jobs:
153188
# Check All Tests
154189
all-tests:
155190
needs:
156-
- megatron-unit-tests
157-
- flagscale-unit-tests
158-
- functional-tests-train
159-
- functional-tests-hetero
160-
- functional-tests-inference
161-
- functional-tests-serve
162-
- functional-tests-rl
191+
- unit_tests_train_megatron
192+
- unit_tests_train_flagscale
193+
- unit_tests_inference_flagscale
194+
- functional_tests_train
195+
- functional_tests_hetero
196+
- functional_tests_inference
197+
- functional_tests_serve
198+
- functional_tests_rl
163199
runs-on: ubuntu-latest
164200
steps:
165201
- name: All Tests Completed

.github/workflows/functional-tests-metax.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
export CXXFLAGS="-I/opt/maca/include -I/opt/maca/include/mcr -I/opt/maca/include/common -I/opt/maca/include/mcsparse -I/opt/maca/include/mcsolver"
8484
python setup.py bdist_wheel
8585
pip uninstall vllm -y
86-
pip install dist/vllm-0.8.5+maca2.33.0.12torch2.6-cp310-cp310-linux_x86_64.whl
86+
pip install dist/vllm-*-linux_x86_64.whl
8787
source /opt/conda/bin/activate base
8888
else
8989
echo "Unknown backend type: ${{ inputs.type }}"

.github/workflows/functional-tests-nvidia.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ jobs:
4949
pip install gitpython # TODO: Remove after updating the image
5050
5151
git config --global --add safe.directory /__w/FlagScale/FlagScale
52+
53+
TMP_DIR=$(mktemp -d)
54+
echo "Copying source to temporary directory: $TMP_DIR"
55+
cp -r /__w/FlagScale/FlagScale/. $TMP_DIR
56+
cd $TMP_DIR
57+
trap 'echo "Cleaning up temporary directory..."; rm -rf "$TMP_DIR"' EXIT
58+
5259
if [ "${{ inputs.type }}" = "train" ] || [ "${{ inputs.type }}" = "hetero_train" ]; then
5360
PYTHONPATH=./:$PYTHONPATH pip install . --no-build-isolation --verbose --config-settings=device="gpu" --config-settings=backend="Megatron-LM"
5461
if [ "${{ inputs.task }}" = "llava_onevision" ]; then
@@ -99,4 +106,5 @@ jobs:
99106
tests/scripts/functional_tests/test_task.sh --type ${{ inputs.type }} --task ${{ inputs.task }}
100107
exit_code=$?
101108
echo "Exit code: $exit_code"
109+
exit $exit_cod
102110
shell: bash

.github/workflows/unit-tests-nvidia.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,17 @@ jobs:
5353
pip install gitpython # TODO: Remove after updating the image
5454
5555
git config --global --add safe.directory /__w/FlagScale/FlagScale
56-
if [ "${{ inputs.backend }}" = "megatron" ] || [ "${{ inputs.backend }}" = "flagscale" ]; then
56+
57+
TMP_DIR=$(mktemp -d)
58+
echo "Copying source to temporary directory: $TMP_DIR"
59+
cp -r /__w/FlagScale/FlagScale/. $TMP_DIR
60+
cd $TMP_DIR
61+
trap 'echo "Cleaning up temporary directory..."; rm -rf "$TMP_DIR"' EXIT
62+
63+
if [ "${{ inputs.backend }}" = "train_megatron" ] || [ "${{ inputs.backend }}" = "train_flagscale" ]; then
5764
echo ""
5865
# PYTHONPATH=./:$PYTHONPATH pip install . --config-settings=backend="Megatron-LM" --verbose --no-build-isolation
59-
elif [ "${{ inputs.backend }}" = "vllm" ]; then
66+
elif [ "${{ inputs.backend }}" = "vllm" ] || [ "${{ inputs.backend }}" = "inference_flagscale" ]; then
6067
source /root/miniconda3/bin/activate flagscale-inference
6168
pip install scikit-build scikit-build-core
6269
pip install --no-build-isolation git+https://github.com/FlagOpen/FlagGems.git@release_v1.0.0

docker/Dockerfile.metax

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
FROM cr.metax-tech.com/public-ai-release/maca/modelzoo.llm.vllm:maca.ai2.33.0.13-torch2.6-py310-ubuntu22.04-amd64
1+
ARG MACA_VERSION=ai3.0.0.5
2+
ARG TORCH_VERSION=2.6
3+
ARG PYTHON_VERSION=310
4+
FROM cr.metax-tech.com/public-ai-release/maca/modelzoo.llm.vllm:maca.${MACA_VERSION}-torch${TORCH_VERSION}-py${PYTHON_VERSION}-ubuntu22.04-amd64
25

36
##############################################################################
47
# Temporary Installation Directory
@@ -21,9 +24,11 @@ RUN /opt/conda/bin/pip3 install cryptography gitpython cmake
2124
# used to generate cmakecache files
2225
# install tooklit Only, IGNORE driver or samples
2326
##############################################################################
24-
RUN wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda_11.6.0_510.39.01_linux.run && \
25-
sh cuda_11.6.0_510.39.01_linux.run --silent --toolkit && \
26-
rm cuda_11.6.0_510.39.01_linux.run
27+
ARG CUDA_VERSION=11.6.0
28+
ARG TOOLKIT_VERSION=11.6.0_510.39.01
29+
RUN wget https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers/cuda_${TOOLKIT_VERSION}_linux.run && \
30+
sh cuda_${TOOLKIT_VERSION}_linux.run --silent --toolkit && \
31+
rm cuda_${TOOLKIT_VERSION}_linux.run
2732

2833
##############################################################################
2934
# Clone FlagScale

examples/aquila/conf/train_hetero.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,34 @@ experiment:
1212
runner:
1313
hostfile: torchrun # Please replace with your actual hostfile path
1414
rdzv_backend: "static" # hetero training only supports static
15-
envs:
16-
CUDA_VISIBLE_DEVICES: 0,1,2,3,4,5,6,7
17-
CUDA_DEVICE_MAX_CONNECTIONS: 1
1815
cmds:
1916
before_start: "ulimit -n 1048576"
2017
after_stop: ""
2118

19+
envs:
20+
CUDA_VISIBLE_DEVICES: 0,1,2,3,4,5,6,7
21+
CUDA_DEVICE_MAX_CONNECTIONS: 1
22+
23+
# specific envs
24+
# the priority: node ip > device type > the global envs
25+
# device_type_specific:
26+
# mlu590:
27+
# MLU_VISIBLE_DEVICES: 0,1,2,3,4,5,6,7
28+
# CNCL_IB_RELAXED_ORDERING_ENABLE: 1
29+
# CNCL_MLULINK_OVER_ROCE_DISABLE: 1
30+
# A800:
31+
# CUDA_DEVICE_MAX_CONNECTIONS: 1
32+
# node_specific:
33+
# xxx.xxx.xx.xxx:
34+
# CUDA_VISIBLE_DEVICES: 0,1,2,3
35+
36+
# the other specific config for different device type or node
37+
# device_type_specific:
38+
# mlu590:
39+
# build_dir: xxxx/build/Cambricon_MLU/FlagScale/
40+
# node_specific:
41+
# xxxxx.xxx.xx.xxx:
42+
# build_dir: xxxx/xxxx/build/Cambricon_MLU/FlagScale/
2243
action: run
2344

2445
hydra:

examples/cloud/conf/serve.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ experiment:
99
type: serve
1010
runner:
1111
type: cloud
12-
hostfile: ${oc.env:HOSTFILE, /etc/hostfile}
13-
master_addr: ${oc.env:MASTER_ADDR, 127.0.0.1}
14-
master_port: 7396
12+
nnodes: ${oc.env:LWS_GROUP_SIZE, 1}
13+
master_addr: ${oc.env:LWS_LEADER_ADDRESS, 127.0.0.1}
14+
master_port: ${oc.env:MASTER_PORT, 7396}
1515
device_type: ${oc.env:DEVICE_TYPE, gpu}
1616
nproc_per_node: ${oc.env:AIRS_ACCELERATOR_NUM, 1}
1717
deploy:

examples/cloud/conf/serve/cloud_model.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- serve_id: vllm_model
22
engine: vllm
33
engine_args:
4-
model: null
4+
model: /models/Qwen2.5-0.5B-Instruct
55
port: 8000
66
host: 0.0.0.0
77
served_model_name: cloud
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
defaults:
2+
- _self_
3+
- inference: t2i
4+
5+
experiment:
6+
exp_name: openjourney
7+
exp_dir: outputs/${experiment.exp_name}
8+
model: prompthero/openjourney
9+
task:
10+
type: inference
11+
backend: vllm # TODO(yupu): Remove this restriction
12+
entrypoint: flagscale/inference/diffusion_entrypoint.py
13+
runner:
14+
hostfile: null
15+
cmds:
16+
before_start: source /root/miniconda3/bin/activate flagscale-inference
17+
envs:
18+
CUDA_VISIBLE_DEVICES: 0
19+
CUDA_DEVICE_MAX_CONNECTIONS: 1
20+
# Optionally, set HF_HOME and HF_ENDPOINT
21+
22+
action: run
23+
24+
hydra:
25+
run:
26+
dir: ${experiment.exp_dir}/hydra

0 commit comments

Comments
 (0)