forked from flagos-ai/FlagScale
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (118 loc) · 3.96 KB
/
Copy pathfunctional_tests_common.yml
File metadata and controls
135 lines (118 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Common Functional Tests
on:
workflow_call:
inputs:
platform:
required: true
type: string
description: Platform name (e.g., cuda, default)
device:
required: true
type: string
description: Device type (e.g., a100, a800, h100, generic)
task:
required: true
type: string
description: Task name (e.g., train, hetero_train)
model:
required: true
type: string
description: Model name (e.g., aquila, mixtral, deepseek)
case:
required: false
type: string
description: Specific test case (e.g., tp2_pp2, tp4_pp2)
image:
required: true
type: string
runs_on:
required: true
type: string
container_volumes:
required: true
type: string
container_options:
required: true
type: string
source_artifact:
required: true
type: string
description: Name of the artifact containing source code
jobs:
functional_test:
runs-on: ${{ fromJson(inputs.runs_on) }}
container:
image: ${{ inputs.image }}
ports:
- 80
volumes: ${{ fromJson(inputs.container_volumes) }}
options: ${{ inputs.container_options }}
steps:
- name: Download source code artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.source_artifact }}
path: /tmp
- name: Extract source code
shell: bash
run: |
mkdir -p /__w/FlagScale/FlagScale
tar -xzf /tmp/flagscale-source.tar.gz -C /__w/FlagScale/FlagScale
- name: Set safe directory
shell: bash
run: |
git config --global --add safe.directory /__w/FlagScale/FlagScale
- name: Run functional tests
id: functional_test
shell: bash
run: |
set -euo pipefail
cd /__w/FlagScale/FlagScale
PLATFORM='${{ inputs.platform }}'
DEVICE='${{ inputs.device }}'
TASK='${{ inputs.task }}'
MODEL='${{ inputs.model }}'
CASE='${{ inputs.case }}'
PROJECT_ROOT="/__w/FlagScale/FlagScale"
echo "Running functional tests"
echo "Platform: $PLATFORM"
echo "Device: $DEVICE"
echo "Task: $TASK"
echo "Model: $MODEL"
echo "Case: ${CASE:-all}"
echo "Project root: $PROJECT_ROOT"
# Load retry functions
source "$PROJECT_ROOT/.github/workflows/scripts/retry_functions.sh"
# Setup backend
source /root/miniconda3/bin/activate flagscale-train
COMMANDS=(
"rm -rf ${GITHUB_WORKSPACE}/Megatron-LM-FL"
"git clone https://github.com/flagos-ai/Megatron-LM-FL.git"
"pip install httpx multi-storage-client boto3 google-cloud-storage fastapi uvicorn griffe"
"cd ${GITHUB_WORKSPACE}/Megatron-LM-FL && pip install --no-build-isolation . -vvv"
)
retry_commands 3 "${COMMANDS[@]}"
# Ensure we're back in the project root
cd "$PROJECT_ROOT"
# Build run_tests.sh command
TEST_CMD="bash $PROJECT_ROOT/tests/test_utils/runners/run_tests.sh \
--platform $PLATFORM \
--device $DEVICE \
--type functional \
--task $TASK \
--model $MODEL"
# Add case filter if specified
if [ -n "$CASE" ]; then
TEST_CMD="$TEST_CMD --list $CASE"
fi
# Run functional tests
eval "$TEST_CMD"
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo "✅ Functional tests passed for $PLATFORM/$DEVICE/$TASK/$MODEL${CASE:+/$CASE}"
else
echo "❌ Functional tests failed for $PLATFORM/$DEVICE/$TASK/$MODEL${CASE:+/$CASE} (exit code: $exit_code)"
fi
echo "exit_code=$exit_code" >> $GITHUB_OUTPUT
exit $exit_code
timeout-minutes: 180