4
4
types : [opened, synchronize, reopened]
5
5
push :
6
6
branches :
7
- - main
7
+ - release/0.2
8
8
9
9
jobs :
10
10
@@ -13,31 +13,43 @@ jobs:
13
13
container : pytorch/manylinux-cpu
14
14
strategy :
15
15
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"] ]
17
17
steps :
18
18
- name : Checkout functorch
19
19
uses : actions/checkout@v2
20
- - name : Install PyTorch Nightly
20
+ - name : Install PyTorch 1.12 RC
21
21
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
24
24
- name : Build wheel
25
25
run : |
26
- export PATH="/opt/python/${{ matrix.python_abi }}/bin:$PATH"
26
+ export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH"
27
27
python3 -mpip install wheel
28
28
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
31
43
uses : actions/upload-artifact@v2
32
44
with :
33
- name : functorch-linux .whl
45
+ name : functorch-batch .whl
34
46
path : dist/*.whl
35
47
36
48
build-wheel-mac :
37
49
runs-on : macos-latest
38
50
strategy :
39
51
matrix :
40
- python_version : [ "3.7", "3.8", "3.9" ]
52
+ python_version : [ "3.7", "3.8", "3.9", "3.10" ]
41
53
steps :
42
54
- name : Setup Python
43
55
uses : actions/setup-python@v2
@@ -46,16 +58,69 @@ jobs:
46
58
architecture : x64
47
59
- name : Checkout functorch
48
60
uses : actions/checkout@v2
49
- - name : Install PyTorch Nightly
61
+ - name : Install PyTorch 1.12 RC
50
62
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
52
64
- name : Build wheel
53
65
run : |
54
66
export CC=clang CXX=clang++
55
67
python3 -mpip install wheel
56
68
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
58
75
uses : actions/upload-artifact@v2
59
76
with :
60
- name : functorch-mac .whl
77
+ name : functorch-batch .whl
61
78
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
0 commit comments