feat(test): Add TPOT metric calculation and update test configuration #1203
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Pull Request Gate' | |
| on: | |
| pull_request: | |
| branches: [ "dev*", "main", "*release", "feature*" ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| pre-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: fetch_base_and_pr_branches | |
| env: | |
| HEAD_REF: ${{ github.event.pull_request.head.ref }} | |
| run: | | |
| git fetch origin ${{ github.base_ref }} | |
| if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then | |
| echo "PR is from a fork, adding remote." | |
| git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} | |
| git fetch fork $HEAD_REF | |
| HEAD_BRANCH_NAME=fork/$HEAD_REF | |
| echo "HEAD_BRANCH_NAME=$HEAD_BRANCH_NAME" >> $GITHUB_OUTPUT | |
| else | |
| git fetch origin $HEAD_REF | |
| HEAD_BRANCH_NAME=origin/$HEAD_REF | |
| echo "HEAD_BRANCH_NAME=$HEAD_BRANCH_NAME" >> $GITHUB_OUTPUT | |
| fi | |
| # protect the workflows dir, only allow specific users to modify | |
| - id: permission-check | |
| env: | |
| ACTOR: ${{ github.actor }} | |
| run: | | |
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...${{ steps.fetch_base_and_pr_branches.outputs.HEAD_BRANCH_NAME }}) | |
| echo "CHANGED_FILES=$CHANGED_FILES" | |
| if ! echo "$CHANGED_FILES" | grep -q '^\.github/workflows/'; then | |
| echo "No .github/workflows changes, allow." | |
| exit 0 | |
| fi | |
| ALLOWED_USERS=("dante159753" "mag1c-h" "yuanzhg078") | |
| echo ".github changes detected, check if user is allowed..." | |
| ACTOR="${{ github.actor }}" | |
| echo "PR author: $ACTOR" | |
| for u in "${ALLOWED_USERS[@]}"; do | |
| if [[ "$ACTOR" == "$u" ]]; then | |
| echo "Authorized user, allowing change." | |
| exit 0 | |
| fi | |
| done | |
| echo "::error:: Only privileged users may modify .github/workflows/" | |
| exit 1 | |
| - id: uptodate-check | |
| run: | | |
| if git merge-base --is-ancestor "origin/${{ github.base_ref }}" "${{ steps.fetch_base_and_pr_branches.outputs.HEAD_BRANCH_NAME }}"; then | |
| echo "PR branch is up-to-date with target branch, continue workflow." | |
| else | |
| echo "::error::PR branch is OUT-OF-DATE with target branch, stop workflow, please update your branch and try again." | |
| exit 1 | |
| fi | |
| lint-and-unit-tests: | |
| needs: pre-check | |
| uses: ./.github/workflows/lint-and-test.yml | |
| test-build-vllm-ascend: | |
| timeout-minutes: 25 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.ucm-vllm-ascend.a2-v0.17.0 | |
| build-args: | | |
| PIP_INDEX_URL=https://pypi.org/simple | |
| tags: ucm-npu:latest | |
| push: false | |
| load: false | |
| cache-from: type=gha,scope=npu | |
| cache-to: type=gha,mode=max,scope=npu | |
| test-build-vllm-ascend-sparse: | |
| timeout-minutes: 25 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.ucm-vllm-ascend.a2-v0.11.0 | |
| build-args: | | |
| PIP_INDEX_URL=https://pypi.org/simple | |
| tags: ucm-npu-sparse:latest | |
| push: false | |
| load: false | |
| cache-from: type=gha,scope=npu | |
| cache-to: type=gha,mode=max,scope=npu | |
| test-build-sglang: | |
| timeout-minutes: 25 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.ucm-sglang-cuda-v0.5.5 | |
| build-args: | | |
| PIP_INDEX_URL=https://pypi.org/simple | |
| tags: ucm-sglang:latest | |
| push: false | |
| load: false | |
| cache-from: type=gha,scope=gpu | |
| cache-to: type=gha,mode=max,scope=gpu | |
| test-build-mindie: | |
| timeout-minutes: 25 | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile.ucm-mindie-ascend.a2-v2 | |
| build-args: | | |
| PIP_INDEX_URL=https://pypi.org/simple | |
| tags: ucm-mindie:latest | |
| push: false | |
| load: false | |
| cache-from: type=gha,scope=npu | |
| cache-to: type=gha,mode=max,scope=npu |