Skip to content

Commit

Permalink
Enable MPS CI runners (#252)
Browse files Browse the repository at this point in the history
* Test MPS CI runners

* Cherry pick remaining files

* Enable lintrunner:

* Change lint  runner

* Retrigger checks

* Retrigger checks #2

* Retrigger checks #3

* Retrigger checks #4

* Retrigger checks #5

* Retrigger checks #5

* Retrigger checks #7

* Retrigger checks #8

* Retrigger checks #9

* Retrigger checks #9 (change arch to arm)

* Retrigger checks #10

* Retrigger checks #11

* Retrigger checks #12

* Retrigger checks #13

* Retrigger checks #14

* Retrigger checks #14

* Retrigger checks #15

* Retrigger checks #16

* Retrigger checks #16

* Retrigger checks #17

* Retrigger checks #19

* Retrigger checks #20

* Retrigger checks #21

* Fix lintrunner

* Fix lintrunner

* Remove lint.json
  • Loading branch information
DenisVieriu97 authored and kulinseth committed Feb 22, 2023
1 parent fb0da0b commit 6fcb707
Show file tree
Hide file tree
Showing 6 changed files with 547 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_mac-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ on:

jobs:
build:
# Don't run on forked repos.
if: github.repository_owner == 'pytorch'
# # Don't run on forked repos.
# if: github.repository_owner == 'pytorch'
runs-on: ${{ inputs.runner-type }}
env:
# For sccache access (only on non-forked PRs)
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/_mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ jobs:
run: |
cat test/**/*.log || true
- name: Print remaining test logs
shell: bash
if: always()
run: |
cat test/**/*.log || true
- name: Get workflow job id
id: get-job-id
uses: ./.github/actions/get-workflow-job-id
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/check-labels.yml

This file was deleted.

69 changes: 66 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
push:
branches:
- master
- main
- release/*
- landchecks/*
workflow_dispatch:

# The names of steps that actually test the code should be suffixed with `(nonretryable)`.
Expand Down Expand Up @@ -251,6 +248,72 @@ jobs:
# All we need to see is that it passes
python3 torch/utils/collect_env.py
runs-on: macos-m1-12
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
with:
submodules: false
fetch-depth: 1

- name: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
with:
python-version: 3.9
environment-file: .github/requirements/conda-env-${{ runner.os }}-${{ runner.arch }}
# pip-requirements-file: .github/requirements/pip-requirements-${{ runner.os }}.txt

- name: Install requirements
env:
ENV_NAME: conda-test-env-${{ github.run_id }}
PY_VERS: 3.9
shell: arch -arch arm64 bash {0}
run: |
# shellcheck disable=SC1090
set -ex
${CONDA_RUN} python3 -m pip install --force-reinstall -r .github/requirements-gha-cache.txt
- name: Initialize lint dependencies
env:
ENV_NAME: conda-test-env-${{ github.run_id }}
PY_VERS: 3.9
shell: arch -arch arm64 bash {0}
run: |
# shellcheck disable=SC1090
set -ex
${CONDA_RUN} lintrunner init
- name: Do build steps necessary for linters
env:
ENV_NAME: conda-test-env-${{ github.run_id }}
PY_VERS: 3.9
shell: arch -arch arm64 bash {0}
run: |
# shellcheck disable=SC1090
set -ex
${CONDA_RUN} python3 -m tools.linter.clang_tidy.generate_build_files
${CONDA_RUN} python3 -m tools.generate_torch_version --is_debug=false
${CONDA_RUN} python3 -m tools.pyi.gen_pyi \
--native-functions-path aten/src/ATen/native/native_functions.yaml \
--tags-path aten/src/ATen/native/tags.yaml \
--deprecated-functions-path "tools/autograd/deprecated.yaml"
- name: Run lintrunner on all MPS files (nonretryable)
env:
ENV_NAME: conda-test-env-${{ github.run_id }}
PY_VERS: 3.9
shell: arch -arch arm64 bash {0}
run: |
# shellcheck disable=SC1090
set -ex
set +e
if ! ${CONDA_RUN} lintrunner --force-color aten/src/ATen/native/mps/operations/* test/test_mps.py; then
echo ""
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`.\e[0m"
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
exit 1
fi
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
11 changes: 6 additions & 5 deletions .github/workflows/mac-mps.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Mac MPS

on:
push:
tags:
- ciflow/mps/*
workflow_dispatch:
# push:
# tags:
# - ciflow/mps/*
# workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
Expand All @@ -18,7 +19,7 @@ jobs:
sync-tag: macos-12-py3-arm64-build
build-environment: macos-12-py3-arm64
xcode-version: "13.3.1"
runner-type: macos-12-xl
runner-type: macos-m1-13
build-generates-artifacts: true
# To match the one pre-installed in the m1 runners
python_version: 3.9.12
Expand Down
Loading

0 comments on commit 6fcb707

Please sign in to comment.