Skip to content

Commit

Permalink
Enable 13.3 in CI (#359)
Browse files Browse the repository at this point in the history
* Enable 13.3 in CI

* Change runner type

* Change runner type #2

* Change #3

* Change #4

* Change #5

* Change #6

* Change #7

* Change #8

* Change #9

* Change #10

* Change #11

* Change #12

* Change #13

* Change #14

* Change #15

* Change #16

* Change #17

* Change #17

* Change #18

* Change #19

* Test lintrunner

* Test lintrunner 2

* Fix lintrunner

* Test lintrunner 3

* Test lintrunner 4

* Change #10

* Additional fixes

* test 1

* Test 2

* Remove 13.1 workflow
  • Loading branch information
DenisVieriu97 committed Feb 25, 2023
1 parent 6ec14ff commit 5f928e8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ self-hosted-runner:
- windows.g5.4xlarge.nvidia.gpu
- bm-runner
- linux.rocm.gpu
- macos-lintrunner
- macos-m1-12
- macos-m1-13
- macos-12-xl
Expand Down
4 changes: 2 additions & 2 deletions .github/requirements-gha-cache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# .ci/docker/requirements-ci.txt
boto3==1.19.12
jinja2==3.0.1
lintrunner==0.9.2
ninja==1.10.0.post1
lintrunner==0.10.6
# ninja==1.10.0.post1
nvidia-ml-py==11.525.84
pyyaml==6.0
requests==2.26
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_mac-test-mps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
runs-on:
required: false
type: string
default: "macos-m1-12"
default: "macos-arm-12.5"
description: Hardware to run tests on

jobs:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
# When any other step fails, it's job will be retried once by retryBot.
jobs:
lintrunner:
runs-on: macos-m1-12
runs-on: macos-lintrunner
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@master
Expand All @@ -24,7 +24,6 @@ jobs:
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:
Expand Down Expand Up @@ -61,7 +60,7 @@ jobs:
--tags-path aten/src/ATen/native/tags.yaml \
--deprecated-functions-path "tools/autograd/deprecated.yaml"
- name: Run lintrunner on all MPS files (nonretryable)
- name: Run lintrunner on all files (nonretryable)
env:
ENV_NAME: conda-test-env-${{ github.run_id }}
PY_VERS: 3.9
Expand All @@ -70,13 +69,12 @@ jobs:
# shellcheck disable=SC1090
set -ex
set +e
if ! ${CONDA_RUN} lintrunner --force-color aten/src/ATen/native/mps/operations/* test/test_mps.py test/test_modules.py; then
if ! ${CONDA_RUN} lintrunner --force-color test/*.py aten/src/ATen/native/mps/*.h aten/src/ATen/native/mps/*.mm aten/src/ATen/native/mps/operations/*; 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
60 changes: 44 additions & 16 deletions .github/workflows/mac-mps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ on:
# push:
# tags:
# - ciflow/mps/*
# workflow_dispatch:
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' }}
cancel-in-progress: true

jobs:
macos-12-py3-arm64-build:
name: macos-12-py3-arm64
macos-py39-arm64-build:
name: macos-py39-arm64
uses: ./.github/workflows/_mac-build.yml
with:
sync-tag: macos-12-py3-arm64-build
build-environment: macos-12-py3-arm64
sync-tag: macos-py39-arm64-build
build-environment: macos-py39-arm64
xcode-version: "13.3.1"
runner-type: macos-m1-13
runner-type: macos-builder
build-generates-artifacts: true
# To match the one pre-installed in the m1 runners
python_version: 3.9.12
Expand All @@ -31,18 +31,46 @@ jobs:
MACOS_SCCACHE_S3_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }}
MACOS_SCCACHE_S3_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }}

macos-12-py3-arm64-mps-test:
name: macos-12-py3-arm64-mps
macos-py38-arm64-build:
name: macos-py38-arm64
uses: ./.github/workflows/_mac-build.yml
with:
sync-tag: macos-py38-arm64-build
build-environment: macos-py38-arm64
xcode-version: "13.3.1"
runner-type: macos-builder
build-generates-artifacts: true
# To match the one pre-installed in the m1 runners
python_version: 3.8
# We need to set the environment file here instead of trying to detect it automatically because
# MacOS arm64 is cross-compiled from x86-64. Specifically, it means that arm64 conda environment
# is needed when building PyTorch MacOS arm64 from x86-64
environment-file: .github/requirements/conda-env-macOS-ARM64
secrets:
MACOS_SCCACHE_S3_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }}
MACOS_SCCACHE_S3_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }}

macos-12_5-py3-arm64-mps-test:
name: macos-12.5-py3-arm64-mps
uses: ./.github/workflows/_mac-test-mps.yml
needs: macos-py39-arm64-build
with:
sync-tag: macos-py39-arm64-mps-test
build-environment: macos-py39-arm64
runs-on: macos-arm-12.5

macos-13_2-py3-arm64-mps-test:
name: macos-13.2-py3-arm64-mps
uses: ./.github/workflows/_mac-test-mps.yml
needs: macos-12-py3-arm64-build
needs: macos-py39-arm64-build
with:
sync-tag: macos-12-py3-arm64-mps-test
build-environment: macos-12-py3-arm64
build-environment: macos-py39-arm64
runs-on: macos-arm-13.2

macos-13-py3-arm64-mps-test:
name: macos-13-py3-arm64-mps
macos-13_3-py3-arm64-mps-test:
name: macos-13.3-py3-arm64-mps
uses: ./.github/workflows/_mac-test-mps.yml
needs: macos-12-py3-arm64-build
needs: macos-py39-arm64-build
with:
build-environment: macos-12-py3-arm64
runs-on: macos-m1-13
build-environment: macos-py39-arm64
runs-on: macos-arm-13.3
25 changes: 12 additions & 13 deletions test/test_mps_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Owner(s): ["module: mps"]

import torch
from torch.testing._internal.common_utils import TestCase, run_tests
from torch.utils._pytree import tree_map

from typing import Iterator, List
import logging
import contextlib
import itertools
Expand Down Expand Up @@ -90,14 +90,13 @@ def capture_logs():
finally:
logger.removeHandler(handler)

def tracefunc(frame, event, arg, indent=[0]):
if event == "call":
indent[0] += 2
print("-" * indent[0] + "> call function", frame.f_code.co_name)
elif event == "return":
print("<" + "-" * indent[0], "exit function", frame.f_code.co_name)
indent[0] -= 2
return tracefunc

import sys

def tracefunc(frame, event, arg, indent=None):
if indent is None:
indent = [0]
if event == "call":
indent[0] += 2
print("-" * indent[0] + "> call function", frame.f_code.co_name)
elif event == "return":
print("<" + "-" * indent[0], "exit function", frame.f_code.co_name)
indent[0] -= 2
return tracefunc

0 comments on commit 5f928e8

Please sign in to comment.