[Dependency] Upgrade to Torch 2.11.0 (#21247)
Co-authored-by: Kangyan Zhou <zky314343421@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com> Co-authored-by: b8zhong <b8zhong@users.noreply.github.com> Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
co-authored by
Kangyan Zhou
Claude Opus 4.7
Baizhou Zhang
b8zhong
Mick
parent
24a6b3084d
commit
88bb5dffe4
@@ -638,6 +638,7 @@ jobs:
|
|||||||
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
||||||
-e SGLANG_SKIP_CONSISTENCY=1 \
|
-e SGLANG_SKIP_CONSISTENCY=1 \
|
||||||
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
||||||
|
-e SGLANG_DIFFUSION_ARTIFACT_DIR=/sglang-checkout/diffusion-failures \
|
||||||
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
||||||
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
||||||
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
||||||
@@ -653,6 +654,15 @@ jobs:
|
|||||||
echo "=== Post-test System Memory Status ==="
|
echo "=== Post-test System Memory Status ==="
|
||||||
free -h
|
free -h
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-amd-rocm720-1gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-2-gpu-amd-rocm720:
|
multimodal-gen-test-2-gpu-amd-rocm720:
|
||||||
needs: [check-changes]
|
needs: [check-changes]
|
||||||
if: |
|
if: |
|
||||||
@@ -768,6 +778,7 @@ jobs:
|
|||||||
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
||||||
-e SGLANG_SKIP_CONSISTENCY=1 \
|
-e SGLANG_SKIP_CONSISTENCY=1 \
|
||||||
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
||||||
|
-e SGLANG_DIFFUSION_ARTIFACT_DIR=/sglang-checkout/diffusion-failures \
|
||||||
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
||||||
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
||||||
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
||||||
@@ -782,6 +793,15 @@ jobs:
|
|||||||
echo "=== Post-test System Memory Status ==="
|
echo "=== Post-test System Memory Status ==="
|
||||||
free -h
|
free -h
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-amd-rocm720-2gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
|
||||||
stage-c-test-4-gpu-amd-rocm720:
|
stage-c-test-4-gpu-amd-rocm720:
|
||||||
needs: [check-changes, stage-b-test-1-gpu-small-amd-rocm720, stage-b-test-2-gpu-large-amd-rocm720]
|
needs: [check-changes, stage-b-test-1-gpu-small-amd-rocm720, stage-b-test-2-gpu-large-amd-rocm720]
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ jobs:
|
|||||||
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
||||||
-e SGLANG_SKIP_CONSISTENCY=1 \
|
-e SGLANG_SKIP_CONSISTENCY=1 \
|
||||||
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
||||||
|
-e SGLANG_DIFFUSION_ARTIFACT_DIR=/sglang-checkout/diffusion-failures \
|
||||||
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
||||||
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
||||||
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
||||||
@@ -709,6 +710,15 @@ jobs:
|
|||||||
echo "=== Post-test System Memory Status ==="
|
echo "=== Post-test System Memory Status ==="
|
||||||
free -h
|
free -h
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-amd-1gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-2-gpu-amd:
|
multimodal-gen-test-2-gpu-amd:
|
||||||
name: ${{ format('multimodal-gen-test-2-gpu-amd (linux-{0}-2gpu-sglang, {1})', inputs.runner_arch || (github.event_name == 'pull_request' && 'mi300' || 'mi325'), matrix.part) }}
|
name: ${{ format('multimodal-gen-test-2-gpu-amd (linux-{0}-2gpu-sglang, {1})', inputs.runner_arch || (github.event_name == 'pull_request' && 'mi300' || 'mi325'), matrix.part) }}
|
||||||
needs: [check-changes, call-gate]
|
needs: [check-changes, call-gate]
|
||||||
@@ -823,6 +833,7 @@ jobs:
|
|||||||
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
-e SGLANG_DENOISE_AGG_TOLERANCE=0.3 \
|
||||||
-e SGLANG_SKIP_CONSISTENCY=1 \
|
-e SGLANG_SKIP_CONSISTENCY=1 \
|
||||||
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
-e SGLANG_TEST_NUM_INFERENCE_STEPS=5 \
|
||||||
|
-e SGLANG_DIFFUSION_ARTIFACT_DIR=/sglang-checkout/diffusion-failures \
|
||||||
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
-e AITER_JIT_DIR=/sgl-data/aiter-kernels \
|
||||||
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
-e MIOPEN_USER_DB_PATH=/sgl-data/miopen-cache \
|
||||||
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
-e HF_HUB_ENABLE_HF_TRANSFER=1 \
|
||||||
@@ -838,6 +849,15 @@ jobs:
|
|||||||
echo "=== Post-test System Memory Status ==="
|
echo "=== Post-test System Memory Status ==="
|
||||||
free -h
|
free -h
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-amd-2gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
|
||||||
wait-for-stage-b-amd:
|
wait-for-stage-b-amd:
|
||||||
needs: [check-changes, call-gate, wait-for-stage-a-amd]
|
needs: [check-changes, call-gate, wait-for-stage-a-amd]
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ on:
|
|||||||
jit_kernel:
|
jit_kernel:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
sgl_kernel:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
b200_runner:
|
b200_runner:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@@ -56,10 +59,24 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/check-maintenance
|
- uses: ./.github/actions/check-maintenance
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
run: |
|
||||||
|
ls -alh sgl-kernel/dist || true
|
||||||
|
rm -rf sgl-kernel/dist/* || true
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: sgl-kernel/dist/
|
||||||
|
merge-multiple: true
|
||||||
|
pattern: wheel-python3.10-cuda13.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
CUSTOM_BUILD_SGL_KERNEL=${{ inputs.sgl_kernel }} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
@@ -81,10 +98,24 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/check-maintenance
|
- uses: ./.github/actions/check-maintenance
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
run: |
|
||||||
|
ls -alh sgl-kernel/dist || true
|
||||||
|
rm -rf sgl-kernel/dist/* || true
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: sgl-kernel/dist/
|
||||||
|
merge-multiple: true
|
||||||
|
pattern: wheel-python3.10-cuda13.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
CUSTOM_BUILD_SGL_KERNEL=${{ inputs.sgl_kernel }} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
||||||
|
|
||||||
- name: Run multi-GPU test
|
- name: Run multi-GPU test
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
@@ -108,10 +139,24 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/check-maintenance
|
- uses: ./.github/actions/check-maintenance
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
run: |
|
||||||
|
ls -alh sgl-kernel/dist || true
|
||||||
|
rm -rf sgl-kernel/dist/* || true
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: sgl-kernel/dist/
|
||||||
|
merge-multiple: true
|
||||||
|
pattern: wheel-python3.10-cuda13.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
CUSTOM_BUILD_SGL_KERNEL=${{ inputs.sgl_kernel }} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
||||||
|
|
||||||
- name: Run benchmark tests
|
- name: Run benchmark tests
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
@@ -135,10 +180,24 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/check-maintenance
|
- uses: ./.github/actions/check-maintenance
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
run: |
|
||||||
|
ls -alh sgl-kernel/dist || true
|
||||||
|
rm -rf sgl-kernel/dist/* || true
|
||||||
|
|
||||||
|
- name: Download artifacts
|
||||||
|
if: inputs.sgl_kernel == 'true'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: sgl-kernel/dist/
|
||||||
|
merge-multiple: true
|
||||||
|
pattern: wheel-python3.10-cuda13.0
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
CUSTOM_BUILD_SGL_KERNEL=${{ inputs.sgl_kernel }} bash scripts/ci/cuda/ci_install_dependency.sh diffusion
|
||||||
|
|
||||||
- name: Run B200 diffusion test
|
- name: Run B200 diffusion test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ jobs:
|
|||||||
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
||||||
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
||||||
PARTITION_PLAN_JSON: ${{ needs.compute-diffusion-partitions.outputs.plan-1gpu }}
|
PARTITION_PLAN_JSON: ${{ needs.compute-diffusion-partitions.outputs.plan-1gpu }}
|
||||||
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite.py \
|
python3 sglang/multimodal_gen/test/run_suite.py \
|
||||||
@@ -146,6 +147,15 @@ jobs:
|
|||||||
path: python/sglang/multimodal_gen/test/execution_report_*.json
|
path: python/sglang/multimodal_gen/test/execution_report_*.json
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-1gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
- uses: ./.github/actions/upload-cuda-coredumps
|
- uses: ./.github/actions/upload-cuda-coredumps
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
@@ -199,6 +209,7 @@ jobs:
|
|||||||
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
||||||
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
||||||
PARTITION_PLAN_JSON: ${{ needs.compute-diffusion-partitions.outputs.plan-2gpu }}
|
PARTITION_PLAN_JSON: ${{ needs.compute-diffusion-partitions.outputs.plan-2gpu }}
|
||||||
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite.py \
|
python3 sglang/multimodal_gen/test/run_suite.py \
|
||||||
@@ -216,6 +227,15 @@ jobs:
|
|||||||
path: python/sglang/multimodal_gen/test/execution_report_*.json
|
path: python/sglang/multimodal_gen/test/execution_report_*.json
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-2gpu-${{ matrix.part }}-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
- uses: ./.github/actions/upload-cuda-coredumps
|
- uses: ./.github/actions/upload-cuda-coredumps
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
@@ -312,19 +332,19 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
RUNAI_STREAMER_MEMORY_LIMIT: 0
|
||||||
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
CONTINUE_ON_ERROR_FLAG: ${{ inputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
||||||
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-artifacts
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite.py \
|
python3 sglang/multimodal_gen/test/run_suite.py \
|
||||||
--suite 1-gpu-b200 \
|
--suite 1-gpu-b200 \
|
||||||
$CONTINUE_ON_ERROR_FLAG
|
$CONTINUE_ON_ERROR_FLAG
|
||||||
|
|
||||||
- name: Upload diffusion artifacts
|
- name: Upload diffusion failure artifacts
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: diffusion-artifacts-${{ github.job }}-${{ github.run_attempt }}
|
name: diffusion-failures-${{ github.job }}-${{ github.run_attempt }}
|
||||||
path: diffusion-artifacts/
|
path: diffusion-failures/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
- uses: ./.github/actions/upload-cuda-coredumps
|
- uses: ./.github/actions/upload-cuda-coredumps
|
||||||
|
|||||||
@@ -330,11 +330,21 @@ jobs:
|
|||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 1-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 1-npu
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-npu-1-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-2-npu-a3:
|
multimodal-gen-test-2-npu-a3:
|
||||||
needs: [check-changes, pr-gate]
|
needs: [check-changes, pr-gate]
|
||||||
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
||||||
@@ -379,11 +389,21 @@ jobs:
|
|||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 2-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 2-npu
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-npu-2-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-8-npu-a3:
|
multimodal-gen-test-8-npu-a3:
|
||||||
needs: [check-changes, pr-gate]
|
needs: [check-changes, pr-gate]
|
||||||
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
||||||
@@ -428,10 +448,20 @@ jobs:
|
|||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 8-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 8-npu
|
||||||
|
|
||||||
|
- name: Upload diffusion failure artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: diffusion-failures-npu-8-${{ github.run_attempt }}
|
||||||
|
path: diffusion-failures/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
pr-test-npu-finish:
|
pr-test-npu-finish:
|
||||||
needs:
|
needs:
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ env:
|
|||||||
SGLANG_CUDA_COREDUMP: "1"
|
SGLANG_CUDA_COREDUMP: "1"
|
||||||
SGLANG_JIT_DEEPGEMM_FAST_WARMUP: true
|
SGLANG_JIT_DEEPGEMM_FAST_WARMUP: true
|
||||||
SKIP_STAGE_HEALTH_CHECK: ${{ inputs.skip_stage_health_check == true && 'true' || 'false' }}
|
SKIP_STAGE_HEALTH_CHECK: ${{ inputs.skip_stage_health_check == true && 'true' || 'false' }}
|
||||||
|
# TEMP: rebuild deepep against the new torch for torch-211-merge PR only — revert before merging to main.
|
||||||
|
FORCE_REBUILD_DEEPEP: '1'
|
||||||
# Schedule / main-branch dispatch / workflow_call from main use refs/heads/main; PR events use refs/pull/*/merge
|
# Schedule / main-branch dispatch / workflow_call from main use refs/heads/main; PR events use refs/pull/*/merge
|
||||||
PR_TEST_BYPASS_MAINTENANCE_ON_MAIN: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}
|
PR_TEST_BYPASS_MAINTENANCE_ON_MAIN: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}
|
||||||
USE_VENV: false
|
USE_VENV: false
|
||||||
@@ -610,11 +612,18 @@ jobs:
|
|||||||
# =============================================== jit-kernel ====================================================
|
# =============================================== jit-kernel ====================================================
|
||||||
|
|
||||||
call-jit-kernel-tests:
|
call-jit-kernel-tests:
|
||||||
needs: [check-changes, call-gate]
|
needs: [check-changes, call-gate, sgl-kernel-build-wheels]
|
||||||
if: needs.check-changes.outputs.jit_kernel == 'true'
|
if: |
|
||||||
|
always() &&
|
||||||
|
!failure() && !cancelled() &&
|
||||||
|
github.event_name != 'schedule' &&
|
||||||
|
inputs.test_parallel_dispatch != true &&
|
||||||
|
!inputs.target_stage &&
|
||||||
|
needs.check-changes.outputs.jit_kernel == 'true'
|
||||||
uses: ./.github/workflows/pr-test-jit-kernel.yml
|
uses: ./.github/workflows/pr-test-jit-kernel.yml
|
||||||
with:
|
with:
|
||||||
jit_kernel: ${{ needs.check-changes.outputs.jit_kernel }}
|
jit_kernel: ${{ needs.check-changes.outputs.jit_kernel }}
|
||||||
|
sgl_kernel: ${{ needs.check-changes.outputs.sgl_kernel }}
|
||||||
b200_runner: ${{ needs.check-changes.outputs.b200_runner }}
|
b200_runner: ${{ needs.check-changes.outputs.b200_runner }}
|
||||||
pr_head_sha: ${{ inputs.pr_head_sha || '' }}
|
pr_head_sha: ${{ inputs.pr_head_sha || '' }}
|
||||||
git_ref: ${{ inputs.git_ref || '' }}
|
git_ref: ${{ inputs.git_ref || '' }}
|
||||||
@@ -971,7 +980,7 @@ jobs:
|
|||||||
CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh
|
CUSTOM_BUILD_SGL_KERNEL=${{needs.check-changes.outputs.sgl_kernel}} bash scripts/ci/cuda/ci_install_dependency.sh
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 40
|
||||||
env:
|
env:
|
||||||
CONTINUE_ON_ERROR_FLAG: ${{ needs.check-changes.outputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
CONTINUE_ON_ERROR_FLAG: ${{ needs.check-changes.outputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -1175,10 +1184,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SGLANG_CI_RDMA_ALL_DEVICES: "mlx5_1,mlx5_2,mlx5_3,mlx5_4"
|
SGLANG_CI_RDMA_ALL_DEVICES: "mlx5_1,mlx5_2,mlx5_3,mlx5_4"
|
||||||
CU_VERSION: cu129
|
CU_VERSION: cu129
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
part: [0, 1]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -1208,12 +1213,10 @@ jobs:
|
|||||||
CONTINUE_ON_ERROR_FLAG: ${{ needs.check-changes.outputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
CONTINUE_ON_ERROR_FLAG: ${{ needs.check-changes.outputs.continue_on_error == 'true' && '--continue-on-error' || '' }}
|
||||||
run: |
|
run: |
|
||||||
cd test
|
cd test
|
||||||
python3 run_suite.py --hw cuda --suite stage-c-test-8-gpu-h20 --auto-partition-id ${{ matrix.part }} --auto-partition-size 2 $CONTINUE_ON_ERROR_FLAG
|
python3 run_suite.py --hw cuda --suite stage-c-test-8-gpu-h20 $CONTINUE_ON_ERROR_FLAG
|
||||||
|
|
||||||
- uses: ./.github/actions/upload-cuda-coredumps
|
- uses: ./.github/actions/upload-cuda-coredumps
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
|
||||||
artifact-suffix: ${{ matrix.part }}
|
|
||||||
|
|
||||||
- name: Cleanup venv
|
- name: Cleanup venv
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ ARG GRACE_BLACKWELL_DEEPEP_BRANCH=gb200_blog_part_2
|
|||||||
ARG HOPPER_SBO_DEEPEP_COMMIT=9f2fc4b3182a51044ae7ecb6610f7c9c3258c4d6
|
ARG HOPPER_SBO_DEEPEP_COMMIT=9f2fc4b3182a51044ae7ecb6610f7c9c3258c4d6
|
||||||
ARG DEEPEP_COMMIT=9af0e0d0e74f3577af1979c9b9e1ac2cad0104ee
|
ARG DEEPEP_COMMIT=9af0e0d0e74f3577af1979c9b9e1ac2cad0104ee
|
||||||
ARG BUILD_AND_DOWNLOAD_PARALLEL=8
|
ARG BUILD_AND_DOWNLOAD_PARALLEL=8
|
||||||
ARG SGL_KERNEL_VERSION=0.4.1.post1
|
ARG SGL_KERNEL_VERSION=0.4.2
|
||||||
ARG SGL_VERSION
|
ARG SGL_VERSION
|
||||||
ARG USE_LATEST_SGLANG=0
|
ARG USE_LATEST_SGLANG=0
|
||||||
ARG GDRCOPY_VERSION=2.5.1
|
ARG GDRCOPY_VERSION=2.5.1
|
||||||
|
|||||||
+4
-21
@@ -59,15 +59,15 @@ dependencies = [
|
|||||||
"sentencepiece",
|
"sentencepiece",
|
||||||
"setproctitle",
|
"setproctitle",
|
||||||
"flash-attn-4>=4.0.0b9",
|
"flash-attn-4>=4.0.0b9",
|
||||||
"sglang-kernel==0.4.1.post1",
|
"sglang-kernel==0.4.2",
|
||||||
"soundfile==0.13.1",
|
"soundfile==0.13.1",
|
||||||
"tiktoken",
|
"tiktoken",
|
||||||
"timm==1.0.16",
|
"timm==1.0.16",
|
||||||
"torch_memory_saver>=0.0.9.post1",
|
"torch_memory_saver>=0.0.9.post1",
|
||||||
"torch==2.9.1",
|
"torch==2.11.0",
|
||||||
"torchao==0.17.0",
|
"torchao==0.17.0",
|
||||||
"torchaudio==2.9.1",
|
"torchaudio==2.11.0",
|
||||||
"torchcodec==0.9.1 ; sys_platform != 'linux' or (sys_platform == 'linux' and platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l')", # torchcodec 0.9.1 for torch 2.9.x. Not available on Linux ARM.
|
"torchcodec==0.11.1 ; sys_platform != 'linux' or (sys_platform == 'linux' and platform_machine != 'aarch64' and platform_machine != 'arm64' and platform_machine != 'armv7l')", # torchcodec 0.11.1 for torch 2.11.x (0.10 is ABI-incompatible: references the pre-2.11 c10::MessageLogger ctor signature). Not available on Linux ARM.
|
||||||
"av ; sys_platform == 'linux' and (platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'armv7l')",
|
"av ; sys_platform == 'linux' and (platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'armv7l')",
|
||||||
"torchvision",
|
"torchvision",
|
||||||
"tqdm",
|
"tqdm",
|
||||||
@@ -86,23 +86,6 @@ name = "pypi"
|
|||||||
url = "https://pypi.org/simple"
|
url = "https://pypi.org/simple"
|
||||||
default = true
|
default = true
|
||||||
|
|
||||||
[[tool.uv.index]]
|
|
||||||
name = "torch-cu130"
|
|
||||||
url = "https://download.pytorch.org/whl/cu130"
|
|
||||||
explicit = true
|
|
||||||
|
|
||||||
# To be removed after pypi sglang-kernel uses cu130
|
|
||||||
[[tool.uv.index]]
|
|
||||||
name = "sglang-kernel-cu130"
|
|
||||||
url = "https://docs.sglang.ai/whl/cu130/"
|
|
||||||
explicit = true
|
|
||||||
|
|
||||||
[tool.uv.sources]
|
|
||||||
torch = { index = "torch-cu130" }
|
|
||||||
torchvision = { index = "torch-cu130" }
|
|
||||||
torchaudio = { index = "torch-cu130" }
|
|
||||||
sglang-kernel = { index = "sglang-kernel-cu130" }
|
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
checkpoint-engine = ["checkpoint-engine==0.1.2"]
|
checkpoint-engine = ["checkpoint-engine==0.1.2"]
|
||||||
runai = ["runai-model-streamer[s3,gcs,azure]>=0.15.7"]
|
runai = ["runai-model-streamer[s3,gcs,azure]>=0.15.7"]
|
||||||
|
|||||||
@@ -134,9 +134,9 @@ diffusion_musa = [
|
|||||||
# https://docs.sglang.io/platforms/mps.md
|
# https://docs.sglang.io/platforms/mps.md
|
||||||
srt_mps = [
|
srt_mps = [
|
||||||
"sglang[runtime_common]",
|
"sglang[runtime_common]",
|
||||||
"torch==2.9.1",
|
"torch==2.11.0",
|
||||||
"torchao==0.9.0",
|
"torchao==0.9.0",
|
||||||
"torchaudio==2.9.1",
|
"torchaudio==2.11.0",
|
||||||
"torchvision",
|
"torchvision",
|
||||||
"mlx",
|
"mlx",
|
||||||
"mlx-lm",
|
"mlx-lm",
|
||||||
|
|||||||
@@ -32,6 +32,27 @@ from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
|||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def _load_auto_tokenizer_with_roberta_processing_compat(*args, **kwargs):
|
||||||
|
from tokenizers import processors
|
||||||
|
|
||||||
|
roberta_processing = processors.RobertaProcessing
|
||||||
|
|
||||||
|
def roberta_processing_compat(*processor_args, **processor_kwargs):
|
||||||
|
if "sep" in processor_kwargs and "cls" in processor_kwargs:
|
||||||
|
sep = processor_kwargs.pop("sep")
|
||||||
|
cls_token = processor_kwargs.pop("cls")
|
||||||
|
return roberta_processing(
|
||||||
|
sep, cls_token, *processor_args, **processor_kwargs
|
||||||
|
)
|
||||||
|
return roberta_processing(*processor_args, **processor_kwargs)
|
||||||
|
|
||||||
|
processors.RobertaProcessing = roberta_processing_compat
|
||||||
|
try:
|
||||||
|
return AutoTokenizer.from_pretrained(*args, **kwargs)
|
||||||
|
finally:
|
||||||
|
processors.RobertaProcessing = roberta_processing
|
||||||
|
|
||||||
|
|
||||||
class ComponentLoader(ABC):
|
class ComponentLoader(ABC):
|
||||||
"""Base class for loading a specific type of model component."""
|
"""Base class for loading a specific type of model component."""
|
||||||
|
|
||||||
@@ -343,7 +364,7 @@ class TokenizerLoader(ComponentLoader):
|
|||||||
logger.warning(
|
logger.warning(
|
||||||
"Fast tokenizer failed (%s), retrying with use_fast=False", e
|
"Fast tokenizer failed (%s), retrying with use_fast=False", e
|
||||||
)
|
)
|
||||||
return AutoTokenizer.from_pretrained(
|
return _load_auto_tokenizer_with_roberta_processing_compat(
|
||||||
component_model_path,
|
component_model_path,
|
||||||
padding_side="right",
|
padding_side="right",
|
||||||
use_fast=False,
|
use_fast=False,
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"cases": {
|
"cases": {
|
||||||
"qwen_image_t2i": {
|
"qwen_image_t2i": {
|
||||||
"clip_threshold": 0.97,
|
"clip_threshold": 0.97,
|
||||||
"ssim_threshold": 0.84,
|
"ssim_threshold": 0.83,
|
||||||
"psnr_threshold": 16.0,
|
"psnr_threshold": 16.0,
|
||||||
"mean_abs_diff_threshold": 11.5
|
"mean_abs_diff_threshold": 13.3
|
||||||
},
|
},
|
||||||
"flux_image_t2i": {
|
"flux_image_t2i": {
|
||||||
"clip_threshold": 0.92,
|
"clip_threshold": 0.92,
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
},
|
},
|
||||||
"zimage_image_t2i": {
|
"zimage_image_t2i": {
|
||||||
"clip_threshold": 0.92,
|
"clip_threshold": 0.92,
|
||||||
"ssim_threshold": 0.90,
|
"ssim_threshold": 0.86,
|
||||||
"psnr_threshold": 22.0,
|
"psnr_threshold": 19.9,
|
||||||
"mean_abs_diff_threshold": 8.0
|
"mean_abs_diff_threshold": 8.5
|
||||||
},
|
},
|
||||||
"zimage_image_t2i_multi_lora": {
|
"zimage_image_t2i_multi_lora": {
|
||||||
"clip_threshold": 0.92,
|
"clip_threshold": 0.92,
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
"flux_2_image_t2i": {
|
"flux_2_image_t2i": {
|
||||||
"clip_threshold": 0.98,
|
"clip_threshold": 0.98,
|
||||||
"ssim_threshold": 0.86,
|
"ssim_threshold": 0.86,
|
||||||
"psnr_threshold": 15.0,
|
"psnr_threshold": 14.9,
|
||||||
"mean_abs_diff_threshold": 13.0
|
"mean_abs_diff_threshold": 13.0
|
||||||
},
|
},
|
||||||
"flux_2_ti2i": {
|
"flux_2_ti2i": {
|
||||||
@@ -69,21 +69,21 @@
|
|||||||
},
|
},
|
||||||
"qwen_image_edit_2509_ti2i": {
|
"qwen_image_edit_2509_ti2i": {
|
||||||
"clip_threshold": 0.75,
|
"clip_threshold": 0.75,
|
||||||
"ssim_threshold": 0.53,
|
"ssim_threshold": 0.52,
|
||||||
"psnr_threshold": 10.5,
|
"psnr_threshold": 10.5,
|
||||||
"mean_abs_diff_threshold": 46.0
|
"mean_abs_diff_threshold": 46.5
|
||||||
},
|
},
|
||||||
"qwen_image_edit_ti2i": {
|
"qwen_image_edit_ti2i": {
|
||||||
"clip_threshold": 0.96,
|
"clip_threshold": 0.96,
|
||||||
"ssim_threshold": 0.94,
|
"ssim_threshold": 0.94,
|
||||||
"psnr_threshold": 25.5,
|
"psnr_threshold": 25.4,
|
||||||
"mean_abs_diff_threshold": 10.0
|
"mean_abs_diff_threshold": 10.0
|
||||||
},
|
},
|
||||||
"qwen_image_edit_2511_ti2i": {
|
"qwen_image_edit_2511_ti2i": {
|
||||||
"clip_threshold": 0.96,
|
"clip_threshold": 0.96,
|
||||||
"ssim_threshold": 0.95,
|
"ssim_threshold": 0.83,
|
||||||
"psnr_threshold": 26.5,
|
"psnr_threshold": 21.0,
|
||||||
"mean_abs_diff_threshold": 10.0
|
"mean_abs_diff_threshold": 16.6
|
||||||
},
|
},
|
||||||
"qwen_image_layered_i2i": {
|
"qwen_image_layered_i2i": {
|
||||||
"clip_threshold": 0.92,
|
"clip_threshold": 0.92,
|
||||||
@@ -110,10 +110,10 @@
|
|||||||
"mean_abs_diff_threshold": 59.0
|
"mean_abs_diff_threshold": 59.0
|
||||||
},
|
},
|
||||||
"ltx_2.3_two_stage_t2v_2gpus": {
|
"ltx_2.3_two_stage_t2v_2gpus": {
|
||||||
"clip_threshold": 0.80,
|
"clip_threshold": 0.79,
|
||||||
"ssim_threshold": 0.12,
|
"ssim_threshold": 0.12,
|
||||||
"psnr_threshold": 12.2,
|
"psnr_threshold": 12.1,
|
||||||
"mean_abs_diff_threshold": 50.5
|
"mean_abs_diff_threshold": 51.0
|
||||||
},
|
},
|
||||||
"wan2_1_t2v_1.3b_teacache_enabled": {
|
"wan2_1_t2v_1.3b_teacache_enabled": {
|
||||||
"clip_threshold": 0.93,
|
"clip_threshold": 0.93,
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
"36": 247.89,
|
"36": 247.89,
|
||||||
"37": 248.77,
|
"37": 248.77,
|
||||||
"38": 249.16,
|
"38": 249.16,
|
||||||
"39": 248.41,
|
"39": 250.0,
|
||||||
"40": 247.02,
|
"40": 247.02,
|
||||||
"41": 247.97,
|
"41": 247.97,
|
||||||
"42": 250.37,
|
"42": 250.37,
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
"17": 189.98,
|
"17": 189.98,
|
||||||
"18": 190.28,
|
"18": 190.28,
|
||||||
"19": 189.91,
|
"19": 189.91,
|
||||||
"20": 190.19,
|
"20": 221.0,
|
||||||
"21": 190.14,
|
"21": 190.14,
|
||||||
"22": 190.16,
|
"22": 190.16,
|
||||||
"23": 189.96,
|
"23": 189.96,
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
"26": 189.16,
|
"26": 189.16,
|
||||||
"27": 190.09,
|
"27": 190.09,
|
||||||
"28": 189.99,
|
"28": 189.99,
|
||||||
"29": 189.83,
|
"29": 203.0,
|
||||||
"30": 190.11,
|
"30": 190.11,
|
||||||
"31": 189.97,
|
"31": 189.97,
|
||||||
"32": 189.98,
|
"32": 189.98,
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
"36": 189.37,
|
"36": 189.37,
|
||||||
"37": 192.09,
|
"37": 192.09,
|
||||||
"38": 189.15,
|
"38": 189.15,
|
||||||
"39": 189.52,
|
"39": 307.1,
|
||||||
"40": 188.16,
|
"40": 188.16,
|
||||||
"41": 191.37,
|
"41": 191.37,
|
||||||
"42": 188.23,
|
"42": 188.23,
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ from sglang.multimodal_gen.test.test_utils import (
|
|||||||
gt_exists,
|
gt_exists,
|
||||||
image_bytes_to_numpy,
|
image_bytes_to_numpy,
|
||||||
load_consistency_gt,
|
load_consistency_gt,
|
||||||
|
save_consistency_failure_artifact,
|
||||||
wait_for_req_perf_record,
|
wait_for_req_perf_record,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -608,6 +609,22 @@ Repository: https://github.com/sgl-project/ci-data (path: diffusion-ci/consisten
|
|||||||
is_video=is_video,
|
is_video=is_video,
|
||||||
output_format=output_format,
|
output_format=output_format,
|
||||||
)
|
)
|
||||||
|
artifact_path = save_consistency_failure_artifact(
|
||||||
|
artifact_dir=os.environ.get("SGLANG_DIFFUSION_ARTIFACT_DIR"),
|
||||||
|
case_id=case.id,
|
||||||
|
num_gpus=num_gpus,
|
||||||
|
output_frames=output_frames,
|
||||||
|
gt_data=gt_data,
|
||||||
|
result=result,
|
||||||
|
is_video=is_video,
|
||||||
|
output_format=output_format,
|
||||||
|
gt_remote_files=gt_remote_files,
|
||||||
|
)
|
||||||
|
if artifact_path is not None:
|
||||||
|
logger.info(
|
||||||
|
"[Artifact] Saved consistency failure comparison: %s",
|
||||||
|
artifact_path,
|
||||||
|
)
|
||||||
gt_remote_info = "\n".join(
|
gt_remote_info = "\n".join(
|
||||||
f" - {filename}: {url}" for filename, url in gt_remote_files
|
f" - {filename}: {url}" for filename, url in gt_remote_files
|
||||||
)
|
)
|
||||||
@@ -707,32 +724,6 @@ Repository: https://github.com/sgl-project/ci-data (path: diffusion-ci/consisten
|
|||||||
output_path.write_bytes(content)
|
output_path.write_bytes(content)
|
||||||
logger.info(f"Saved GT image: {output_path} (format: {detected_format})")
|
logger.info(f"Saved GT image: {output_path} (format: {detected_format})")
|
||||||
|
|
||||||
def _save_diffusion_artifact(
|
|
||||||
self,
|
|
||||||
case: DiffusionTestCase,
|
|
||||||
content: bytes,
|
|
||||||
) -> None:
|
|
||||||
"""Preserve selected generated outputs for CI artifact upload."""
|
|
||||||
artifact_dir = os.environ.get("SGLANG_DIFFUSION_ARTIFACT_DIR")
|
|
||||||
if not artifact_dir or not content or "modelopt" not in case.id.lower():
|
|
||||||
return
|
|
||||||
|
|
||||||
safe_case_id = "".join(c if c.isalnum() or c in "._-" else "_" for c in case.id)
|
|
||||||
is_video = case.server_args.modality == "video"
|
|
||||||
if is_video:
|
|
||||||
filename = f"{safe_case_id}_5s.mp4"
|
|
||||||
else:
|
|
||||||
from sglang.multimodal_gen.test.test_utils import detect_image_format
|
|
||||||
|
|
||||||
suffix = case.sampling_params.output_format or detect_image_format(content)
|
|
||||||
filename = f"{safe_case_id}.{suffix}"
|
|
||||||
|
|
||||||
dst_dir = Path(artifact_dir) / safe_case_id
|
|
||||||
dst_dir.mkdir(parents=True, exist_ok=True)
|
|
||||||
dst = dst_dir / filename
|
|
||||||
dst.write_bytes(content)
|
|
||||||
logger.info("[Artifact] Preserved generated output: %s", dst)
|
|
||||||
|
|
||||||
def _test_lora_api_functionality(
|
def _test_lora_api_functionality(
|
||||||
self,
|
self,
|
||||||
ctx: ServerContext,
|
ctx: ServerContext,
|
||||||
@@ -1112,7 +1103,6 @@ Repository: https://github.com/sgl-project/ci-data (path: diffusion-ci/consisten
|
|||||||
generate_fn,
|
generate_fn,
|
||||||
collect_perf=not is_gt_gen_mode,
|
collect_perf=not is_gt_gen_mode,
|
||||||
)
|
)
|
||||||
self._save_diffusion_artifact(case, content)
|
|
||||||
|
|
||||||
if is_gt_gen_mode:
|
if is_gt_gen_mode:
|
||||||
# GT generation mode: save output and skip all validations/tests
|
# GT generation mode: save output and skip all validations/tests
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from sglang.multimodal_gen.test.test_utils import (
|
|||||||
compute_mean_abs_diff,
|
compute_mean_abs_diff,
|
||||||
compute_psnr,
|
compute_psnr,
|
||||||
compute_ssim,
|
compute_ssim,
|
||||||
|
save_consistency_failure_artifact,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -113,3 +114,50 @@ def test_compare_with_gt_uses_worst_frame_for_video(monkeypatch):
|
|||||||
or not metric.mean_abs_diff_passed
|
or not metric.mean_abs_diff_passed
|
||||||
for metric in result.frame_metrics
|
for metric in result.frame_metrics
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_save_consistency_failure_artifact(tmp_path, monkeypatch):
|
||||||
|
gt_image = _solid_image(128)
|
||||||
|
bad_image = _solid_image(0)
|
||||||
|
|
||||||
|
monkeypatch.setattr(
|
||||||
|
test_utils,
|
||||||
|
"compute_clip_embedding",
|
||||||
|
lambda image: np.array([1.0, 0.0], dtype=np.float32),
|
||||||
|
)
|
||||||
|
|
||||||
|
result = compare_with_gt(
|
||||||
|
output_frames=[bad_image],
|
||||||
|
gt_data=LoadedConsistencyGT(
|
||||||
|
images=[gt_image],
|
||||||
|
embeddings=[np.array([1.0, 0.0], dtype=np.float32)],
|
||||||
|
),
|
||||||
|
thresholds=ConsistencyThresholds(
|
||||||
|
clip_threshold=0.92,
|
||||||
|
ssim_threshold=0.95,
|
||||||
|
psnr_threshold=28.0,
|
||||||
|
mean_abs_diff_threshold=8.0,
|
||||||
|
),
|
||||||
|
case_id="unit_image_fail",
|
||||||
|
)
|
||||||
|
|
||||||
|
artifact_path = save_consistency_failure_artifact(
|
||||||
|
artifact_dir=tmp_path,
|
||||||
|
case_id="unit_image_fail",
|
||||||
|
num_gpus=1,
|
||||||
|
output_frames=[bad_image],
|
||||||
|
gt_data=LoadedConsistencyGT(
|
||||||
|
images=[gt_image],
|
||||||
|
embeddings=[np.array([1.0, 0.0], dtype=np.float32)],
|
||||||
|
),
|
||||||
|
result=result,
|
||||||
|
is_video=False,
|
||||||
|
output_format="png",
|
||||||
|
gt_remote_files=[("unit_image_fail_1gpu.png", "https://example.com/gt.png")],
|
||||||
|
)
|
||||||
|
|
||||||
|
assert artifact_path is not None
|
||||||
|
assert artifact_path.exists()
|
||||||
|
assert artifact_path.suffix == ".png"
|
||||||
|
assert (tmp_path / "consistency_failures" / "summary.json").exists()
|
||||||
|
assert (tmp_path / "consistency_failures" / "index.html").exists()
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# Copied and adapted from: https://github.com/hao-ai-lab/FastVideo
|
# Copied and adapted from: https://github.com/hao-ai-lab/FastVideo
|
||||||
import base64
|
import base64
|
||||||
|
import html
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import math
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
@@ -17,7 +19,7 @@ import cv2
|
|||||||
import httpx
|
import httpx
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import requests
|
import requests
|
||||||
from PIL import Image
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
|
|
||||||
from sglang.multimodal_gen.runtime.utils.common import get_bool_env_var
|
from sglang.multimodal_gen.runtime.utils.common import get_bool_env_var
|
||||||
from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
||||||
@@ -57,6 +59,30 @@ DEFAULT_MEAN_ABS_DIFF_THRESHOLD_VIDEO = 10.0
|
|||||||
_clip_model_cache: dict[str, Any] = {}
|
_clip_model_cache: dict[str, Any] = {}
|
||||||
_consistency_gt_cache: dict[str, Any] = {}
|
_consistency_gt_cache: dict[str, Any] = {}
|
||||||
|
|
||||||
|
|
||||||
|
def _load_clip_processor_with_roberta_processing_compat(
|
||||||
|
clip_processor_cls, *args, **kwargs
|
||||||
|
):
|
||||||
|
from tokenizers import processors
|
||||||
|
|
||||||
|
roberta_processing = processors.RobertaProcessing
|
||||||
|
|
||||||
|
def roberta_processing_compat(*processor_args, **processor_kwargs):
|
||||||
|
if "sep" in processor_kwargs and "cls" in processor_kwargs:
|
||||||
|
sep = processor_kwargs.pop("sep")
|
||||||
|
cls_token = processor_kwargs.pop("cls")
|
||||||
|
return roberta_processing(
|
||||||
|
sep, cls_token, *processor_args, **processor_kwargs
|
||||||
|
)
|
||||||
|
return roberta_processing(*processor_args, **processor_kwargs)
|
||||||
|
|
||||||
|
processors.RobertaProcessing = roberta_processing_compat
|
||||||
|
try:
|
||||||
|
return clip_processor_cls.from_pretrained(*args, **kwargs)
|
||||||
|
finally:
|
||||||
|
processors.RobertaProcessing = roberta_processing
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Common model IDs for diffusion tests
|
# Common model IDs for diffusion tests
|
||||||
#
|
#
|
||||||
@@ -746,7 +772,19 @@ def get_clip_model() -> tuple[Any, Any]:
|
|||||||
) from exc
|
) from exc
|
||||||
|
|
||||||
logger.info(f"Loading CLIP model: {CLIP_MODEL_NAME}")
|
logger.info(f"Loading CLIP model: {CLIP_MODEL_NAME}")
|
||||||
|
try:
|
||||||
processor = CLIPProcessor.from_pretrained(CLIP_MODEL_NAME)
|
processor = CLIPProcessor.from_pretrained(CLIP_MODEL_NAME)
|
||||||
|
except TypeError as e:
|
||||||
|
if "RobertaProcessing" not in str(e):
|
||||||
|
raise
|
||||||
|
logger.warning(
|
||||||
|
"Fast CLIP processor failed (%s), retrying with use_fast=False", e
|
||||||
|
)
|
||||||
|
processor = _load_clip_processor_with_roberta_processing_compat(
|
||||||
|
CLIPProcessor,
|
||||||
|
CLIP_MODEL_NAME,
|
||||||
|
use_fast=False,
|
||||||
|
)
|
||||||
model = CLIPModel.from_pretrained(CLIP_MODEL_NAME)
|
model = CLIPModel.from_pretrained(CLIP_MODEL_NAME)
|
||||||
|
|
||||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
@@ -1223,3 +1261,296 @@ def compare_with_gt(
|
|||||||
print(f"{'=' * 60}\n")
|
print(f"{'=' * 60}\n")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def _safe_artifact_name(name: str) -> str:
|
||||||
|
return "".join(c if c.isalnum() or c in "._-" else "_" for c in name)
|
||||||
|
|
||||||
|
|
||||||
|
def _format_metric_value(value: float) -> str:
|
||||||
|
if math.isinf(value):
|
||||||
|
return "inf"
|
||||||
|
if math.isnan(value):
|
||||||
|
return "nan"
|
||||||
|
return f"{value:.4f}"
|
||||||
|
|
||||||
|
|
||||||
|
def _json_metric_value(value: float) -> float | str:
|
||||||
|
if math.isinf(value) or math.isnan(value):
|
||||||
|
return _format_metric_value(value)
|
||||||
|
return round(value, 6)
|
||||||
|
|
||||||
|
|
||||||
|
def _metric_items(metric: FrameConsistencyMetrics) -> list[tuple[str, float, bool]]:
|
||||||
|
return [
|
||||||
|
("clip", metric.clip_similarity, metric.clip_passed),
|
||||||
|
("ssim", metric.ssim, metric.ssim_passed),
|
||||||
|
("psnr", metric.psnr, metric.psnr_passed),
|
||||||
|
("mean_abs_diff", metric.mean_abs_diff, metric.mean_abs_diff_passed),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def _text_width(draw: ImageDraw.ImageDraw, text: str, font: ImageFont.ImageFont) -> int:
|
||||||
|
box = draw.textbbox((0, 0), text, font=font)
|
||||||
|
return box[2] - box[0]
|
||||||
|
|
||||||
|
|
||||||
|
def _resize_for_comparison(image: np.ndarray, max_size: tuple[int, int]) -> Image.Image:
|
||||||
|
pil_image = Image.fromarray(_ensure_rgb_uint8_image(image)).copy()
|
||||||
|
pil_image.thumbnail(max_size, Image.Resampling.LANCZOS)
|
||||||
|
return pil_image
|
||||||
|
|
||||||
|
|
||||||
|
def _draw_metric_items(
|
||||||
|
draw: ImageDraw.ImageDraw,
|
||||||
|
x: int,
|
||||||
|
y: int,
|
||||||
|
metric: FrameConsistencyMetrics,
|
||||||
|
font: ImageFont.ImageFont,
|
||||||
|
) -> None:
|
||||||
|
cursor = x
|
||||||
|
for index, (name, value, passed) in enumerate(_metric_items(metric)):
|
||||||
|
text = f"{name}={_format_metric_value(value)}"
|
||||||
|
fill = (30, 110, 55) if passed else (185, 35, 35)
|
||||||
|
draw.text((cursor, y), text, fill=fill, font=font)
|
||||||
|
cursor += _text_width(draw, text, font)
|
||||||
|
if index != 3:
|
||||||
|
separator = " | "
|
||||||
|
draw.text((cursor, y), separator, fill=(95, 95, 95), font=font)
|
||||||
|
cursor += _text_width(draw, separator, font)
|
||||||
|
|
||||||
|
|
||||||
|
def _make_consistency_failure_image(
|
||||||
|
case_id: str,
|
||||||
|
num_gpus: int,
|
||||||
|
output_frames: list[np.ndarray],
|
||||||
|
gt_data: LoadedConsistencyGT,
|
||||||
|
result: ConsistencyResult,
|
||||||
|
is_video: bool,
|
||||||
|
) -> Image.Image:
|
||||||
|
font = ImageFont.load_default()
|
||||||
|
max_thumb_size = (520, 520) if len(output_frames) == 1 else (480, 320)
|
||||||
|
gt_thumbs = [
|
||||||
|
_resize_for_comparison(image, max_thumb_size) for image in gt_data.images
|
||||||
|
]
|
||||||
|
output_thumbs = [
|
||||||
|
_resize_for_comparison(image, max_thumb_size) for image in output_frames
|
||||||
|
]
|
||||||
|
thumb_width = max_thumb_size[0]
|
||||||
|
|
||||||
|
margin = 24
|
||||||
|
column_gap = 24
|
||||||
|
label_height = 42
|
||||||
|
metric_height = 30
|
||||||
|
row_gap = 18
|
||||||
|
frame_rows = []
|
||||||
|
for gt_image, output_image in zip(gt_thumbs, output_thumbs):
|
||||||
|
image_height = max(gt_image.height, output_image.height)
|
||||||
|
frame_rows.append((gt_image, output_image, image_height))
|
||||||
|
|
||||||
|
header_lines = [
|
||||||
|
f"Consistency failure: {case_id}",
|
||||||
|
f"modality={'video' if is_video else 'image'} | gpus={num_gpus} | frames={len(output_frames)}",
|
||||||
|
(
|
||||||
|
"thresholds: "
|
||||||
|
f"clip>={result.thresholds.clip_threshold} "
|
||||||
|
f"ssim>={result.thresholds.ssim_threshold} "
|
||||||
|
f"psnr>={result.thresholds.psnr_threshold} "
|
||||||
|
f"mean_abs_diff<={result.thresholds.mean_abs_diff_threshold}"
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"worst: "
|
||||||
|
f"clip={_format_metric_value(result.min_similarity)} "
|
||||||
|
f"ssim={_format_metric_value(result.min_ssim)} "
|
||||||
|
f"psnr={_format_metric_value(result.min_psnr)} "
|
||||||
|
f"mean_abs_diff={_format_metric_value(result.max_mean_abs_diff)}"
|
||||||
|
),
|
||||||
|
]
|
||||||
|
header_height = 24 + len(header_lines) * 18 + 16
|
||||||
|
width = max(960, margin * 2 + thumb_width * 2 + column_gap)
|
||||||
|
height = (
|
||||||
|
margin
|
||||||
|
+ header_height
|
||||||
|
+ sum(label_height + row[2] + metric_height for row in frame_rows)
|
||||||
|
+ row_gap * max(0, len(frame_rows) - 1)
|
||||||
|
+ margin
|
||||||
|
)
|
||||||
|
|
||||||
|
image = Image.new("RGB", (width, height), (245, 246, 248))
|
||||||
|
draw = ImageDraw.Draw(image)
|
||||||
|
|
||||||
|
y = margin
|
||||||
|
for line in header_lines:
|
||||||
|
draw.text((margin, y), line, fill=(25, 25, 25), font=font)
|
||||||
|
y += 18
|
||||||
|
y = margin + header_height
|
||||||
|
|
||||||
|
left_x = margin
|
||||||
|
right_x = margin + thumb_width + column_gap
|
||||||
|
for idx, (gt_image, output_image, image_height) in enumerate(frame_rows):
|
||||||
|
row_height = label_height + image_height + metric_height
|
||||||
|
draw.rectangle(
|
||||||
|
[margin - 8, y - 8, width - margin + 8, y + row_height + 8],
|
||||||
|
fill=(255, 255, 255),
|
||||||
|
outline=(222, 225, 230),
|
||||||
|
)
|
||||||
|
frame_label = "image" if len(frame_rows) == 1 else f"frame {idx}"
|
||||||
|
draw.text((left_x, y), f"GT {frame_label}", fill=(35, 35, 35), font=font)
|
||||||
|
draw.text(
|
||||||
|
(right_x, y), f"CI generated {frame_label}", fill=(35, 35, 35), font=font
|
||||||
|
)
|
||||||
|
|
||||||
|
image_y = y + label_height
|
||||||
|
image.paste(gt_image, (left_x + (thumb_width - gt_image.width) // 2, image_y))
|
||||||
|
image.paste(
|
||||||
|
output_image,
|
||||||
|
(right_x + (thumb_width - output_image.width) // 2, image_y),
|
||||||
|
)
|
||||||
|
|
||||||
|
metric_y = image_y + image_height + 10
|
||||||
|
_draw_metric_items(draw, left_x, metric_y, result.frame_metrics[idx], font)
|
||||||
|
y += row_height + row_gap
|
||||||
|
|
||||||
|
return image
|
||||||
|
|
||||||
|
|
||||||
|
def _consistency_failure_record(
|
||||||
|
case_id: str,
|
||||||
|
num_gpus: int,
|
||||||
|
result: ConsistencyResult,
|
||||||
|
is_video: bool,
|
||||||
|
output_format: str | None,
|
||||||
|
image_name: str,
|
||||||
|
gt_remote_files: list[tuple[str, str]] | None,
|
||||||
|
) -> dict[str, Any]:
|
||||||
|
return {
|
||||||
|
"case_id": case_id,
|
||||||
|
"num_gpus": num_gpus,
|
||||||
|
"is_video": is_video,
|
||||||
|
"output_format": output_format,
|
||||||
|
"comparison_png": image_name,
|
||||||
|
"metrics": {
|
||||||
|
"min_clip_similarity": _json_metric_value(result.min_similarity),
|
||||||
|
"min_ssim": _json_metric_value(result.min_ssim),
|
||||||
|
"min_psnr": _json_metric_value(result.min_psnr),
|
||||||
|
"max_mean_abs_diff": _json_metric_value(result.max_mean_abs_diff),
|
||||||
|
},
|
||||||
|
"thresholds": {
|
||||||
|
"clip_threshold": result.thresholds.clip_threshold,
|
||||||
|
"ssim_threshold": result.thresholds.ssim_threshold,
|
||||||
|
"psnr_threshold": result.thresholds.psnr_threshold,
|
||||||
|
"mean_abs_diff_threshold": result.thresholds.mean_abs_diff_threshold,
|
||||||
|
},
|
||||||
|
"frames": [
|
||||||
|
{
|
||||||
|
"frame_index": metric.frame_index,
|
||||||
|
"clip_similarity": _json_metric_value(metric.clip_similarity),
|
||||||
|
"ssim": _json_metric_value(metric.ssim),
|
||||||
|
"psnr": _json_metric_value(metric.psnr),
|
||||||
|
"mean_abs_diff": _json_metric_value(metric.mean_abs_diff),
|
||||||
|
"clip_passed": metric.clip_passed,
|
||||||
|
"ssim_passed": metric.ssim_passed,
|
||||||
|
"psnr_passed": metric.psnr_passed,
|
||||||
|
"mean_abs_diff_passed": metric.mean_abs_diff_passed,
|
||||||
|
}
|
||||||
|
for metric in result.frame_metrics
|
||||||
|
],
|
||||||
|
"gt_files": [
|
||||||
|
{"filename": filename, "url": url}
|
||||||
|
for filename, url in (gt_remote_files or [])
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _write_consistency_failure_index(
|
||||||
|
out_dir: Path,
|
||||||
|
records: list[dict[str, Any]],
|
||||||
|
) -> None:
|
||||||
|
sections = []
|
||||||
|
for record in sorted(records, key=lambda r: (r["case_id"], r["num_gpus"])):
|
||||||
|
case_id = html.escape(record["case_id"])
|
||||||
|
png = html.escape(record["comparison_png"])
|
||||||
|
metrics = record["metrics"]
|
||||||
|
sections.append(
|
||||||
|
"<section>"
|
||||||
|
f"<h2>{case_id} ({record['num_gpus']} GPU)</h2>"
|
||||||
|
"<p>"
|
||||||
|
f"clip={metrics['min_clip_similarity']} | "
|
||||||
|
f"ssim={metrics['min_ssim']} | "
|
||||||
|
f"psnr={metrics['min_psnr']} | "
|
||||||
|
f"mean_abs_diff={metrics['max_mean_abs_diff']}"
|
||||||
|
"</p>"
|
||||||
|
f'<img src="{png}" alt="{case_id} comparison">'
|
||||||
|
"</section>"
|
||||||
|
)
|
||||||
|
|
||||||
|
doc = (
|
||||||
|
'<!doctype html><html><head><meta charset="utf-8">'
|
||||||
|
"<title>Diffusion consistency failures</title>"
|
||||||
|
"<style>"
|
||||||
|
"body{font-family:sans-serif;margin:24px;background:#f5f6f8;color:#202124}"
|
||||||
|
"section{margin:0 0 28px;padding:16px;background:white;border:1px solid #ddd;border-radius:6px}"
|
||||||
|
"h2{font-size:18px;margin:0 0 8px}"
|
||||||
|
"p{margin:0 0 12px;color:#444}"
|
||||||
|
"img{max-width:100%;height:auto;border:1px solid #ddd}"
|
||||||
|
"</style></head><body>"
|
||||||
|
"<h1>Diffusion consistency failures</h1>" + "".join(sections) + "</body></html>"
|
||||||
|
)
|
||||||
|
(out_dir / "index.html").write_text(doc, encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
|
def save_consistency_failure_artifact(
|
||||||
|
artifact_dir: str | Path | None,
|
||||||
|
case_id: str,
|
||||||
|
num_gpus: int,
|
||||||
|
output_frames: list[np.ndarray],
|
||||||
|
gt_data: LoadedConsistencyGT,
|
||||||
|
result: ConsistencyResult,
|
||||||
|
is_video: bool,
|
||||||
|
output_format: str | None = None,
|
||||||
|
gt_remote_files: list[tuple[str, str]] | None = None,
|
||||||
|
) -> Path | None:
|
||||||
|
if not artifact_dir:
|
||||||
|
return None
|
||||||
|
|
||||||
|
out_dir = Path(artifact_dir) / "consistency_failures"
|
||||||
|
out_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
safe_case_id = _safe_artifact_name(case_id)
|
||||||
|
image_name = f"{safe_case_id}.png"
|
||||||
|
image_path = out_dir / image_name
|
||||||
|
comparison = _make_consistency_failure_image(
|
||||||
|
case_id=case_id,
|
||||||
|
num_gpus=num_gpus,
|
||||||
|
output_frames=output_frames,
|
||||||
|
gt_data=gt_data,
|
||||||
|
result=result,
|
||||||
|
is_video=is_video,
|
||||||
|
)
|
||||||
|
comparison.save(image_path)
|
||||||
|
|
||||||
|
record = _consistency_failure_record(
|
||||||
|
case_id=case_id,
|
||||||
|
num_gpus=num_gpus,
|
||||||
|
result=result,
|
||||||
|
is_video=is_video,
|
||||||
|
output_format=output_format,
|
||||||
|
image_name=image_name,
|
||||||
|
gt_remote_files=gt_remote_files,
|
||||||
|
)
|
||||||
|
case_json_path = out_dir / f"{safe_case_id}.json"
|
||||||
|
case_json_path.write_text(json.dumps(record, indent=2) + "\n", encoding="utf-8")
|
||||||
|
|
||||||
|
summary_path = out_dir / "summary.json"
|
||||||
|
records = []
|
||||||
|
if summary_path.exists():
|
||||||
|
records = json.loads(summary_path.read_text(encoding="utf-8"))
|
||||||
|
records = [
|
||||||
|
item
|
||||||
|
for item in records
|
||||||
|
if not (item.get("case_id") == case_id and item.get("num_gpus") == num_gpus)
|
||||||
|
]
|
||||||
|
records.append(record)
|
||||||
|
summary_path.write_text(json.dumps(records, indent=2) + "\n", encoding="utf-8")
|
||||||
|
_write_consistency_failure_index(out_dir, records)
|
||||||
|
return image_path
|
||||||
|
|||||||
@@ -1170,7 +1170,7 @@ def _set_envs_and_config(server_args: ServerArgs):
|
|||||||
if _is_cuda:
|
if _is_cuda:
|
||||||
assert_pkg_version(
|
assert_pkg_version(
|
||||||
"sglang-kernel",
|
"sglang-kernel",
|
||||||
"0.4.1.post1",
|
"0.4.2",
|
||||||
"Please reinstall the latest version with `pip install sglang-kernel --force-reinstall`",
|
"Please reinstall the latest version with `pip install sglang-kernel --force-reinstall`",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -600,6 +600,12 @@ class DeepseekV2MoE(nn.Module):
|
|||||||
and self.num_fused_shared_experts == 0
|
and self.num_fused_shared_experts == 0
|
||||||
and hidden_states.shape[0] > 0
|
and hidden_states.shape[0] > 0
|
||||||
and get_is_capture_mode()
|
and get_is_capture_mode()
|
||||||
|
and not (
|
||||||
|
get_global_server_args().enable_torch_compile
|
||||||
|
and hidden_states.shape[0]
|
||||||
|
<= get_global_server_args().torch_compile_max_bs
|
||||||
|
* (get_global_server_args().speculative_num_draft_tokens or 1)
|
||||||
|
)
|
||||||
):
|
):
|
||||||
return self.forward_normal_dual_stream(
|
return self.forward_normal_dual_stream(
|
||||||
hidden_states,
|
hidden_states,
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Cache and pre-install nvidia wheels that torch pins.
|
|
||||||
#
|
|
||||||
# pypi.nvidia.com returns Cache-Control: no-store, so pip re-downloads
|
|
||||||
# ~2 GB of NVIDIA wheels on every CI run. This script:
|
|
||||||
# 1. Caches cudnn + nvshmem wheels locally and pre-installs them
|
|
||||||
# 2. Points pip at a local wheel directory via PIP_FIND_LINKS so that
|
|
||||||
# all NVIDIA torch dependencies (cublas, cufft, nvrtc, etc.) are
|
|
||||||
# installed from local files instead of re-downloading.
|
|
||||||
#
|
|
||||||
# Pre-cache the wheels on the host at /opt/ci-cache/nvidia-pip-wheels/
|
|
||||||
# (mounted as /root/.cache/nvidia-pip-wheels inside containers).
|
|
||||||
# See the 5090 ops guide post-reboot checklist for how to populate this.
|
|
||||||
#
|
|
||||||
# Integrity: uses `unzip -t` to detect partial/corrupt downloads.
|
|
||||||
#
|
|
||||||
# Usage: source scripts/ci/cuda/cache_nvidia_wheels.sh
|
|
||||||
|
|
||||||
NVIDIA_WHEEL_CACHE="/root/.cache/nvidia-wheels"
|
|
||||||
NVIDIA_PIP_WHEELS="/root/.cache/nvidia-pip-wheels"
|
|
||||||
mkdir -p "$NVIDIA_WHEEL_CACHE"
|
|
||||||
|
|
||||||
for url in \
|
|
||||||
"https://pypi.nvidia.com/nvidia-cudnn-cu13/nvidia_cudnn_cu13-9.16.0.29-py3-none-manylinux_2_27_x86_64.whl" \
|
|
||||||
"https://pypi.nvidia.com/nvidia-nvshmem-cu13/nvidia_nvshmem_cu13-3.3.20-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"; do
|
|
||||||
whl="$NVIDIA_WHEEL_CACHE/$(basename "$url")"
|
|
||||||
[ -f "$whl" ] && unzip -tq "$whl" &>/dev/null || curl -fL -o "$whl" "$url"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Caller (ci_install_dependency.sh) sets $PIP_CMD/$PIP_INSTALL_SUFFIX to route
|
|
||||||
# installs into the active environment (venv or system). The `:-pip` fallback
|
|
||||||
# keeps the file runnable ad-hoc for debugging; in CI the caller always sets
|
|
||||||
# these. Silent failure here is deliberate — the pinned cudnn/nvshmem installs
|
|
||||||
# later in ci_install_dependency.sh are the source of truth; this is only a
|
|
||||||
# download optimization.
|
|
||||||
${PIP_CMD:-pip} install --no-deps "$NVIDIA_WHEEL_CACHE"/nvidia_cudnn_cu13-*.whl \
|
|
||||||
"$NVIDIA_WHEEL_CACHE"/nvidia_nvshmem_cu13-*.whl ${PIP_INSTALL_SUFFIX:-} 2>/dev/null || true
|
|
||||||
|
|
||||||
# If pre-cached NVIDIA pip wheels exist, tell pip to check there first.
|
|
||||||
# This avoids re-downloading ~2 GB of cublas/cufft/nvrtc/etc. every run
|
|
||||||
# (pypi.nvidia.com sends Cache-Control: no-store).
|
|
||||||
if [ -d "$NVIDIA_PIP_WHEELS" ] && ls "$NVIDIA_PIP_WHEELS"/*.whl &>/dev/null; then
|
|
||||||
export PIP_FIND_LINKS="${PIP_FIND_LINKS:+$PIP_FIND_LINKS }$NVIDIA_PIP_WHEELS"
|
|
||||||
fi
|
|
||||||
@@ -31,7 +31,10 @@ if [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "aarch64" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if python3 -c "import deep_ep" >/dev/null 2>&1; then
|
if [ "${FORCE_REBUILD_DEEPEP:-0}" = "1" ]; then
|
||||||
|
echo "FORCE_REBUILD_DEEPEP=1; uninstalling any cached deep_ep before rebuild."
|
||||||
|
${PIP_UNINSTALL_CMD:-pip uninstall -y} deep_ep ${PIP_UNINSTALL_SUFFIX:-} || true
|
||||||
|
elif python3 -c "import deep_ep" >/dev/null 2>&1; then
|
||||||
echo "deep_ep is already installed or importable. Skipping installation."
|
echo "deep_ep is already installed or importable. Skipping installation."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ configure_environment() {
|
|||||||
CU_STRIP="${CU_VERSION#cu}"
|
CU_STRIP="${CU_VERSION#cu}"
|
||||||
CU_MAJOR="${CU_STRIP:0:2}"
|
CU_MAJOR="${CU_STRIP:0:2}"
|
||||||
|
|
||||||
# Nvidia package versions we pin (torch ships older versions).
|
|
||||||
NVIDIA_CUDNN_VERSION="9.16.0.29"
|
|
||||||
NVIDIA_NVSHMEM_VERSION="3.4.5"
|
|
||||||
OPTIONAL_DEPS="${1:-}"
|
OPTIONAL_DEPS="${1:-}"
|
||||||
|
|
||||||
# Whether to create a uv venv (set USE_VENV=1). Default: 0.
|
# Whether to create a uv venv (set USE_VENV=1). Default: 0.
|
||||||
@@ -288,19 +285,11 @@ install_sglang_kernel() {
|
|||||||
$PIP_CMD install "torch==${TORCH_VER}" "torchaudio==${TORCHAUDIO_VER}" "torchvision==${TORCHVISION_VER}" --index-url "https://download.pytorch.org/whl/${CU_VERSION}" --force-reinstall --no-deps $PIP_INSTALL_SUFFIX
|
$PIP_CMD install "torch==${TORCH_VER}" "torchaudio==${TORCHAUDIO_VER}" "torchvision==${TORCHVISION_VER}" --index-url "https://download.pytorch.org/whl/${CU_VERSION}" --force-reinstall --no-deps $PIP_INSTALL_SUFFIX
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reinstall sglang-kernel with matching CUDA version if needed
|
# install_sglang above pulls sglang-kernel from PyPI, whose default wheel
|
||||||
SGL_KERNEL_FULL_VER=$(pip show sglang-kernel 2>/dev/null | grep "^Version:" | awk '{print $2}' || echo "")
|
# tracks one CUDA version (currently cu130). Force-reinstall from the
|
||||||
SGL_KERNEL_CUDA_VER=$(printf '%s' "$SGL_KERNEL_FULL_VER" | sed -n 's/.*+//p')
|
# CU_VERSION-matched sglang wheel index so runners on a different CUDA
|
||||||
echo "Detected sglang-kernel version: ${SGL_KERNEL_FULL_VER} (CUDA tag: ${SGL_KERNEL_CUDA_VER:-none})"
|
# (e.g. h20 / cu129) get a wheel linked against the right libnvrtc.
|
||||||
if [ -n "$SGL_KERNEL_CUDA_VER" ] && [ "$SGL_KERNEL_CUDA_VER" != "$CU_VERSION" ]; then
|
$PIP_CMD install "sglang-kernel==${SGL_KERNEL_VERSION_FROM_SRT}" --index-url "https://docs.sglang.ai/whl/${CU_VERSION}/" --force-reinstall --no-deps $PIP_INSTALL_SUFFIX
|
||||||
SGL_KERNEL_VER="${SGL_KERNEL_FULL_VER%+*}"
|
|
||||||
echo "Reinstalling sglang-kernel==${SGL_KERNEL_VER} from ${CU_VERSION} index to match torch..."
|
|
||||||
if [ "$CU_MAJOR" = "13" ]; then
|
|
||||||
$PIP_CMD install "sglang-kernel==${SGL_KERNEL_VER}" --index-url "https://docs.sglang.ai/whl/${CU_VERSION}/" --force-reinstall --no-deps $PIP_INSTALL_SUFFIX
|
|
||||||
else
|
|
||||||
$PIP_CMD install "sglang-kernel==${SGL_KERNEL_VER}" --force-reinstall --no-deps $PIP_INSTALL_SUFFIX
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
mark_step_done "${FUNCNAME[0]}"
|
mark_step_done "${FUNCNAME[0]}"
|
||||||
}
|
}
|
||||||
@@ -407,34 +396,6 @@ install_extra_deps() {
|
|||||||
mark_step_done "${FUNCNAME[0]}"
|
mark_step_done "${FUNCNAME[0]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
fix_nvidia_deps() {
|
|
||||||
if [ "$CU_MAJOR" = "13" ]; then
|
|
||||||
NVSHMEM_PKG="nvidia-nvshmem-cu13"
|
|
||||||
CUDNN_PKG="nvidia-cudnn-cu13"
|
|
||||||
else
|
|
||||||
NVSHMEM_PKG="nvidia-nvshmem-cu12"
|
|
||||||
CUDNN_PKG="nvidia-cudnn-cu12"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DeepEP depends on nvshmem 3.4.5
|
|
||||||
INSTALLED_NVSHMEM=$(pip show ${NVSHMEM_PKG} 2>/dev/null | grep "^Version:" | awk '{print $2}' || echo "")
|
|
||||||
if [ "$INSTALLED_NVSHMEM" = "$NVIDIA_NVSHMEM_VERSION" ]; then
|
|
||||||
echo "${NVSHMEM_PKG}==${NVIDIA_NVSHMEM_VERSION} already installed, skipping reinstall"
|
|
||||||
else
|
|
||||||
$PIP_CMD install ${NVSHMEM_PKG}==${NVIDIA_NVSHMEM_VERSION} $PIP_INSTALL_SUFFIX
|
|
||||||
fi
|
|
||||||
|
|
||||||
# cudnn < 9.16.0.29 causes Conv3D performance regression
|
|
||||||
INSTALLED_CUDNN=$(pip show ${CUDNN_PKG} 2>/dev/null | grep "^Version:" | awk '{print $2}' || echo "")
|
|
||||||
if [ "$INSTALLED_CUDNN" = "$NVIDIA_CUDNN_VERSION" ]; then
|
|
||||||
echo "${CUDNN_PKG}==${NVIDIA_CUDNN_VERSION} already installed, skipping reinstall"
|
|
||||||
else
|
|
||||||
$PIP_CMD install ${CUDNN_PKG}==${NVIDIA_CUDNN_VERSION} $PIP_INSTALL_SUFFIX
|
|
||||||
fi
|
|
||||||
|
|
||||||
mark_step_done "${FUNCNAME[0]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
install_test_tools() {
|
install_test_tools() {
|
||||||
# Download kernels from kernels community
|
# Download kernels from kernels community
|
||||||
kernels download python || true
|
kernels download python || true
|
||||||
@@ -506,7 +467,6 @@ main() {
|
|||||||
download_flashinfer_cache
|
download_flashinfer_cache
|
||||||
stabilize_flashinfer_jit_paths
|
stabilize_flashinfer_jit_paths
|
||||||
install_extra_deps
|
install_extra_deps
|
||||||
fix_nvidia_deps
|
|
||||||
install_test_tools
|
install_test_tools
|
||||||
prepare_runner
|
prepare_runner
|
||||||
setup_ld_library_path
|
setup_ld_library_path
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from types import SimpleNamespace
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
from sglang.test.ci.ci_register import register_cuda_ci
|
|
||||||
from sglang.test.run_eval import run_eval
|
from sglang.test.run_eval import run_eval
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_DEEPSEEK_W4AFP8_MODEL_FOR_TEST,
|
DEFAULT_DEEPSEEK_W4AFP8_MODEL_FOR_TEST,
|
||||||
@@ -19,8 +18,6 @@ from sglang.test.test_utils import (
|
|||||||
write_github_step_summary,
|
write_github_step_summary,
|
||||||
)
|
)
|
||||||
|
|
||||||
register_cuda_ci(est_time=930, suite="stage-c-test-8-gpu-h20")
|
|
||||||
|
|
||||||
|
|
||||||
class TestDeepseekV3W4afp8(CustomTestCase):
|
class TestDeepseekV3W4afp8(CustomTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
Reference in New Issue
Block a user