ci: move metrics scripts under scripts/ci/utils (#20986)

This commit is contained in:
Lianmin Zheng
2026-03-19 23:47:57 -07:00
committed by GitHub
parent 0be88ac44c
commit 712a48c5d2
9 changed files with 26 additions and 27 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ on:
pull_request: pull_request:
paths: paths:
- '.github/workflows/amd-ci-job-monitor.yml' - '.github/workflows/amd-ci-job-monitor.yml'
- 'scripts/ci/query_job_status.py' - 'scripts/ci/utils/query_job_status.py'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
hours: hours:
@@ -42,7 +42,7 @@ jobs:
- name: Generate Custom Job Report - name: Generate Custom Job Report
timeout-minutes: 30 timeout-minutes: 30
run: | run: |
python scripts/ci/query_job_status.py \ python scripts/ci/utils/query_job_status.py \
--repo ${{ github.repository }} \ --repo ${{ github.repository }} \
--job "${{ inputs.job_filter }}" \ --job "${{ inputs.job_filter }}" \
--workflow "pr-test-amd.yml" \ --workflow "pr-test-amd.yml" \
@@ -107,7 +107,7 @@ jobs:
- name: Generate Report - name: Generate Report
timeout-minutes: 15 timeout-minutes: 15
run: | run: |
python scripts/ci/query_job_status.py \ python scripts/ci/utils/query_job_status.py \
--repo ${{ github.repository }} \ --repo ${{ github.repository }} \
--job "${{ matrix.job_name }}" \ --job "${{ matrix.job_name }}" \
--workflow "pr-test-amd.yml" \ --workflow "pr-test-amd.yml" \
@@ -141,7 +141,7 @@ jobs:
- name: Generate Nightly Report - name: Generate Nightly Report
timeout-minutes: 15 timeout-minutes: 15
run: | run: |
python scripts/ci/query_job_status.py \ python scripts/ci/utils/query_job_status.py \
--repo ${{ github.repository }} \ --repo ${{ github.repository }} \
--job "${{ matrix.job_name }}" \ --job "${{ matrix.job_name }}" \
--workflow "nightly-test-amd.yml" \ --workflow "nightly-test-amd.yml" \
+5 -5
View File
@@ -157,7 +157,7 @@ jobs:
- name: Collect performance metrics - name: Collect performance metrics
if: always() if: always()
run: | run: |
python3 scripts/ci/save_metrics.py \ python3 scripts/ci/utils/save_metrics.py \
--gpu-config 8-gpu-h200 \ --gpu-config 8-gpu-h200 \
--partition ${{ matrix.partition }} \ --partition ${{ matrix.partition }} \
--run-id ${{ github.run_id }} \ --run-id ${{ github.run_id }} \
@@ -257,7 +257,7 @@ jobs:
- name: Collect performance metrics - name: Collect performance metrics
if: always() if: always()
run: | run: |
python3 scripts/ci/save_metrics.py \ python3 scripts/ci/utils/save_metrics.py \
--gpu-config 8-gpu-b200 \ --gpu-config 8-gpu-b200 \
--partition ${{ matrix.partition }} \ --partition ${{ matrix.partition }} \
--run-id ${{ github.run_id }} \ --run-id ${{ github.run_id }} \
@@ -434,7 +434,7 @@ jobs:
- name: Collect diffusion performance metrics - name: Collect diffusion performance metrics
if: always() if: always()
run: | run: |
python3 scripts/ci/save_diffusion_metrics.py \ python3 scripts/ci/utils/save_diffusion_metrics.py \
--gpu-config 1-gpu-runner \ --gpu-config 1-gpu-runner \
--run-id ${{ github.run_id }} \ --run-id ${{ github.run_id }} \
--output python/diffusion-metrics-1gpu-partition-${{ matrix.part }}.json \ --output python/diffusion-metrics-1gpu-partition-${{ matrix.part }}.json \
@@ -490,7 +490,7 @@ jobs:
- name: Collect diffusion performance metrics - name: Collect diffusion performance metrics
if: always() if: always()
run: | run: |
python3 scripts/ci/save_diffusion_metrics.py \ python3 scripts/ci/utils/save_diffusion_metrics.py \
--gpu-config 2-gpu-runner \ --gpu-config 2-gpu-runner \
--run-id ${{ github.run_id }} \ --run-id ${{ github.run_id }} \
--output python/diffusion-metrics-2gpu-partition-${{ matrix.part }}.json \ --output python/diffusion-metrics-2gpu-partition-${{ matrix.part }}.json \
@@ -589,7 +589,7 @@ jobs:
- name: Merge metrics - name: Merge metrics
run: | run: |
python3 scripts/ci/merge_metrics.py \ python3 scripts/ci/utils/merge_metrics.py \
--input-dir metrics/ \ --input-dir metrics/ \
--output consolidated-metrics-${{ github.run_id }}.json \ --output consolidated-metrics-${{ github.run_id }}.json \
--run-id ${{ github.run_id }} \ --run-id ${{ github.run_id }} \
+9 -9
View File
@@ -114,24 +114,24 @@ jobs:
with: with:
filters: | filters: |
main_package: main_package:
- "python/sglang/!(multimodal_gen)/**" - ".github/workflows/pr-test.yml"
- "python/pyproject.toml" - "python/pyproject.toml"
- "python/sglang/!(multimodal_gen)/**"
- "scripts/ci/cuda/*" - "scripts/ci/cuda/*"
- "scripts/ci/utils/*" - "scripts/ci/utils/*"
- "test/**" - "test/**"
- ".github/workflows/pr-test.yml"
sgl_kernel:
- "sgl-kernel/**"
jit_kernel:
- "python/sglang/jit_kernel/**"
- "python/pyproject.toml"
- ".github/workflows/pr-test.yml"
multimodal_gen: multimodal_gen:
- ".github/workflows/pr-test.yml"
- "python/pyproject.toml"
- "python/sglang/multimodal_gen/**" - "python/sglang/multimodal_gen/**"
- "python/sglang/jit_kernel/**" - "python/sglang/jit_kernel/**"
- "python/sglang/cli/**" - "python/sglang/cli/**"
- "python/pyproject.toml" jit_kernel:
- ".github/workflows/pr-test.yml" - ".github/workflows/pr-test.yml"
- "python/pyproject.toml"
- "python/sglang/jit_kernel/**"
sgl_kernel:
- "sgl-kernel/**"
# For /rerun-stage (workflow_dispatch with target_stage), dorny/paths-filter doesn't work # For /rerun-stage (workflow_dispatch with target_stage), dorny/paths-filter doesn't work
# correctly because it falls back to "last commit" detection which breaks for merge commits. # correctly because it falls back to "last commit" detection which breaks for merge commits.
+1 -1
View File
@@ -209,7 +209,7 @@ class NightlyBenchmarkRunner:
) )
# Note: JSON files are preserved for metrics collection by CI scripts # Note: JSON files are preserved for metrics collection by CI scripts
# They will be collected by scripts/ci/save_metrics.py # They will be collected by scripts/ci/utils/save_metrics.py
return benchmark_results, True return benchmark_results, True
@@ -5,7 +5,7 @@ This script reads all per-partition metric JSON files and consolidates them
into a single JSON file with run-level metadata. into a single JSON file with run-level metadata.
Usage: Usage:
python3 scripts/ci/merge_metrics.py \ python3 scripts/ci/utils/merge_metrics.py \
--input-dir metrics/ \ --input-dir metrics/ \
--output consolidated-metrics-12345678.json \ --output consolidated-metrics-12345678.json \
--run-id 12345678 \ --run-id 12345678 \
@@ -3,9 +3,9 @@
Query GitHub Actions job status for specific jobs. Query GitHub Actions job status for specific jobs.
Usage: Usage:
python scripts/ci/query_job_status.py --job "stage-c-test-large-8-gpu-amd-mi35x" python scripts/ci/utils/query_job_status.py --job "stage-c-test-large-8-gpu-amd-mi35x"
python scripts/ci/query_job_status.py --job "stage-c-test-large-8-gpu-amd-mi35x" --hours 48 python scripts/ci/utils/query_job_status.py --job "stage-c-test-large-8-gpu-amd-mi35x" --hours 48
python scripts/ci/query_job_status.py --job "AMD" --workflow pr-test-amd.yml python scripts/ci/utils/query_job_status.py --job "AMD" --workflow pr-test-amd.yml
Requirements: Requirements:
pip install tabulate pip install tabulate
@@ -5,7 +5,7 @@ This script reads diffusion test results from the pytest stash and saves them
with metadata for the performance dashboard. with metadata for the performance dashboard.
Usage: Usage:
python3 scripts/ci/save_diffusion_metrics.py \ python3 scripts/ci/utils/save_diffusion_metrics.py \
--gpu-config 1-gpu-runner \ --gpu-config 1-gpu-runner \
--run-id 12345678 \ --run-id 12345678 \
--output test/diffusion-metrics-1gpu.json \ --output test/diffusion-metrics-1gpu.json \
@@ -5,7 +5,7 @@ This script reads benchmark result JSON files from performance profile directori
and saves them with metadata for artifact collection in CI. and saves them with metadata for artifact collection in CI.
Usage: Usage:
python3 scripts/ci/save_metrics.py \ python3 scripts/ci/utils/save_metrics.py \
--gpu-config 8-gpu-h200 \ --gpu-config 8-gpu-h200 \
--partition 0 \ --partition 0 \
--run-id 12345678 \ --run-id 12345678 \
+1 -2
View File
@@ -22,7 +22,6 @@ _spec = importlib.util.spec_from_file_location("ci_register", _ci_register_path)
_ci_register = importlib.util.module_from_spec(_spec) _ci_register = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(_ci_register) _spec.loader.exec_module(_ci_register)
CIRegistry = _ci_register.CIRegistry
HWBackend = _ci_register.HWBackend HWBackend = _ci_register.HWBackend
auto_partition = _ci_register.auto_partition auto_partition = _ci_register.auto_partition
collect_tests = _ci_register.collect_tests collect_tests = _ci_register.collect_tests
@@ -110,7 +109,7 @@ def main():
total_time = sum(t.est_time for t in enabled) total_time = sum(t.est_time for t in enabled)
out( out(
f"### {suite} (hw={hw_str}, {partition_count} partition(s), " f"### {suite} (hw={hw_str}, {partition_count} partitions, "
f"{len(enabled)} enabled, {len(disabled)} disabled, est {total_time:.0f}s total)" f"{len(enabled)} enabled, {len(disabled)} disabled, est {total_time:.0f}s total)"
) )
out() out()