Skip to content

Commit 73d9beb

Browse files
zihugithubzihugithub
andauthored
[Benchmark] Add benchmark functional test framework with Qwen3 test case (#1145)
### PR Category CICD ### PR Types New Features ### PR Description Add a benchmark functional test framework to the CI/CD pipeline, enabling automated detection of training performance regressions by comparing runtime metrics against baseline gold values. - Introduce dedicated benchmark workflow (`functional_tests_benchmark.yml`) with artifact download retry logic, environment auto-setup, benchmark log parsing, metrics upload to backend, and failure log archiving - Add `test_benchmark_equal` in `check_results.py` supporting two threshold types (`upper_bound` for elapsed time, `lower_bound` for throughput) with configurable tolerance and automatic warmup iteration skipping (first 5 iterations) - Add `parse_benchmark_output.py` to extract metrics from training logs into structured JSON and upload to the metrics backend for tracking - Register `benchmark` as a new task type in the test runner (`run_functional_tests.sh`), platform config loader (`load_platform_config.sh`), and platform definition (`cuda.yaml`) - Add Qwen3 tp2_pp2 as the first benchmark test case with gold values for elapsed time per iteration (ms) and throughput per GPU (TFLOP/s/GPU) at 10% tolerance - Integrate benchmark tests into `all_tests_common.yml` and re-enable inference/serve test checks in the completion gate --------- Co-authored-by: zihugithub <fbye@baai.ac.cn>
1 parent 1c6b05a commit 73d9beb

11 files changed

Lines changed: 751 additions & 15 deletions

File tree

.github/workflows/all_tests_common.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
inference_test_matrix: ${{ steps.config.outputs.inference_test_matrix }}
2828
serve_test_matrix: ${{ steps.config.outputs.serve_test_matrix }}
2929
rl_test_matrix: ${{ steps.config.outputs.rl_test_matrix }}
30+
benchmark_test_matrix: ${{ steps.config.outputs.benchmark_test_matrix }}
3031
pkg_mgr: ${{ steps.config.outputs.pkg_mgr }}
3132
env_path: ${{ steps.config.outputs.env_path }}
3233
env_name_train: ${{ steps.config.outputs.env_name_train }}
@@ -169,7 +170,6 @@ jobs:
169170
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
170171
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
171172

172-
# NOTE: Inference, serve, and rl functional tests are temporarily disabled
173173
functional_tests_inference:
174174
needs:
175175
- checkout_and_config
@@ -206,6 +206,7 @@ jobs:
206206
env_name: ${{ needs.checkout_and_config.outputs.env_name_serve }}
207207
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
208208

209+
# NOTE: rl functional tests are temporarily disabled
209210
# functional_tests_rl:
210211
# needs:
211212
# - checkout_and_config
@@ -224,6 +225,24 @@ jobs:
224225
# env_name: ${{ needs.checkout_and_config.outputs.env_name_rl }}
225226
# env_path: ${{ needs.checkout_and_config.outputs.env_path }}
226227

228+
functional_tests_benchmark:
229+
needs:
230+
- checkout_and_config
231+
- unit_tests
232+
if: fromJson(needs.checkout_and_config.outputs.benchmark_test_matrix)[0] != null
233+
uses: ./.github/workflows/functional_tests_benchmark.yml
234+
with:
235+
platform: ${{ inputs.platform }}
236+
test_matrix: ${{ needs.checkout_and_config.outputs.benchmark_test_matrix }}
237+
image: ${{ needs.checkout_and_config.outputs.ci_train_image }}
238+
runs_on: ${{ needs.checkout_and_config.outputs.runs_on }}
239+
container_volumes: ${{ needs.checkout_and_config.outputs.container_volumes }}
240+
container_options: ${{ needs.checkout_and_config.outputs.container_options }}
241+
source_artifact: flagscale-source-${{ github.sha }}
242+
pkg_mgr: ${{ needs.checkout_and_config.outputs.pkg_mgr }}
243+
env_name: ${{ needs.checkout_and_config.outputs.env_name_train }}
244+
env_path: ${{ needs.checkout_and_config.outputs.env_path }}
245+
227246
all_tests_complete:
228247
defaults:
229248
run:
@@ -234,9 +253,10 @@ jobs:
234253
- unit_tests
235254
- functional_tests_train
236255
- functional_tests_hetero_train
256+
- functional_tests_benchmark
257+
- functional_tests_inference
258+
- functional_tests_serve
237259
# NOTE: Disabled tests removed from needs
238-
# - functional_tests_inference
239-
# - functional_tests_serve
240260
# - functional_tests_rl
241261
runs-on: ubuntu-latest
242262
if: always()
@@ -269,19 +289,25 @@ jobs:
269289
failed=true
270290
fi
271291
272-
# NOTE: Inference, serve, and rl checks disabled
273-
# if [ "${{ needs.functional_tests_inference.result }}" != "success" ] && \
274-
# [ "${{ needs.functional_tests_inference.result }}" != "skipped" ]; then
275-
# echo "❌ Inference functional tests failed"
276-
# failed=true
277-
# fi
292+
if [ "${{ needs.functional_tests_benchmark.result }}" != "success" ] && \
293+
[ "${{ needs.functional_tests_benchmark.result }}" != "skipped" ]; then
294+
echo "❌ Benchmark tests failed"
295+
failed=true
296+
fi
278297
279-
# if [ "${{ needs.functional_tests_serve.result }}" != "success" ] && \
280-
# [ "${{ needs.functional_tests_serve.result }}" != "skipped" ]; then
281-
# echo "❌ Serve functional tests failed"
282-
# failed=true
283-
# fi
298+
if [ "${{ needs.functional_tests_inference.result }}" != "success" ] && \
299+
[ "${{ needs.functional_tests_inference.result }}" != "skipped" ]; then
300+
echo "❌ Inference functional tests failed"
301+
failed=true
302+
fi
303+
304+
if [ "${{ needs.functional_tests_serve.result }}" != "success" ] && \
305+
[ "${{ needs.functional_tests_serve.result }}" != "skipped" ]; then
306+
echo "❌ Serve functional tests failed"
307+
failed=true
308+
fi
284309
310+
# NOTE: Inference, serve, and rl checks disabled
285311
# if [ "${{ needs.functional_tests_rl.result }}" != "success" ] && \
286312
# [ "${{ needs.functional_tests_rl.result }}" != "skipped" ]; then
287313
# echo "❌ RL functional tests failed"

0 commit comments

Comments
 (0)