[Feature] Semantics support and remote atomic add #228
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: CI | |
| on: [pull_request] | |
| env: | |
| PYTHON_VERSION: '3.12' | |
| VENV_DIR: tilelang_ci | |
| jobs: | |
| format-check: | |
| runs-on: [self-hosted, nvidia, hopper] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Ensure venv (local & persistent) | |
| run: | | |
| set -e | |
| REQS_HASH=$(sha256sum requirements-test.txt 2>/dev/null | awk '{print $1}' || echo "no_requirements") | |
| MARKER="${{ runner.tool_cache }}/.venv_marker_${{ env.PYTHON_VERSION }}_${REQS_HASH:0:8}" | |
| if [[ -f "$MARKER" ]] && [[ -f "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" ]]; then | |
| echo "venv exists and hash matches – reuse it" | |
| else | |
| echo "venv stale or missing – recreating" | |
| rm -rf "${{ runner.tool_cache }}/${{ env.VENV_DIR }}" "$MARKER" | |
| python -m venv "${{ runner.tool_cache }}/${{ env.VENV_DIR }}" | |
| # shellcheck source=/dev/null | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| python -m pip install --upgrade pip --no-user | |
| [[ -f requirements-test.txt ]] && \ | |
| PIP_NO_BUILD_ISOLATION=1 pip install -r requirements-test.txt --no-user | |
| pip install flash_attn==2.5.8 --no-user --no-build-isolation | |
| touch "$MARKER" | |
| fi | |
| - name: Run format check | |
| run: | | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| if ! output=$(./format.sh 2>&1); then | |
| echo "------------------------------------" | |
| echo "message:" | |
| echo "$output" | |
| printf '%s\n' "$output" | grep "Please review and stage the changes." | |
| echo "------------------------------------" | |
| exit 1 | |
| fi | |
| - name: Commit and Push Changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "lint" | |
| build-test-nvidia: | |
| runs-on: [self-hosted, nvidia, hopper] | |
| needs: format-check | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Ensure venv (local & persistent) | |
| run: | | |
| set -e | |
| REQS_HASH=$(cat requirements-test.txt 2>/dev/null || true) | |
| MARKER="${{ runner.tool_cache }}/.venv_marker_${{ env.PYTHON_VERSION }}_${REQS_HASH:0:8}" | |
| # NOTE(wt): We disable the venv reuse for now to allow installing DeepEP | |
| # echo "venv stale or missing – recreating" | |
| rm -rf "${{ runner.tool_cache }}/${{ env.VENV_DIR }}" | |
| python -m venv "${{ runner.tool_cache }}/${{ env.VENV_DIR }}" | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| python -m pip install --upgrade pip --no-user | |
| [[ -f requirements-test.txt ]] && \ | |
| PIP_NO_BUILD_ISOLATION=1 pip install -r requirements-test.txt --no-user | |
| # flash attention usually requires no isolation build | |
| pip install flash_attn==2.5.8 --no-user --no-build-isolation | |
| - name: Install project (wheel form) | |
| run: | | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| pip install . --no-user -v | |
| bash tilelang/distributed/install_deepep.sh # Install DeepEP for testing purpose | |
| - name: Run examples | |
| run: | | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| cd examples | |
| unset PYTHONPATH | |
| # find and run distributed tests with TILELANG_USE_DISTRIBUTED=1 | |
| mapfile -t DIST_TESTS < <(find . -type f -path '*/distributed/*' -name 'test*.py' 2>/dev/null || true) | |
| if [ "${#DIST_TESTS[@]}" -gt 0 ]; then | |
| echo "Running distributed examples with TILELANG_USE_DISTRIBUTED=1:" | |
| printf '%s\n' "${DIST_TESTS[@]}" | |
| TILELANG_USE_DISTRIBUTED=1 python -m pytest -n 1 "${DIST_TESTS[@]}" -v -r fE | |
| else | |
| echo "No distributed examples found." | |
| fi | |
| # run remaining example tests (non-distributed) | |
| mapfile -t OTHER_TESTS < <(find . -type f -name 'test*.py' ! -path '*/distributed/*' | grep -vE 'sink|vs_sparse' 2>/dev/null || true) # temporarily disable problematic tests | |
| if [ "${#OTHER_TESTS[@]}" -gt 0 ]; then | |
| echo "Running non-distributed examples:" | |
| printf '%s\n' "${OTHER_TESTS[@]}" | |
| python -m pytest -n 4 "${OTHER_TESTS[@]}" -v -r fE | |
| else | |
| echo "No non-distributed example tests found." | |
| fi | |
| - name: Run tests | |
| run: | | |
| source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate" | |
| cd testing/python | |
| unset PYTHONPATH | |
| # run distributed tests first with env var | |
| mapfile -t DIST_TESTS < <(find . -type f -path '*/distributed/*' -name 'test*.py' 2>/dev/null || true) | |
| if [ "${#DIST_TESTS[@]}" -gt 0 ]; then | |
| echo "Running distributed tests with TILELANG_USE_DISTRIBUTED=1:" | |
| printf '%s\n' "${DIST_TESTS[@]}" | |
| TILELANG_USE_DISTRIBUTED=1 python -m pytest -n 1 "${DIST_TESTS[@]}" -v -r fE | |
| else | |
| echo "No distributed tests found under testing/python." | |
| fi | |
| # run remaining tests | |
| mapfile -t OTHER_TESTS < <(find . -type f -name 'test*.py' ! -path '*/distributed/*' | grep -vE 'tilelibrary_gemm|jit_gemm_ctypes' 2>/dev/null || true) # temporarily disable problematic tests | |
| if [ "${#OTHER_TESTS[@]}" -gt 0 ]; then | |
| echo "Running non-distributed tests:" | |
| printf '%s\n' "${OTHER_TESTS[@]}" | |
| python -m pytest -n 4 "${OTHER_TESTS[@]}" -v -r fE | |
| else | |
| echo "No non-distributed tests found under testing/python." | |
| fi |