Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Create test-m1.yml #960

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/test-m1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test-M1
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main

jobs:

tests:
name: "Unit-tests on M1"
runs-on: macos12.3-m1
strategy:
matrix:
py_vers: [ "3.8"]

steps:
- name: Checkout functorch
uses: actions/checkout@v2
- name: Install PyTorch Nightly
shell: arch -arch arm64 bash {0}
env:
ENV_NAME: conda-env-${{ github.run_id }}
PY_VERS: ${{ matrix.py_vers }}
run: |
. ~/miniconda3/etc/profile.d/conda.sh
export PATH=~/miniconda3/bin:$PATH
set -ex
conda create -yp ${ENV_NAME} python=${PY_VERS}
conda run -p ${ENV_NAME} python3 -mpip install --pre torch>=1.12.0.dev torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
- name: Build Functorch and run tests
shell: arch -arch arm64 bash {0}
env:
ENV_NAME: conda-env-${{ github.run_id }}
PY_VERS: ${{ matrix.py_vers }}
run: |
. ~/miniconda3/etc/profile.d/conda.sh
set -ex

conda run -p ${ENV_NAME} python3 setup.py develop
conda run -p ${ENV_NAME} python3 -m torch.utils.collect_env
# test_functorch_lagging_op_db.py: Only run this locally because it checks
# the functorch lagging op db vs PyTorch's op db.
# EXIT_STATUS=0

export IN_CI=1
mkdir test-reports

# find test \( -name test\*.py ! -name test_functorch_lagging_op_db.py \) | xargs -I {} -n 1 python3 {} -v || EXIT_STATUS=$?

# Just check vmap, ops and other eager ops
conda run -p ${ENV_NAME} conda install pyyaml
conda run -p ${ENV_NAME} python3 -mpip install pytest numpy scipy expecttest unittest-xml-reporting networkx av
conda run -p ${ENV_NAME} --no-capture-output python3 -u -mpytest -vvv test/test_vmap.py test/test_ops.py test/test_eager_transforms.py

conda env remove -p ${ENV_NAME}
# exit $EXIT_STATUS