Skip to content

Commit 25c8ec3

Browse files
authored
Merge branch 'main' into PR-0528
2 parents c9c8709 + 30eafd0 commit 25c8ec3

29 files changed

Lines changed: 1237 additions & 1029 deletions

.github/configs/metax.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
# MetaX C500 Hardware Configuration
2-
# This file defines CI/CD settings for MetaX C500 GPU (MACA) testing
1+
# MetaX C550 Hardware Configuration
2+
# This file defines CI/CD settings for MetaX C550 GPU (MACA) testing
33
# Test configurations are defined in tests/test_utils/config/platforms/metax.yaml
44

55
hardware_name: metax
6-
display_name: 'MetaX C500 Tests'
6+
display_name: "MetaX C550 Tests"
77

8-
# Docker images for MetaX C500 (MACA-based)
8+
# Docker images for MetaX C550 (MACA-based)
99
ci_image: harbor.baai.ac.cn/flagscale/megatron-lm-with-te:202603231839
1010
ci_train_image: harbor.baai.ac.cn/flagscale/megatron-lm-with-te:202603231839
1111
ci_inference_image: harbor.baai.ac.cn/flagscale/megatron-lm-with-te:202603231839
1212

13-
# Directory to store image tar files (shared between build and test workflows)
14-
tar_dir: /mnt/airs-business/cicd/image_tar
15-
16-
# Runner labels for MetaX C500 hardware
17-
runner_labels: ['flagscale-metax-c550-gpu2-8c-256g']
13+
# Runner labels for MetaX C550 hardware
14+
runner_labels: ["flagscale-metax-c550-gpu2-8c-256g"]
1815

1916
# Container volumes (hardware-specific paths)
2017
container_volumes:
2118
- /mnt/airs-business/cicd/baai_datasets:/home/gitlab-runner/data
2219
- /mnt/airs-business/cicd/baai_tokenizers:/home/gitlab-runner/tokenizers
2320

24-
# Container options for MetaX C500 (MACA runtime)
21+
# Container options for MetaX C550 (MACA runtime)
2522
container_options: >-
2623
--hostname=flagscale-ci
2724
--ipc=host

.github/workflows/all_tests.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: all_tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths-ignore:
7+
- 'docs/**'
8+
- 'docker/cuda/**'
9+
- 'docker/build.sh'
10+
- 'tools/install/**'
11+
- 'requirements/**'
12+
- '.github/workflows/build_image_cuda.yml'
13+
- '.github/workflows/push_image_harbor.yml'
14+
pull_request:
15+
branches: ["main"]
16+
paths-ignore:
17+
- 'docs/**'
18+
- 'docker/cuda/**'
19+
- 'docker/build.sh'
20+
- 'tools/install/**'
21+
- 'requirements/**'
22+
- '.github/workflows/build_image_cuda.yml'
23+
- '.github/workflows/push_image_harbor.yml'
24+
workflow_dispatch:
25+
inputs:
26+
platform:
27+
description: Platform test suite to run
28+
required: true
29+
default: all
30+
type: choice
31+
options:
32+
- all
33+
- cuda
34+
- ascend
35+
- metax
36+
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.actor }}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
# ---------------------------------------------------------------------------
43+
# Guard: skip CUDA tests when PR contains docker-related changes, because
44+
# build_image_cuda.yml will handle build + test for those PRs.
45+
# paths-ignore alone cannot guarantee mutual exclusivity when a PR touches
46+
# both docker files and non-docker files, so we need this job-level check.
47+
# ---------------------------------------------------------------------------
48+
check_docker_changes:
49+
runs-on: ubuntu-latest
50+
if: github.event_name == 'pull_request'
51+
outputs:
52+
has_docker_changes: ${{ steps.check.outputs.has_docker_changes }}
53+
steps:
54+
- name: Check for docker-related file changes
55+
id: check
56+
env:
57+
GH_TOKEN: ${{ github.token }}
58+
run: |
59+
CHANGED=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --paginate --jq '.[].filename')
60+
if echo "$CHANGED" | grep -qE '^(docker/cuda/|docker/build\.sh$|tools/install/|requirements/|\.github/workflows/build_image_cuda\.yml$)'; then
61+
echo "has_docker_changes=true" >> $GITHUB_OUTPUT
62+
else
63+
echo "has_docker_changes=false" >> $GITHUB_OUTPUT
64+
fi
65+
66+
cuda_tests:
67+
name: CUDA tests
68+
needs: check_docker_changes
69+
if: >-
70+
(github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'cuda') &&
71+
(github.event_name == 'push' || github.event_name == 'workflow_dispatch' || needs.check_docker_changes.outputs.has_docker_changes != 'true')
72+
uses: ./.github/workflows/all_tests_common.yml
73+
with:
74+
platform: cuda
75+
76+
# Disable util the new devices ready
77+
# ascend_tests:
78+
# name: Ascend tests
79+
# if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'ascend'
80+
# uses: ./.github/workflows/all_tests_common.yml
81+
# with:
82+
# platform: ascend
83+
84+
metax_tests:
85+
name: MetaX tests
86+
if: github.event_name != 'workflow_dispatch' || inputs.platform == 'all' || inputs.platform == 'metax'
87+
uses: ./.github/workflows/all_tests_common.yml
88+
with:
89+
platform: metax
90+
91+
all_tests:
92+
name: all_tests
93+
needs:
94+
- check_docker_changes
95+
- cuda_tests
96+
# - ascend_tests
97+
- metax_tests
98+
runs-on: ubuntu-latest
99+
if: always()
100+
steps:
101+
- name: Verify workflow status
102+
run: |
103+
failed=false
104+
105+
# if [ "${{ needs.check_docker_changes.outputs.has_docker_changes }}" = "true" ]; then
106+
# echo "⏭️ CUDA tests skipped - docker changes detected, handled by build_image_cuda workflow"
107+
# elif [ "${{ needs.cuda_tests.result }}" != "success" ] && \
108+
# [ "${{ needs.cuda_tests.result }}" != "skipped" ]; then
109+
# echo "❌ CUDA tests failed"
110+
# failed=true
111+
# fi
112+
113+
# if [ "${{ needs.ascend_tests.result }}" != "success" ] && \
114+
# [ "${{ needs.ascend_tests.result }}" != "skipped" ]; then
115+
# echo "❌ Ascend tests failed"
116+
# failed=true
117+
# fi
118+
119+
if [ "${{ needs.metax_tests.result }}" != "success" ] && \
120+
[ "${{ needs.metax_tests.result }}" != "skipped" ]; then
121+
echo "❌ MetaX C550 tests failed"
122+
failed=true
123+
fi
124+
125+
if [ "$failed" = "true" ]; then
126+
exit 1
127+
fi
128+
129+
echo "✅ All requested platform tests passed!"

