|
| 1 | +name: Hopper-Build-And-Test |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 21 * * *' |
| 6 | + push: |
| 7 | + branches: [ "triton_v3.4.x", "triton_v3.5.x" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "triton_v3.4.x", "triton_v3.5.x" ] |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + hopper-build-and-test: |
| 17 | + runs-on: hopper |
| 18 | + if: ${{ github.repository == 'FlagTree/flagtree' || github.repository == 'flagos-ai/flagtree' }} |
| 19 | + steps: |
| 20 | + - name: Setup environment |
| 21 | + shell: bash |
| 22 | + run: | |
| 23 | + source ~/env.sh |
| 24 | + env | grep -E '^(http_proxy|https_proxy|all_proxy|no_proxy)=' >> $GITHUB_ENV || true |
| 25 | +
|
| 26 | + - name: Checkout code (attempt 1) |
| 27 | + id: checkout1 |
| 28 | + uses: actions/checkout@v6 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + continue-on-error: true |
| 32 | + |
| 33 | + - name: Sleep before checkout2 |
| 34 | + if: steps.checkout1.outcome == 'failure' |
| 35 | + run: | |
| 36 | + echo "First checkout attempt failed. Sleeping for 120 seconds before retry..." |
| 37 | + sleep 120 |
| 38 | +
|
| 39 | + - name: Checkout code (attempt 2) |
| 40 | + id: checkout2 |
| 41 | + if: steps.checkout1.outcome == 'failure' |
| 42 | + uses: actions/checkout@v6 |
| 43 | + with: |
| 44 | + fetch-depth: 0 |
| 45 | + continue-on-error: true |
| 46 | + |
| 47 | + - name: Sleep before final checkout |
| 48 | + if: steps.checkout1.outcome == 'failure' && steps.checkout2.outcome == 'failure' |
| 49 | + run: | |
| 50 | + echo "Second checkout attempt failed. Sleeping for 180 seconds before final retry..." |
| 51 | + sleep 180 |
| 52 | +
|
| 53 | + - name: Checkout code (final attempt) |
| 54 | + if: steps.checkout1.outcome == 'failure' && steps.checkout2.outcome == 'failure' |
| 55 | + uses: actions/checkout@v6 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + |
| 59 | + - name: Verify checkout success |
| 60 | + if: success() |
| 61 | + run: echo "Checkout completed successfully" |
| 62 | + |
| 63 | + - name: Check if only docs files changed |
| 64 | + id: check_files |
| 65 | + uses: ./.github/actions/check-docs-only |
| 66 | + |
| 67 | + - name: Detect Target Branch |
| 68 | + shell: bash |
| 69 | + run: | |
| 70 | + set -x |
| 71 | + if [ "${{ github.event_name }}" = "pull_request" ]; then |
| 72 | + TARGET_BRANCH="${{ github.base_ref }}" |
| 73 | + else |
| 74 | + TARGET_BRANCH="${{ github.ref_name }}" |
| 75 | + fi |
| 76 | + echo "TARGET_BRANCH=$TARGET_BRANCH" >> $GITHUB_ENV |
| 77 | + echo "TARGET_BRANCH=$TARGET_BRANCH" |
| 78 | +
|
| 79 | + - name: FlagTree Build on NVidia (triton_v3.4.x branch) |
| 80 | + if: ${{ steps.check_files.outputs.only_docs_changed != 'true' && env.TARGET_BRANCH == 'triton_v3.4.x' }} |
| 81 | + shell: bash |
| 82 | + run: | |
| 83 | + set -x |
| 84 | + pip uninstall -y triton |
| 85 | + source ~/env-3.4.sh |
| 86 | + MAX_JOBS=32 python3 -m pip install . --no-build-isolation |
| 87 | +
|
| 88 | + - name: FlagTree Build on NVidia (triton_v3.5.x branch) |
| 89 | + if: ${{ steps.check_files.outputs.only_docs_changed != 'true' && env.TARGET_BRANCH == 'triton_v3.5.x' }} |
| 90 | + shell: bash |
| 91 | + run: | |
| 92 | + set -x |
| 93 | + pip uninstall -y triton |
| 94 | + source ~/env-3.5.sh |
| 95 | + MAX_JOBS=32 python3 -m pip install . --no-build-isolation |
| 96 | +
|
| 97 | + - name: FlagTree Test on NVidia (triton_v3.4.x branch) |
| 98 | + if: ${{ steps.check_files.outputs.only_docs_changed != 'true' && env.TARGET_BRANCH == 'triton_v3.4.x' }} |
| 99 | + shell: bash |
| 100 | + run: | |
| 101 | + set -x |
| 102 | + # python unit test |
| 103 | + python3 -m pytest -s python/test/unit/cuda |
| 104 | + python3 -m pytest -s python/test/unit/instrumentation |
| 105 | + python3 -m pytest -s python/test/unit/language \ |
| 106 | + --ignore=python/test/unit/language/test_line_info.py |
| 107 | + python3 -m pytest -s python/test/unit/runtime |
| 108 | + if [ -d "python/test/operators" ]; then |
| 109 | + python3 -m pytest -s python/test/operators |
| 110 | + fi |
| 111 | +
|
| 112 | + - name: FlagTree Test on NVidia (triton_v3.5.x branch) |
| 113 | + if: ${{ steps.check_files.outputs.only_docs_changed != 'true' && env.TARGET_BRANCH == 'triton_v3.5.x' }} |
| 114 | + shell: bash |
| 115 | + run: | |
| 116 | + set -x |
| 117 | + source ~/env.sh |
| 118 | + # python tutorials |
| 119 | + python3 python/tutorials/01-vector-add.py --only_unit_test |
| 120 | + python3 python/tutorials/02-fused-softmax.py --only_unit_test |
| 121 | + python3 python/tutorials/03-matrix-multiplication.py --only_unit_test |
| 122 | + python3 python/tutorials/04-low-memory-dropout.py --only_unit_test |
| 123 | + python3 python/tutorials/05-layer-norm.py --only_unit_test |
| 124 | + python3 python/tutorials/06-fused-attention.py --only_unit_test |
| 125 | + python3 python/tutorials/07-extern-functions.py --only_unit_test |
| 126 | + python3 python/tutorials/08-grouped-gemm.py --only_unit_test |
| 127 | + python3 python/tutorials/09-persistent-matmul.py --only_unit_test |
| 128 | + python3 python/tutorials/11-programmatic-dependent-launch.py --only_unit_test |
| 129 | + # python unit test |
| 130 | + python3 -m pytest -s python/test/unit/cuda |
| 131 | + python3 -m pytest -s python/test/unit/instrumentation |
| 132 | + python3 -m pytest -s python/test/unit/language \ |
| 133 | + --ignore=python/test/unit/language/test_line_info.py |
| 134 | + python3 -m pytest -s python/test/unit/runtime |
| 135 | + if [ -d "python/test/operators" ]; then |
| 136 | + python3 -m pytest -s python/test/operators |
| 137 | + fi |
| 138 | + # flagtree tle |
| 139 | + # python tutorials |
| 140 | + python3 python/tutorials/tle/01-sparse-mla.py |
| 141 | + # python unit test |
| 142 | + python3 -m pytest -s python/test/tle/integration |
| 143 | + python3 -m pytest -s python/test/tle/unit |
| 144 | + # flagtree hints |
| 145 | + # python tutorials |
| 146 | + python3 python/tutorials/hints/01/01-vector-add.py --only_unit_test |
| 147 | + # python3 python/tutorials/hints/02/02-fused-softmax.py --only_unit_test |
| 148 | + python3 python/tutorials/hints/03/03-matrix-multiplication.py --only_unit_test |
| 149 | + python3 python/tutorials/hints/04/04-low-memory-dropout.py --only_unit_test |
| 150 | + python3 python/tutorials/hints/05/05-layer-norm.py --only_unit_test |
| 151 | + python3 python/tutorials/hints/06/06-fused-attention.py --only_unit_test |
| 152 | + python3 python/tutorials/hints/07/07-extern-functions.py --only_unit_test |
| 153 | + python3 python/tutorials/hints/08/08-grouped-gemm.py --only_unit_test |
| 154 | + python3 python/tutorials/hints/11/11-programmatic-dependent-launch.py --only_unit_test |
| 155 | + # flagtree tle raw |
| 156 | + # python3 python/tutorials/tle/raw/01-vector-add.py |
| 157 | + # python3 python/tutorials/tle/raw/02-fused-softmax.py |
| 158 | + # python3 python/tutorials/tle/raw/03-matrix-multiplication.py |
0 commit comments