Skip to content

Add w8a8 quantized matmul torchxla wrapper (#9290) #12622

Add w8a8 quantized matmul torchxla wrapper (#9290)

Add w8a8 quantized matmul torchxla wrapper (#9290) #12622

name: Build and test
on:
pull_request:
branches:
- master
- r[0-9]+.[0-9]+
push:
branches:
- master
- r[0-9]+.[0-9]+
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
jobs:
check_code_changes:
name: Check Code Changes
uses: ./.github/workflows/_check_code_changes.yml
with:
event_name: ${{ github.event_name }}
# For pull_request, use PR's base and head. For push, use event's before and sha.
base_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
head_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
get-torch-commit:
needs: [check_code_changes]
runs-on: ubuntu-24.04
outputs:
torch_commit: ${{ steps.commit.outputs.torch_commit }}
steps:
- name: Get latest torch commit
id: commit
if: needs.check_code_changes.outputs.has_code_changes == 'true'
run: |
echo "torch_commit=$(git ls-remote https://github.com/pytorch/pytorch.git HEAD | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- name: Report no code changes
if: needs.check_code_changes.outputs.has_code_changes == 'false'
run: |
echo "No code changes were detected that require running the full test suite."
build-torch-xla:
name: "Build PyTorch/XLA"
uses: ./.github/workflows/_build_torch_xla.yml
needs: [check_code_changes, get-torch-commit]
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.10_tpuvm
torch-commit: ${{needs.get-torch-commit.outputs.torch_commit}}
timeout-minutes: 45 # Takes ~20m as of 2025/5/30.
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
runner: linux.24xlarge
secrets:
gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}
test-python-cpu:
name: "CPU tests"
uses: ./.github/workflows/_test.yml
needs: [build-torch-xla, check_code_changes, get-torch-commit]
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.10_tpuvm
timeout-minutes: 45 # Takes ~26m as of 2025/5/30.
collect-coverage: false
runner: linux.24xlarge
torch-commit: ${{needs.get-torch-commit.outputs.torch_commit}}
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
secrets:
gcloud-service-key: ${{ secrets.GCLOUD_SERVICE_KEY }}
test-tpu:
name: "TPU tests"
uses: ./.github/workflows/_tpu_ci.yml
needs: [build-torch-xla, check_code_changes]
with:
timeout-minutes: 75 # Takes ~40m as of 2025/5/30.
has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }}
if: github.event_name == 'push' || github.event_name == 'pull_request'
push-docs:
name: "Build docs"
uses: ./.github/workflows/_docs.yml
needs: build-torch-xla
if: github.event_name == 'push'
with:
dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.10_tpuvm
secrets:
torchxla-bot-token: ${{ secrets.TORCH_XLA_BOT_TOKEN }}