Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/pr-test-xpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
permissions: write-all
runs-on: sglang-bmg
env:
CI_CONTAINER_NAME: ci_sglang_xpu_${{ github.run_id }}_${{ github.run_attempt }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -34,28 +36,28 @@ jobs:
run: |
docker run -dt \
--device /dev/dri/ \
--name ci_sglang_xpu \
--name "${CI_CONTAINER_NAME}" \
-e HF_TOKEN=$(cat ~/huggingface_token.txt) \
xpu_sglang:kernel

- name: Install Dependency
timeout-minutes: 20
run: |
docker exec ci_sglang_xpu /miniforge3/envs/py3.10/bin/python3 -m pip install --upgrade pip
docker exec ci_sglang_xpu /miniforge3/envs/py3.10/bin/python3 -m pip install pytest expecttest ray huggingface_hub
docker exec ci_sglang_xpu /bin/bash -c '/miniforge3/envs/py3.10/bin/hf auth login --token ${HF_TOKEN} '
docker exec ci_sglang_xpu /bin/bash -c "ln -sf /miniforge3/envs/py3.10/bin/python3 /usr/bin/python3"
docker exec "${CI_CONTAINER_NAME}" /miniforge3/envs/py3.10/bin/python3 -m pip install --upgrade pip
docker exec "${CI_CONTAINER_NAME}" /miniforge3/envs/py3.10/bin/python3 -m pip install pytest expecttest ray huggingface_hub
docker exec "${CI_CONTAINER_NAME}" /bin/bash -c '/miniforge3/envs/py3.10/bin/hf auth login --token ${HF_TOKEN} '
docker exec "${CI_CONTAINER_NAME}" /bin/bash -c "ln -sf /miniforge3/envs/py3.10/bin/python3 /usr/bin/python3"

- name: Run Sglang Kernel Cases
timeout-minutes: 30
run: |
docker exec -w /root/sglang ci_sglang_xpu \
docker exec -w /root/sglang "${CI_CONTAINER_NAME}" \
/bin/bash -c "cd /root/sglang/sgl-kernel-xpu/tests && python3 run_suite.py --suite per-commit "

- name: Run Sglang Kernel Benchmarks
timeout-minutes: 30
run: |
docker exec -w /root/sglang ci_sglang_xpu \
docker exec -w /root/sglang "${CI_CONTAINER_NAME}" \
/bin/bash -c "\
/miniforge3/envs/py3.10/bin/python3 -m pip install tabulate && \
cd /root/sglang/sgl-kernel-xpu/benchmark && \
Expand Down Expand Up @@ -85,8 +87,8 @@ jobs:
- name: Copy logs from container
timeout-minutes: 20
run: |
docker cp ci_sglang_xpu:/root/sglang/sgl-kernel-xpu/benchmark/fused_moe.log ./fused_moe.log
docker cp ci_sglang_xpu:/root/sglang/sgl-kernel-xpu/benchmark/flash.log ./flash.log
docker cp "${CI_CONTAINER_NAME}":/root/sglang/sgl-kernel-xpu/benchmark/fused_moe.log ./fused_moe.log
docker cp "${CI_CONTAINER_NAME}":/root/sglang/sgl-kernel-xpu/benchmark/flash.log ./flash.log
python3 benchmark/update_baseline_from_log.py

- name: Install GitHub CLI
Expand Down Expand Up @@ -177,4 +179,4 @@ jobs:
- name: Cleanup container
if: always()
run: |
docker rm -f ci_sglang_xpu || true
docker rm -f "${CI_CONTAINER_NAME}" || true