Skip to content

Commit 30e9c20

Browse files
authored
[release] Set up CI for release/0.2 (#830)
Test Plan: - wait for CI
1 parent 4f69429 commit 30e9c20

File tree

6 files changed

+128
-64
lines changed

6 files changed

+128
-64
lines changed

.circleci/unittest/linux/scripts/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ gcc --version
5252
# expecttest isn't on conda so it can't be a part of environment.yml :/
5353
pip install expecttest
5454

55+
# TODO: also install torchvision when they have RC binaries.
5556
if [ "${CU_VERSION:-}" == cpu ] ; then
5657
# conda install -y pytorch torchvision cpuonly -c pytorch-nightly
5758
# use pip to install pytorch as conda can frequently pick older release
58-
pip install torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre
59+
pip install torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html --pre
5960
PYTORCH_VERSION="$(python -c "import torch; print(torch.__version__)")" python setup.py develop bdist_wheel -d $WHEELS_FOLDER
6061
else
61-
conda install -y pytorch torchvision cudatoolkit=10.2 -c pytorch-nightly
62+
pip install torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html --pre
6263
PYTORCH_VERSION="$(python -c "import torch; print(torch.__version__)")" python setup.py develop bdist_wheel -d $WHEELS_FOLDER
6364
fi

.circleci/unittest/windows/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ else
2828
fi
2929

3030
printf "Installing PyTorch with %s\n" "${cudatoolkit}"
31-
conda install -y -c "pytorch-${UPLOAD_CHANNEL}" -c nvidia "pytorch-${UPLOAD_CHANNEL}"::pytorch[build="*${version}*"] "${cudatoolkit}"
31+
conda install -y -c "pytorch-test" -c nvidia "pytorch-test"::pytorch[build="*${version}*"] "${cudatoolkit}"
3232

3333
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
3434
echo torch.cuda.is_available is $torch_cuda

.github/workflows/docs.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/checkout@v2
2121
- name: Install PyTorch Nightly
2222
run: |
23-
python3 -mpip install --pre torch>=1.12.0.dev -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
23+
python3 -mpip install --pre torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html
2424
- name: Install functorch
2525
run: |
2626
python3 setup.py install
@@ -38,45 +38,45 @@ jobs:
3838
name: built-docs
3939
path: docs/build/html
4040

41-
deploy-docs:
42-
needs: [build-docs]
43-
runs-on: ubuntu-latest
44-
if: (github.ref == 'refs/heads/main' && github.event_name == 'push')
45-
steps:
46-
- uses: actions/checkout@v2
47-
with:
48-
ref: gh-pages
49-
fetch-depth: 3
50-
51-
- name: Download docs artifact
52-
uses: actions/download-artifact@v2
53-
with:
54-
name: built-docs
55-
path: /tmp/docs
56-
57-
- name: Copy built docs to nightly
58-
id: copy-docs
59-
run: |
60-
cp -R /tmp/docs/* nightly/
61-
git log -3
62-
# Set commit name and hash as variables: commit_name, commit_hash
63-
echo "::set-output name=commit_name::$(git log -1 --format='%s')"
64-
echo "::set-output name=commit_hash::$(git log -1 --format='%h')"
65-
66-
- name: Git reset to commit/amend
67-
if: ${{ steps.copy-docs.outputs.commit_name == 'auto-generated commit' }}
68-
run: |
69-
# if commit_name is "auto-generated commit"
70-
# then go back in commit history to commit to the same commit
71-
git reset --soft ${{ steps.copy-docs.outputs.commit_hash }}~1
72-
git log -3
73-
74-
- name: Commit and push to gh-pages
75-
uses: github-actions-x/[email protected]
76-
with:
77-
github-token: ${{ secrets.GITHUB_TOKEN }}
78-
push-branch: 'gh-pages'
79-
commit-message: 'auto-generated commit'
80-
force-push: 'true'
81-
name: gha
82-
41+
# deploy-docs:
42+
# needs: [build-docs]
43+
# runs-on: ubuntu-latest
44+
# if: (github.ref == 'refs/heads/main' && github.event_name == 'push')
45+
# steps:
46+
# - uses: actions/checkout@v2
47+
# with:
48+
# ref: gh-pages
49+
# fetch-depth: 3
50+
#
51+
# - name: Download docs artifact
52+
# uses: actions/download-artifact@v2
53+
# with:
54+
# name: built-docs
55+
# path: /tmp/docs
56+
#
57+
# - name: Copy built docs to nightly
58+
# id: copy-docs
59+
# run: |
60+
# cp -R /tmp/docs/* nightly/
61+
# git log -3
62+
# # Set commit name and hash as variables: commit_name, commit_hash
63+
# echo "::set-output name=commit_name::$(git log -1 --format='%s')"
64+
# echo "::set-output name=commit_hash::$(git log -1 --format='%h')"
65+
#
66+
# - name: Git reset to commit/amend
67+
# if: ${{ steps.copy-docs.outputs.commit_name == 'auto-generated commit' }}
68+
# run: |
69+
# # if commit_name is "auto-generated commit"
70+
# # then go back in commit history to commit to the same commit
71+
# git reset --soft ${{ steps.copy-docs.outputs.commit_hash }}~1
72+
# git log -3
73+
#
74+
# - name: Commit and push to gh-pages
75+
# uses: github-actions-x/[email protected]
76+
# with:
77+
# github-token: ${{ secrets.GITHUB_TOKEN }}
78+
# push-branch: 'gh-pages'
79+
# commit-message: 'auto-generated commit'
80+
# force-push: 'true'
81+
# name: gha
82+

.github/workflows/wheels.yml

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [opened, synchronize, reopened]
55
push:
66
branches:
7-
- main
7+
- release/0.2
88

99
jobs:
1010

@@ -13,31 +13,43 @@ jobs:
1313
container: pytorch/manylinux-cpu
1414
strategy:
1515
matrix:
16-
python_abi: [ "cp37-cp37m", "cp38-cp38", "cp39-cp39" ]
16+
python_version: [["3.7", "cp37-cp37m"], ["3.8", "cp38-cp38"], ["3.9", "cp39-cp39"], ["3.10", "cp310-cp310"]]
1717
steps:
1818
- name: Checkout functorch
1919
uses: actions/checkout@v2
20-
- name: Install PyTorch Nightly
20+
- name: Install PyTorch 1.12 RC
2121
run: |
22-
export PATH="/opt/python/${{ matrix.python_abi }}/bin:$PATH"
23-
python3 -mpip install --pre torch>=1.12.0.dev -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
22+
export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH"
23+
python3 -mpip install --pre torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html
2424
- name: Build wheel
2525
run: |
26-
export PATH="/opt/python/${{ matrix.python_abi }}/bin:$PATH"
26+
export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH"
2727
python3 -mpip install wheel
2828
python3 setup.py bdist_wheel
29-
# NB: wheels have the linux_x86_64 prefix, need to be manually renamed
30-
- name: Upload wheel as GHA artifact
29+
# NB: wheels have the linux_x86_64 tag so we rename to manylinux1
30+
find . -name 'dist/*whl' -exec bash -c ' mv $0 ${0/linux/manylinux1}' {} \;
31+
# pytorch/pytorch binaries are also manylinux_2_17 compliant but they
32+
# pretend that they're manylinux1 compliant so we do the same.
33+
- name: Show auditwheel output; confirm 2-17
34+
run: |
35+
python3 -mpip install auditwheel
36+
auditwheel show dist/*
37+
- name: Upload wheel for the test-wheel job
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: functorch-linux-${{ matrix.python_version[0] }}.whl
41+
path: dist/*.whl
42+
- name: Upload wheel for download
3143
uses: actions/upload-artifact@v2
3244
with:
33-
name: functorch-linux.whl
45+
name: functorch-batch.whl
3446
path: dist/*.whl
3547

3648
build-wheel-mac:
3749
runs-on: macos-latest
3850
strategy:
3951
matrix:
40-
python_version: [ "3.7", "3.8", "3.9" ]
52+
python_version: [ "3.7", "3.8", "3.9", "3.10" ]
4153
steps:
4254
- name: Setup Python
4355
uses: actions/setup-python@v2
@@ -46,16 +58,69 @@ jobs:
4658
architecture: x64
4759
- name: Checkout functorch
4860
uses: actions/checkout@v2
49-
- name: Install PyTorch Nightly
61+
- name: Install PyTorch 1.12 RC
5062
run: |
51-
python3 -mpip install --pre torch>=1.12.0.dev -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
63+
python3 -mpip install --pre torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html
5264
- name: Build wheel
5365
run: |
5466
export CC=clang CXX=clang++
5567
python3 -mpip install wheel
5668
python3 setup.py bdist_wheel
57-
- name: Upload wheel as GHA artifact
69+
- name: Upload wheel for the test-wheel job
70+
uses: actions/upload-artifact@v2
71+
with:
72+
name: functorch-mac-${{ matrix.python_version }}.whl
73+
path: dist/*.whl
74+
- name: Upload wheel for download
5875
uses: actions/upload-artifact@v2
5976
with:
60-
name: functorch-mac.whl
77+
name: functorch-batch.whl
6178
path: dist/*.whl
79+
80+
test-wheel:
81+
needs: [build-wheel-linux, build-wheel-mac]
82+
strategy:
83+
matrix:
84+
os: [["linux", "ubuntu-18.04"], ["mac", "macos-latest"]]
85+
python_version: [ "3.7", "3.8", "3.9", "3.10" ]
86+
runs-on: ${{ matrix.os[1] }}
87+
steps:
88+
- name: Setup Python
89+
uses: actions/setup-python@v2
90+
with:
91+
python-version: ${{ matrix.python_version }}
92+
architecture: x64
93+
- name: Checkout functorch
94+
uses: actions/checkout@v2
95+
- name: Install PyTorch 1.12 RC
96+
run: |
97+
python3 -mpip install --pre torch~=1.12 -f https://download.pytorch.org/whl/test/cpu/torch_test.html
98+
- name: Upgrade pip
99+
run: |
100+
python3 -mpip install --upgrade pip
101+
- name: Install test dependencies
102+
run: |
103+
python3 -mpip install numpy pytest pytest-cov codecov unittest-xml-reporting pillow>=4.1.1 scipy av networkx expecttest pyyaml
104+
- name: Download built wheels
105+
uses: actions/download-artifact@v2
106+
with:
107+
name: functorch-${{ matrix.os[0] }}-${{ matrix.python_version }}.whl
108+
path: /tmp/wheels
109+
- name: Install built wheels
110+
run: |
111+
python3 -mpip install /tmp/wheels/*
112+
- name: Log version string
113+
run: |
114+
# Avoid ambiguity of "import functorch" by deleting the source files.
115+
rm -rf functorch/
116+
python -c "import functorch; print(functorch.__version__)"
117+
- name: Run tests
118+
run: |
119+
set -e
120+
export IN_CI=1
121+
mkdir test-reports
122+
python -m torch.utils.collect_env
123+
python -c "import functorch; print(functorch.__version__)"
124+
EXIT_STATUS=0
125+
find test \( -name test\*.py ! -name test_functorch_lagging_op_db.py \) | xargs -I {} -n 1 python {} -v || EXIT_STATUS=$?
126+
exit $EXIT_STATUS

packaging/pkg_helpers.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ setup_pip_pytorch_version() {
232232
if [[ -z "$PYTORCH_VERSION" ]]; then
233233
# Install latest prerelease version of torch, per our nightlies, consistent
234234
# with the requested cuda version
235-
pip_install --pre torch -f "https://download.pytorch.org/whl/nightly/${WHEEL_DIR}torch_nightly.html"
235+
pip_install --pre torch -f "https://download.pytorch.org/whl/test/${WHEEL_DIR}torch_test.html"
236236
if [[ "$CUDA_VERSION" == "cpu" ]]; then
237237
# CUDA and CPU are ABI compatible on the CPU-only parts, so strip
238238
# in this case

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ def write_version_file():
4343
# if os.getenv('PYTORCH_VERSION'):
4444
# pytorch_dep += "==" + os.getenv('PYTORCH_VERSION')
4545
requirements = [
46-
# This represents a nightly version of PyTorch.
47-
# It can be installed as a binary or from source.
48-
"torch>=1.10.0.dev",
46+
"torch>=1.12,<1.13",
4947
]
5048

5149
extras = {}

0 commit comments

Comments
 (0)