|
| 1 | +name: Sglang Downstream Test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] # Triggers on PRs targeting `main` |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + sglang: |
| 15 | + name: sglang integration |
| 16 | + runs-on: mi300x-1gpu |
| 17 | + env: |
| 18 | + SGL_BRANCH: v0.4.10 |
| 19 | + GPU_ARCH: gfx942 |
| 20 | + HF_TOKEN: ${{ secrets.HF_TOKEN_TEST }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout aiter repo |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Clone sglang repo |
| 27 | + run: | |
| 28 | + git clone https://github.com/sgl-project/sglang.git |
| 29 | +
|
| 30 | + # TODO: Currently, we use PAT, it should be replaced by repo token |
| 31 | + - name: Make authenticated API request |
| 32 | + run: | |
| 33 | + curl -sSfL https://api.github.com/repos/casey/just/releases/latest |
| 34 | + |
| 35 | + - name: Workaround to change the connection of unbuntu from http to https |
| 36 | + run: | |
| 37 | + cd sglang |
| 38 | + sed -i "79iRUN sed -i 's|http://|https://|g' /etc/apt/sources.list.d/* && sed -i 's|http://|https://|g' /etc/apt/sources.list && apt update -o Acquire::https::Verify-Peer=false && apt install -o Acquire::https::Verify-Peer=false ca-certificates -y && echo 'Acquire::https::Verify-Peer \"false\";' > /etc/apt/apt.conf.d/99insecure" docker/Dockerfile.rocm |
| 39 | +
|
| 40 | + - name: Build sglang_aiter_test image |
| 41 | + run: | |
| 42 | + cd sglang |
| 43 | + sed -i '/ENV AITER_COMMIT="v0.1.4"/c\ARG AITER_COMMIT="v0.1.4"\nENV AITER_COMMIT=${AITER_COMMIT}' docker/Dockerfile.rocm |
| 44 | + docker build --no-cache \ |
| 45 | + --build-arg SGL_BRANCH=${SGL_BRANCH} \ |
| 46 | + --build-arg GPU_ARCH=${GPU_ARCH} \ |
| 47 | + --build-arg AITER_REPO=${GITHUB_REPO_URL} \ |
| 48 | + --build-arg AITER_COMMIT=${GITHUB_COMMIT_SHA} \ |
| 49 | + -t sglang_aiter_test:ci -f docker/Dockerfile.rocm . |
| 50 | + env: |
| 51 | + GITHUB_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url || 'https://github.com/ROCm/aiter.git' }} |
| 52 | + GITHUB_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.event.head_commit.id }} |
| 53 | + |
| 54 | + - name: Start CI container |
| 55 | + run: | |
| 56 | + echo "Clean up containers..." |
| 57 | + docker ps -aq -f name=sglang_aiter_test | xargs -r docker stop | xargs -r docker rm |
| 58 | +
|
| 59 | + if [ -f "/etc/podinfo/gha-render-devices" ]; then |
| 60 | + DEVICE_FLAG=$(cat /etc/podinfo/gha-render-devices) |
| 61 | + else |
| 62 | + DEVICE_FLAG="--device /dev/dri" |
| 63 | + fi |
| 64 | +
|
| 65 | + echo "Starting container: sglang_aiter_test:ci" |
| 66 | + docker run -dt --user root --device=/dev/kfd $DEVICE_FLAG \ |
| 67 | + -v "${GITHUB_WORKSPACE:-$PWD}/sglang:/sglang-checkout" \ |
| 68 | + --ipc=host --group-add video \ |
| 69 | + --shm-size 32g \ |
| 70 | + --cap-add=SYS_PTRACE \ |
| 71 | + -e HF_TOKEN="${HF_TOKEN:-}" \ |
| 72 | + --security-opt seccomp=unconfined \ |
| 73 | + -w /sglang-checkout \ |
| 74 | + --name sglang_aiter_test \ |
| 75 | + sglang_aiter_test:ci |
| 76 | + env: |
| 77 | + GITHUB_WORKSPACE: ${{ github.workspace }} |
| 78 | + |
| 79 | + - name: Install wget |
| 80 | + run: sudo apt-get update && sudo apt-get install -y wget |
| 81 | + |
| 82 | + - name: Install dependencies |
| 83 | + run: | |
| 84 | + cd sglang |
| 85 | + sed -i 's/ci_sglang/sglang_aiter_test/g' scripts/ci/amd_ci_install_dependency.sh |
| 86 | + bash scripts/ci/amd_ci_install_dependency.sh |
| 87 | +
|
| 88 | + - name: Evaluate Accuracy |
| 89 | + timeout-minutes: 60 |
| 90 | + run: | |
| 91 | + cd sglang |
| 92 | + sed -i 's/ci_sglang/sglang_aiter_test/g' scripts/ci/amd_ci_exec.sh |
| 93 | + bash scripts/ci/amd_ci_exec.sh pip show aiter || true |
| 94 | + bash scripts/ci/amd_ci_exec.sh -e SGLANG_USE_AITER=0 python3 test_eval_accuracy_large.py |
| 95 | + bash scripts/ci/amd_ci_exec.sh python3 test_eval_fp8_accuracy.py |
| 96 | + bash scripts/ci/amd_ci_exec.sh python3 models/test_qwen_models.py |
| 97 | +
|
| 98 | + # TODO: Clean up because some dependencies are installed under root user which can't be removed by runner, these dependencies should be installed as a non-root user |
| 99 | + - name: Clean Up |
| 100 | + if: always() |
| 101 | + run: |
| 102 | + docker exec -u root sglang_aiter_test bash -c "rm -rf /sglang-checkout/sgl-kernel; rm -rf /sglang-checkout/python" |
0 commit comments