Add helper functions getDefaultXLAGenerator and createXLAGenerator to XLA random number generator #13914
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: Build and test | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - r[0-9]+.[0-9]+ | |
| - r[0-9]+.[0-9]+.[0-9]+ | |
| push: | |
| branches: | |
| - master | |
| - r[0-9]+.[0-9]+ | |
| - r[0-9]+.[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 }} | |
| report-no-code-changes: | |
| needs: [check_code_changes] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Report no code changes | |
| run: | | |
| echo "No code changes were detected that require running the full test suite." | |
| if: needs.check_code_changes.outputs.has_code_changes == 'false' | |
| build-torch-xla: | |
| name: "Build PyTorch/XLA" | |
| uses: ./.github/workflows/_build_torch_xla.yml | |
| needs: [check_code_changes] | |
| with: | |
| dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm | |
| timeout-minutes: 45 # Takes ~20m as of 2025/5/30. | |
| # We should build PyTorch and PyTorch/XLA if: | |
| # 1. There are code changes. | |
| # 2. This is a `push` event to `master` or release branches. | |
| # | |
| # The reason for (2) is that `push-docs` job below is run precisely on (2) condition. | |
| # In order for it (the `push-docs` job) to be successful, it needs to install the PyTorch | |
| # and PyTorch/XLA wheels. Therefore, we need to build their wheels by running this job. | |
| has_code_changes: ${{ (needs.check_code_changes.outputs.has_code_changes == 'true' || github.event_name == 'push') && 'true' || 'false' }} | |
| 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] | |
| with: | |
| dev-image: us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/development:3.12_tpuvm | |
| timeout-minutes: 45 # Takes ~26m as of 2025/5/30. | |
| collect-coverage: false | |
| runner: linux.24xlarge | |
| 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' | |
| test-torchprime: | |
| name: "torchprime tests" | |
| uses: ./.github/workflows/_torchprime_ci.yml | |
| needs: [build-torch-xla, check_code_changes] | |
| with: | |
| timeout-minutes: 100 | |
| has_code_changes: ${{ needs.check_code_changes.outputs.has_code_changes }} | |
| if: contains(github.event.pull_request.labels.*.name, 'torchprimeci') | |
| secrets: inherit | |
| 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.12_tpuvm | |
| secrets: | |
| torchxla-bot-token: ${{ secrets.TORCH_XLA_BOT_TOKEN }} |