Files
sglang/.github/workflows/diffusion-ci-gt-gen.yml
T

218 lines
7.5 KiB
YAML

name: Diffusion CI Ground Truth Generation
on:
workflow_dispatch:
inputs:
ref:
description: 'Git ref to checkout'
required: false
default: ''
type: string
case_ids:
description: 'Specific case IDs to run (space-separated, optional)'
required: false
default: ''
type: string
output_name:
description: 'Custom output folder name (also used for artifact names and publish target dir). Leave empty to use defaults.'
required: false
default: ''
type: string
kernel_artifact_run_id:
description: "Optional sgl-kernel wheel source: GitHub Actions run ID of a pr-test.yml run on the SAME commit as 'ref' that uploaded wheel-python3.10-cuda13.0. Use only when this branch's torch/ABI change makes the PyPI sglang-kernel wheel incompatible. Find it under Actions > pr-test; artifacts expire after 90 days."
required: false
default: ''
type: string
concurrency:
group: diffusion-ci-gt-gen-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
actions: read
env:
SGLANG_IS_IN_CI: true
SGLANG_CUDA_COREDUMP: "1"
OUTPUT_NAME: ${{ inputs.output_name || 'diffusion-ci-outputs' }}
jobs:
multimodal-diffusion-gen-1gpu:
if: github.repository == 'sgl-project/sglang'
runs-on: 1-gpu-h100
strategy:
matrix:
part: [0, 1]
timeout-minutes: 150
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Prepare sgl-kernel/dist for prebuilt wheel
if: inputs.kernel_artifact_run_id != ''
run: |
ls -alh sgl-kernel/dist || true
rm -rf sgl-kernel/dist/* || true
- name: Download prebuilt sgl-kernel wheel
if: inputs.kernel_artifact_run_id != ''
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
merge-multiple: true
name: wheel-python3.10-cuda13.0
run-id: ${{ inputs.kernel_artifact_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
CUSTOM_BUILD_SGL_KERNEL="${{ inputs.kernel_artifact_run_id != '' && 'true' || 'false' }}" \
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
- name: Generate outputs
env:
RUNAI_STREAMER_MEMORY_LIMIT: 0
run: |
cd python
python -m sglang.multimodal_gen.test.scripts.gen_diffusion_ci_outputs \
--suite 1-gpu \
--partition-id ${{ matrix.part }} \
--total-partitions 2 \
--out-dir ./${{ env.OUTPUT_NAME }} \
${{ inputs.case_ids != '' && format('--case-ids {0}', inputs.case_ids) || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_NAME }}-1gpu-part${{ matrix.part }}
path: python/${{ env.OUTPUT_NAME }}
retention-days: 7
- name: Publish GT images to sglang-bot/sglang-ci-data
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
run: |
python scripts/ci/utils/diffusion/publish_diffusion_gt.py \
--source-dir python/${{ env.OUTPUT_NAME }} \
${{ inputs.output_name != '' && format('--target-dir diffusion-ci/{0}', inputs.output_name) || '' }}
multimodal-diffusion-gen-2gpu:
if: github.repository == 'sgl-project/sglang'
runs-on: 2-gpu-h100
strategy:
matrix:
part: [0, 1]
timeout-minutes: 150
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Prepare sgl-kernel/dist for prebuilt wheel
if: inputs.kernel_artifact_run_id != ''
run: |
ls -alh sgl-kernel/dist || true
rm -rf sgl-kernel/dist/* || true
- name: Download prebuilt sgl-kernel wheel
if: inputs.kernel_artifact_run_id != ''
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
merge-multiple: true
name: wheel-python3.10-cuda13.0
run-id: ${{ inputs.kernel_artifact_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
CUSTOM_BUILD_SGL_KERNEL="${{ inputs.kernel_artifact_run_id != '' && 'true' || 'false' }}" \
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
- name: Generate outputs
env:
RUNAI_STREAMER_MEMORY_LIMIT: 0
run: |
cd python
python -m sglang.multimodal_gen.test.scripts.gen_diffusion_ci_outputs \
--suite 2-gpu \
--partition-id ${{ matrix.part }} \
--total-partitions 2 \
--out-dir ./${{ env.OUTPUT_NAME }} \
${{ inputs.case_ids != '' && format('--case-ids {0}', inputs.case_ids) || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_NAME }}-2gpu-part${{ matrix.part }}
path: python/${{ env.OUTPUT_NAME }}
retention-days: 7
- name: Publish GT images to sglang-bot/sglang-ci-data
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
run: |
python scripts/ci/utils/diffusion/publish_diffusion_gt.py \
--source-dir python/${{ env.OUTPUT_NAME }} \
${{ inputs.output_name != '' && format('--target-dir diffusion-ci/{0}', inputs.output_name) || '' }}
multimodal-diffusion-gen-b200:
if: github.repository == 'sgl-project/sglang'
runs-on: 4-gpu-b200
timeout-minutes: 240
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Prepare sgl-kernel/dist for prebuilt wheel
if: inputs.kernel_artifact_run_id != ''
run: |
ls -alh sgl-kernel/dist || true
rm -rf sgl-kernel/dist/* || true
- name: Download prebuilt sgl-kernel wheel
if: inputs.kernel_artifact_run_id != ''
uses: actions/download-artifact@v4
with:
path: sgl-kernel/dist/
merge-multiple: true
name: wheel-python3.10-cuda13.0
run-id: ${{ inputs.kernel_artifact_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
CUSTOM_BUILD_SGL_KERNEL="${{ inputs.kernel_artifact_run_id != '' && 'true' || 'false' }}" \
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
- name: Generate outputs
env:
RUNAI_STREAMER_MEMORY_LIMIT: 0
run: |
cd python
python -m sglang.multimodal_gen.test.scripts.gen_diffusion_ci_outputs \
--suite 1-gpu-b200 \
--out-dir ./${{ env.OUTPUT_NAME }} \
${{ inputs.case_ids != '' && format('--case-ids {0}', inputs.case_ids) || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_NAME }}-b200
path: python/${{ env.OUTPUT_NAME }}
retention-days: 7
- name: Publish GT images to sglang-bot/sglang-ci-data
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
run: |
python scripts/ci/utils/diffusion/publish_diffusion_gt.py \
--source-dir python/${{ env.OUTPUT_NAME }} \
${{ inputs.output_name != '' && format('--target-dir diffusion-ci/{0}', inputs.output_name) || '' }}