Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
146 changes: 73 additions & 73 deletions .github/workflows/pr-test-xpu.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
name: PR Test (XPU)
on:
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: pr-test-xpu-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: sglang-pvc
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: |
docker build \
--build-arg SG_LANG_KERNEL_BRANCH=${{ github.head_ref }} \
--build-arg SG_LANG_KERNEL_REPO=${{ github.event.pull_request.head.repo.clone_url }} \
--no-cache --progress=plain -f Dockerfile.xpu_kernel -t xpu_sglang:kernel .
- name: Run container
run: |
docker run -dt \
--device /dev/dri/ \
--name ci_sglang_xpu \
-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/huggingface-cli login --token ${HF_TOKEN} '
docker exec ci_sglang_xpu /bin/bash -c "ln -sf /miniforge3/envs/py3.10/bin/python3 /usr/bin/python3"
- name: Run Sglang Kernel Cases
timeout-minutes: 20
run: |
docker exec -w /root/sglang ci_sglang_xpu \
/bin/bash -c "cd /root/sglang/sgl-kernel-xpu/tests && python3 run_suite.py --suite per-commit "
- name: Run Sglang Kernel Benchmarks
timeout-minutes: 20
run: |
docker exec -w /root/sglang ci_sglang_xpu \
/bin/bash -c "cd /root/sglang/sgl-kernel-xpu/benchmark && python3 bench_flash_attn.py && python3 bench_moe_topk_softmax.py "
- name: Run E2E Bfloat16 tests
timeout-minutes: 20
run: |
echo "[PlaceHolder for E2E Test...]"
- name: Run E2E Qunatization tests
timeout-minutes: 20
run: |
echo "[PlaceHolder for E2E Test...]"
- name: Cleanup container
if: always()
run: |
docker rm -f ci_sglang_xpu || true
name: PR Test (XPU)

on:
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: pr-test-xpu-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
runs-on: sglang-pvc
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker build \
--build-arg SG_LANG_KERNEL_BRANCH=${{ github.head_ref }} \
--build-arg SG_LANG_KERNEL_REPO=${{ github.event.pull_request.head.repo.clone_url }} \
--no-cache --progress=plain -f Dockerfile.xpu_kernel -t xpu_sglang:kernel .

- name: Run container
run: |
docker run -dt \
--device /dev/dri/ \
--name ci_sglang_xpu \
-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/huggingface-cli login --token ${HF_TOKEN} '
docker exec ci_sglang_xpu /bin/bash -c "ln -sf /miniforge3/envs/py3.10/bin/python3 /usr/bin/python3"

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

- name: Run Sglang Kernel Benchmarks
timeout-minutes: 20
run: |
docker exec -w /root/sglang ci_sglang_xpu \
/bin/bash -c "cd /root/sglang/sgl-kernel-xpu/benchmark && python3 bench_flash_attn.py && python3 bench_moe_topk_softmax.py && python3 bench_fused_moe.py "

- name: Run E2E Bfloat16 tests
timeout-minutes: 20
run: |
echo "[PlaceHolder for E2E Test...]"

- name: Run E2E Qunatization tests
timeout-minutes: 20
run: |
echo "[PlaceHolder for E2E Test...]"

- name: Cleanup container
if: always()
run: |
docker rm -f ci_sglang_xpu || true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@
*.pyo

build

# vscode
.vscode/
Loading
Loading