[CI] Add per-stage NVIDIA model inventory tool (#29447)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
372a893744
commit
860244d4b4
@@ -0,0 +1,68 @@
|
||||
name: CI Model Inventory
|
||||
|
||||
# Builds models-per-stage.json: each NVIDIA (CUDA) CI suite -> the HuggingFace
|
||||
# model ids its tests reference, for runner cache pre-warming. Pure static
|
||||
# analysis (no GPU, no sglang install), so it stays fresh per push to main.
|
||||
# Grab the result with:
|
||||
# gh run download -R sgl-project/sglang --name models-per-stage
|
||||
# or read the rendered table in the run's job summary.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "test/registered/**"
|
||||
- "test/run_suite.py"
|
||||
- "python/sglang/test/test_utils.py"
|
||||
- "python/sglang/test/lora_utils.py"
|
||||
- "python/sglang/test/ci/**"
|
||||
- "scripts/ci/list_stage_models.py"
|
||||
- "scripts/ci/stage_models_overrides.json"
|
||||
- "scripts/ci/runner_configs.yml"
|
||||
- ".github/workflows/ci-model-inventory.yml"
|
||||
pull_request:
|
||||
# Validate the tool itself end-to-end when it changes. Deliberately NOT
|
||||
# filtered on test/registered/** -- that would run on most PRs; the
|
||||
# published inventory is refreshed by the push-to-main trigger instead.
|
||||
paths:
|
||||
- "scripts/ci/list_stage_models.py"
|
||||
- "scripts/ci/test_list_stage_models.py"
|
||||
- "scripts/ci/stage_models_overrides.json"
|
||||
- ".github/workflows/ci-model-inventory.yml"
|
||||
schedule:
|
||||
# Nightly safety net (09:00 UTC) so the artifact never goes stale even if a
|
||||
# change lands outside the path filter above.
|
||||
- cron: "0 9 * * *"
|
||||
|
||||
jobs:
|
||||
build-inventory:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Run extractor unit tests
|
||||
run: python3 -m unittest discover -s scripts/ci -p 'test_list_stage_models.py'
|
||||
|
||||
- name: Generate model inventory
|
||||
run: |
|
||||
python3 scripts/ci/list_stage_models.py \
|
||||
--backend cuda \
|
||||
--commit "${{ github.sha }}" \
|
||||
--output models-per-stage.json \
|
||||
--markdown inventory.md
|
||||
|
||||
- name: Write job summary
|
||||
run: cat inventory.md >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: Upload inventory artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: models-per-stage
|
||||
path: models-per-stage.json
|
||||
retention-days: 90
|
||||
Reference in New Issue
Block a user