.github/workflows/all_tests_ascend.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/all_tests_common.yml

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ jobs:
5555
env_name_serve: ${{ steps.config.outputs.env_name_serve }}
5656
env_name_rl: ${{ steps.config.outputs.env_name_rl }}
5757
steps:
58-
- name: Checkout code
58+
- name: Checkout code (attempt 1)
59+
id: checkout_attempt_1
5960
uses: actions/checkout@v4
61+
continue-on-error: true
6062
with:
61-
repository: ${{ github.event.pull_request.head.repo.full_name }}
62-
ref: ${{ github.event.pull_request.head.ref }}
63+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
64+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
6365
ssh-strict: true
6466
ssh-user: git
6567
persist-credentials: false
@@ -71,28 +73,42 @@ jobs:
7173
submodules: false
7274
set-safe-directory: true
7375

74-
- name: Cache source code
75-
id: cache-source
76-
uses: actions/cache@v4
76+
- name: Checkout code (attempt 2)
77+
if: steps.checkout_attempt_1.outcome == 'failure'
78+
id: checkout_attempt_2
79+
uses: actions/checkout@v4
80+
continue-on-error: true
7781
with:
78-
path: .
79-
key: source-code-${{ github.sha }}
80-
81-
- name: Create source code tarball for distribution
82-
run: |
83-
tar -czf /tmp/flagscale-source.tar.gz \
84-
--exclude='.git' \
85-
--exclude='*.pyc' \
86-
--exclude='__pycache__' \
87-
.
82+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
83+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
84+
ssh-strict: true
85+
ssh-user: git
86+
persist-credentials: false
87+
clean: true
88+
sparse-checkout-cone-mode: true
89+
fetch-tags: false
90+
show-progress: true
91+
lfs: false
92+
submodules: false
93+
set-safe-directory: true
8894

89-
- name: Upload source code artifact
90-
uses: actions/upload-artifact@v4
95+
- name: Checkout code (attempt 3)
96+
if: steps.checkout_attempt_2.outcome == 'failure'
97+
id: checkout_attempt_3
98+
uses: actions/checkout@v4
9199
with:
92-
name: flagscale-source-${{ github.sha }}
93-
path: /tmp/flagscale-source.tar.gz
94-
retention-days: 1
95-
compression-level: 0
100+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
101+
ref: ${{ github.event.pull_request.head.ref || github.ref }}
102+
ssh-strict: true
103+
ssh-user: git
104+
persist-credentials: false
105+
clean: true
106+
sparse-checkout-cone-mode: true
107+
fetch-tags: false
108+
show-progress: true
109+
lfs: false
110+
submodules: false
111+
set-safe-directory: true
96112

97113
- name: Load platform configuration
98114
id: config
@@ -149,7 +165,6 @@ jobs:
149165
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
150166
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
151167
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
152-
source_artifact: flagscale-source-${{ github.sha }}
153168
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
154169
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
155170
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -172,7 +187,6 @@ jobs:
172187
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
173188
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
174189
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
175-
source_artifact: flagscale-source-${{ github.sha }}
176190
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
177191
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
178192
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -191,7 +205,6 @@ jobs:
191205
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
192206
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
193207
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
194-
source_artifact: flagscale-source-${{ github.sha }}
195208
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
196209
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
197210
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -210,7 +223,6 @@ jobs:
210223
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
211224
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
212225
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
213-
source_artifact: flagscale-source-${{ github.sha }}
214226
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
215227
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
216228
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -229,7 +241,6 @@ jobs:
229241
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
230242
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
231243
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
232-
source_artifact: flagscale-source-${{ github.sha }}
233244
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
234245
env_name: ${{ needs.checkout_and_config.outputs.env_name_inference }}
235246
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -248,7 +259,6 @@ jobs:
248259
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
249260
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
250261
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
251-
source_artifact: flagscale-source-${{ github.sha }}
252262
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
253263
env_name: ${{ needs.checkout_and_config.outputs.env_name_serve }}
254264
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -267,7 +277,6 @@ jobs:
267277
# runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
268278
# container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
269279
# container_options: ${{ needs.checkout_and_config.outputs.container_options }}
270-
# source_artifact: flagscale-source-${{ github.sha }}
271280
# pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
272281
# env_name: ${{ needs.checkout_and_config.outputs.env_name_rl }}
273282
# env_path: ${{ needs.checkout_and_config.outputs.env_path }}
@@ -286,7 +295,6 @@ jobs:
286295
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
287296
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
288297
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
289-
source_artifact: flagscale-source-${{ github.sha }}
290298
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
291299
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
292300
env_path: ${{ needs.checkout_and_config.outputs.env_path }}

0 commit comments

Comments
 (0)