[CI] Build the Rust extension modules once per run instead of in every CUDA job (#33384)

This commit is contained in:
Liangsheng Yin
2026-08-03 18:56:48 -07:00
committed by GitHub
parent 572924634b
commit cdff33d738
9 changed files with 567 additions and 28 deletions
@@ -9,6 +9,10 @@ on:
sgl_kernel:
required: true
type: string
rust_ext_artifact:
description: 'Artifact of prebuilt Rust extension modules, from rust-ext-build. Empty, or a download that fails, means this job compiles them during install.'
type: string
default: ''
runner_config:
required: true
type: string
@@ -102,8 +106,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
- name: Run diffusion server tests
@@ -168,8 +183,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
@@ -231,8 +257,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
@@ -293,8 +330,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
@@ -362,8 +410,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
@@ -407,10 +466,20 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_CI_EARLY_LD_LIBRARY_PATH: "1"
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
@@ -461,8 +530,19 @@ jobs:
merge-multiple: true
pattern: wheel-python3.10-cuda*
- name: Download prebuilt Rust extensions
id: rust_ext
if: ${{ inputs.rust_ext_artifact != '' }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: ${{ inputs.rust_ext_artifact }}
path: python/sglang/srt/
- name: Install dependencies
timeout-minutes: 20
env:
SGLANG_BUILD_RUST_EXTS: ${{ steps.rust_ext.outcome == 'success' && 'none' || '' }}
run: |
CUSTOM_BUILD_SGL_KERNEL=${{inputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh diffusion