|
| 1 | +# Copyright 2025- FlagOS Contributors |
| 2 | +# |
| 3 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | +# of this software and associated documentation files (the "Software"), to deal |
| 5 | +# in the Software without restriction, including without limitation the rights |
| 6 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | +# copies of the Software, and to permit persons to whom the Software is |
| 8 | +# furnished to do so, subject to the following conditions: |
| 9 | +# |
| 10 | +# The above copyright notice and this permission notice shall be included in all |
| 11 | +# copies or substantial portions of the Software. |
| 12 | +# |
| 13 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 | +# SOFTWARE. |
| 20 | + |
| 21 | +name: Mthreads3.6-Qwen-Benchmark |
| 22 | + |
| 23 | +on: |
| 24 | + push: |
| 25 | + branches: [ "main", "triton_v3.6.x" ] |
| 26 | + pull_request: |
| 27 | + branches: [ "main", "triton_v3.6.x" ] |
| 28 | + types: [opened, synchronize, reopened, ready_for_review] |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read |
| 32 | + pull-requests: read |
| 33 | + |
| 34 | +concurrency: |
| 35 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 36 | + cancel-in-progress: true |
| 37 | + |
| 38 | +jobs: |
| 39 | + mthreads36x-qwen: |
| 40 | + runs-on: mthreads3.6-qwen |
| 41 | + if: ${{ github.repository == 'flagos-ai/flagtree' && github.event.pull_request.draft == false }} |
| 42 | + steps: |
| 43 | + - name: Setup environment |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + source ~/env.sh |
| 47 | + env | grep -E '^(http_proxy|https_proxy|all_proxy|no_proxy)=' >> $GITHUB_ENV || true |
| 48 | +
|
| 49 | + - name: Smart Checkout |
| 50 | + uses: flagos-ai/FlagTree/.github/actions/smart-checkout@main |
| 51 | + with: |
| 52 | + checkout_version: 'v6' |
| 53 | + |
| 54 | + - name: Check if backend-relevant files changed |
| 55 | + id: check_backend |
| 56 | + uses: flagos-ai/FlagTree/.github/actions/check-backend-changed@main |
| 57 | + with: |
| 58 | + backend: mthreads |
| 59 | + |
| 60 | + - name: Cleanup FlagTree Environment |
| 61 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 62 | + uses: flagos-ai/FlagTree/.github/actions/cleanup-flagtree-env@main |
| 63 | + |
| 64 | + - name: Build FlagTree |
| 65 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 66 | + shell: bash |
| 67 | + run: | |
| 68 | + set -x |
| 69 | + export FLAGTREE_BACKEND=mthreads |
| 70 | + MAX_JOBS=32 python3 -m pip install . --no-build-isolation -v |
| 71 | +
|
| 72 | + - name: Clear cache if ClearCache label present |
| 73 | + if: steps.check_backend.outputs.should_skip != 'true' |
| 74 | + id: clear_cache |
| 75 | + uses: flagos-ai/FlagTree/.github/actions/clear-cache-if-labeled@main |
| 76 | + with: |
| 77 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + backend: mthreads-qwen3.6 |
| 79 | + |
| 80 | + - name: Start the service |
| 81 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 82 | + shell: bash |
| 83 | + run: | |
| 84 | + export BENCH_SCRIPT_DIR="${PWD}/.github/workflows/benchmark/mthreads/mthreads3.6-qwen3.6" |
| 85 | + env | grep -E '^(BENCH_SCRIPT_DIR)=' >> $GITHUB_ENV || true |
| 86 | + cd ~/flagrelease/qwen3.6 |
| 87 | + bash ${BENCH_SCRIPT_DIR}/start.sh |
| 88 | +
|
| 89 | + - name: Show the baseline |
| 90 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 91 | + shell: bash |
| 92 | + run: | |
| 93 | + cd ~/flagrelease/qwen3.6 |
| 94 | + cat ${BENCH_SCRIPT_DIR}/ref.txt |
| 95 | +
|
| 96 | + - name: Run the benchmark |
| 97 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 98 | + shell: bash |
| 99 | + run: | |
| 100 | + set -x |
| 101 | + cd ~/flagrelease/qwen3.6 |
| 102 | + bash ${BENCH_SCRIPT_DIR}/perf.sh |
| 103 | +
|
| 104 | + - name: Stop the service |
| 105 | + if: ${{ steps.check_backend.outputs.should_skip != 'true' }} |
| 106 | + shell: bash |
| 107 | + run: | |
| 108 | + cd ~/flagrelease/qwen3.6 |
| 109 | + bash ${BENCH_SCRIPT_DIR}/stop.sh |
0 commit comments