8000 Merge branch 'pytorch:master' into jiterator/reciprocal · pytorch/pytorch@f0bff32 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0bff32

Browse files
authored
Merge branch 'pytorch:master' into jiterator/reciprocal
2 parents d9e4e56 + 089203f commit f0bff32

File tree

928 files changed

+68751
-29689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

928 files changed

+68751
-29689
lines changed

.buckconfig.oss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[buildfile]
2+
name = BUILD.buck
3+
4+
[repositories]
5+
bazel_skylib = third_party/bazel-skylib/
6+
7+
[download]
8+
in_build = true
9+
10+
[cxx]
11+
cxxflags = -std=c++17
12+
should_remap_host_platform = true
13+
14+
[project]
15+
default_flavors_mode=all

.circleci/docker/build.sh

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ elif [[ "$image" == *rocm* ]]; then
7676
DOCKERFILE="${OS}-rocm/Dockerfile"
7777
fi
7878

79+
if [[ "$image" == *xenial* ]] || [[ "$image" == *bionic* ]]; then
80+
CMAKE_VERSION=3.13.5
81+
fi
82+
7983
TRAVIS_DL_URL_PREFIX="https://s3.amazonaws.com/travis-python-archives/binaries/ubuntu/14.04/x86_64"
8084

8185
# It's annoying to rename jobs every time you want to rewrite a
@@ -84,13 +88,11 @@ TRAVIS_DL_URL_PREFIX="https://s3.amazonaws.com/travis-python-archives/binaries/u
8488
case "$image" in
8589
pytorch-linux-xenial-py3.8)
8690
ANACONDA_PYTHON_VERSION=3.8
87-
CMAKE_VERSION=3.10.3
8891
GCC_VERSION=7
8992
# Do not install PROTOBUF, DB, and VISION as a test
9093
;;
9194
pytorch-linux-xenial-py3.7-gcc5.4)
9295
ANACONDA_PYTHON_VERSION=3.7
93-
CMAKE_VERSION=3.12.4 # To make sure XNNPACK is enabled for the BACKWARDS_COMPAT_TEST used with this image
9496
GCC_VERSION=5
9597
PROTOBUF=yes
9698
DB=yes
@@ -99,13 +101,11 @@ case "$image" in
99101
;;
100102
pytorch-linux-xenial-py3.7-gcc7.2)
101103
ANACONDA_PYTHON_VERSION=3.7
102-
CMAKE_VERSION=3.10.3
103104
GCC_VERSION=7
104105
# Do not install PROTOBUF, DB, and VISION as a test
105106
;;
106107
pytorch-linux-xenial-py3.7-gcc7)
107108
ANACONDA_PYTHON_VERSION=3.7
108-
CMAKE_VERSION=3.10.3
109109
GCC_VERSION=7
110110
PROTOBUF=yes
111111
DB=yes
@@ -115,7 +115,6 @@ case "$image" in
115115
CUDA_VERSION=10.2
116116
CUDNN_VERSION=7
117117
ANACONDA_PYTHON_VERSION=3.7
118-
CMAKE_VERSION=3.10.3
119118
GCC_VERSION=7
120119
PROTOBUF=yes
121120
DB=yes
@@ -127,7 +126,6 @@ case "$image" in
127126
CUDNN_VERSION=8
128127
TENSORRT_VERSION=8.0.1.6
129128
ANACONDA_PYTHON_VERSION=3.7
130-
CMAKE_VERSION=3.10.3
131129
GCC_VERSION=7
132130
PROTOBUF=yes
133131
DB=yes
@@ -139,7 +137,6 @@ case "$image" in
139137
CUDNN_VERSION=8
140138
TENSORRT_VERSION=8.0.1.6
141139
ANACONDA_PYTHON_VERSION=3.7
142-
CMAKE_VERSION=3.10.3
143140
CLANG_VERSION=9
144141
PROTOBUF=yes
145142
DB=yes
@@ -150,7 +147,6 @@ case "$image" in
150147
CUDA_VERSION=11.6.0
151148
CUDNN_VERSION=8
152149
ANACONDA_PYTHON_VERSION=3.7
153-
CMAKE_VERSION=3.10.3
154150
GCC_VERSION=7
155151
PROTOBUF=yes
156152
DB=yes
@@ -160,31 +156,27 @@ case "$image" in
160156
pytorch-linux-xenial-py3-clang5-asan)
161157
ANACONDA_PYTHON_VERSION=3.7
162158
CLANG_VERSION=5.0
163-
CMAKE_VERSION=3.13.5
164159
PROTOBUF=yes
165160
DB=yes
166161
VISION=yes
167162
;;
168163
pytorch-linux-xenial-py3-clang7-asan)
169164
ANACONDA_PYTHON_VERSION=3.7
170165
CLANG_VERSION=7
171-
CMAKE_VERSION=3.10.3
172166
PROTOBUF=yes
173167
DB=yes
174168
VISION=yes
175169
;;
176170
pytorch-linux-xenial-py3-clang7-onnx)
177171
ANACONDA_PYTHON_VERSION=3.7
178172
CLANG_VERSION=7
179-
CMAKE_VERSION=3.10.3
180173
PROTOBUF=yes
181174
DB=yes
182175
VISION=yes
183176
;;
184177
pytorch-linux-xenial-py3-clang5-android-ndk-r19c)
185178
ANACONDA_PYTHON_VERSION=3.7
186179
CLANG_VERSION=5.0
187-
CMAKE_VERSION=3.13.5
188180
LLVMDEV=yes
189181
PROTOBUF=yes
190182
ANDROID=yes
@@ -194,7 +186,6 @@ case "$image" in
194186
;;
195187
pytorch-linux-xenial-py3.7-clang7)
196188
ANACONDA_PYTHON_VERSION=3.7
197-
CMAKE_VERSION=3.10.3
198189
CLANG_VERSION=7
199190
PROTOBUF=yes
200191
DB=yes
@@ -250,15 +241,21 @@ case "$image" in
250241
VISION=yes
251242
ROCM_VERSION=5.1.1
252243
;;
244+
pytorch-linux-focal-py3.7-gcc7)
245+
ANACONDA_PYTHON_VERSION=3.7
246+
CMAKE_VERSION=3.12.4 # To make sure XNNPACK is enabled for the BACKWARDS_COMPAT_TEST used with this image
247+
GCC_VERSION=7
248+
PROTOBUF=yes
249+
DB=yes
250+
VISION=yes
251+
KATEX=yes
252+
;;
253253
*)
254254
# Catch-all for builds that are not hardcoded.
255255
PROTOBUF=yes
256256
DB=yes
257257
VISION=yes
258258
echo "image '$image' did not match an existing build configuration"
259-
if [[ "$image" == *xenial* ]]; then
260-
CMAKE_VERSION=3.10.3
261-
fi
262259
if [[ "$image" == *py* ]]; then
263260
extract_version_from_image_name py ANACONDA_PYTHON_VERSION
264261
fi

.circleci/docker/common/install_conda.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
7777
# we want to pin to version 3.10.
7878
if [ "$ANACONDA_PYTHON_VERSION" = "3.9" ]; then
7979
# Install llvm-8 as it is required to compile llvmlite-0.30.0 from source
80-
conda_install numpy=1.19.2 astunparse pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0 -c conda-forge
80+
conda_install numpy=1.19.2 astunparse pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0
8181
elif [ "$ANACONDA_PYTHON_VERSION" = "3.8" ]; then
8282
# Install llvm-8 as it is required to compile llvmlite-0.30.0 from source
8383
conda_install numpy=1.18.5 astunparse pyyaml mkl mkl-include setuptools cffi future six llvmdev=8.0.0
@@ -100,14 +100,6 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
100100
# Install some other packages, including those needed for Python test reporting
101101
pip_install -r /opt/conda/requirements-ci.txt
102102

103-
# Install numba only on python-3.8 or below
104-
# For numba issue see https://github.com/pytorch/pytorch/issues/51511
105-
if [[ $(python -c "import sys; print(int(sys.version_info < (3, 9)))") == "1" ]]; then
106-
pip_install numba==0.54.1
107-
else
108-
pip_install numba==0.49.0
109-
fi
110-
111103
# Update scikit-learn to a python-3.8 compatible version
112104
if [[ $(python -c "import sys; print(int(sys.version_info >= (3, 8)))") == "1" ]]; then
113105
pip_install -U scikit-learn

.circleci/docker/common/install_katex.sh renamed to .circleci/docker/common/install_docs_reqs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
set -ex
44

55
if [ -n "$KATEX" ]; then
6+
apt-get update
7+
# Ignore error if gpg-agent doesn't exist (for Ubuntu 16.04)
8+
apt-get install -y gpg-agent || :
69

710
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
811
sudo apt-get install -y nodejs
@@ -14,6 +17,8 @@ if [ -n "$KATEX" ]; then
1417
apt-get install -y --no-install-recommends yarn
1518
yarn global add katex --prefix /usr/local
1619

20+
sudo apt-get -y install doxygen
21+
1722
apt-get autoclean && apt-get clean
1823
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1924

.circleci/docker/common/install_user.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set -ex
66
# jenkins user as ec2-user should have the same user-id
77
echo "jenkins:x:1000:1000::/var/lib/jenkins:" >> /etc/passwd
88
echo "jenkins:x:1000:" >> /etc/group
9+
# Needed on focal or newer
10+
echo "jenkins:*:19110:0:99999:7:::" >>/etc/shadow
911

1012
# Create $HOME
1113
mkdir -p /var/lib/jenkins
@@ -19,3 +21,6 @@ chown jenkins:jenkins /usr/local
1921
# Allow sudo
2022
# TODO: Maybe we shouldn't
2123
echo 'jenkins ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/jenkins
24+
25+
# Test that sudo works
26+
sudo -u jenkins sudo -v

.circleci/docker/requirements-ci.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ mypy==0.812
9898
#Pinned versions: 1.10.0.post1
9999
#test that import: run_test.py, test_cpp_extensions_aot.py,test_determination.py
100100

101-
#numba
101+
numba==0.49.0 ; python_version < "3.9"
102+
numba==0.54.1 ; python_version == "3.9"
102103
#Description: Just-In-Time Compiler for Numerical Functions
103104
#Pinned versions: 0.54.1, 0.49.0, <=0.49.1
104105
#test that import: test_numba_integration.py
106+
#For numba issue see https://github.com/pytorch/pytorch/issues/51511
105107

106108
#numpy
107109
#Description: Provides N-dimensional arrays and linear algebra
@@ -126,9 +128,9 @@ mypy==0.812
126128
#Pinned versions:
127129
#test that import:
128130

129-
#protobuf
131+
protobuf==3.20.1
130132
#Description: Google’s data interchange format
131-
#Pinned versions:
133+
#Pinned versions: 3.20.1
132134
#test that import: test_tensorboard.py
133135

134136
psutil

.circleci/docker/ubuntu-cuda/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ RUN bash ./install_user.sh && rm install_user.sh
2020

2121
# Install katex
2222
ARG KATEX
23-
ADD ./common/install_katex.sh install_katex.sh
24-
RUN bash ./install_katex.sh && rm install_katex.sh
23+
ADD ./common/install_docs_reqs.sh install_docs_reqs.sh
24+
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh
2525

2626
# Install conda and other packages (e.g., numpy, pytest)
2727
ENV PATH /opt/conda/bin:$PATH

.circleci/docker/ubuntu/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ RUN bash ./install_user.sh && rm install_user.sh
3030

3131
# Install katex
3232
ARG KATEX
33-
ADD ./common/install_katex.sh install_katex.sh
34-
RUN bash ./install_katex.sh && rm install_katex.sh
33+
ADD ./common/install_docs_reqs.sh install_docs_reqs.sh
34+
RUN bash ./install_docs_reqs.sh && rm install_docs_reqs.sh
3535

3636
# Install conda and other packages (e.g., numpy, pytest)
3737
ENV PATH /opt/conda/bin:$PATH

.circleci/scripts/binary_ios_upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
cp ${PROJ_ROOT}/LICENSE ${ZIP_DIR}/
3434
# zip the library
3535
export DATE="$(date -u +%Y%m%d)"
36-
export IOS_NIGHTLY_BUILD_VERSION="1.12.0.${DATE}"
36+
export IOS_NIGHTLY_BUILD_VERSION="1.13.0.${DATE}"
3737
if [ "${BUILD_LITE_INTERPRETER}" == "1" ]; then
3838
# libtorch_lite_ios_nightly_1.11.0.20210810.zip
3939
ZIPFILE="libtorch_lite_ios_nightly_${IOS_NIGHTLY_BUILD_VERSION}.zip"

.circleci/scripts/binary_populate_env.sh

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,12 @@ tagged_version() {
2323
fi
2424
}
2525

26-
# These are only relevant for CircleCI
27-
# TODO: Remove these later once migrated fully to GHA
28-
if [[ -z ${IS_GHA:-} ]]; then
29-
# We need to write an envfile to persist these variables to following
30-
# steps, but the location of the envfile depends on the circleci executor
31-
if [[ "$(uname)" == Darwin ]]; then
32-
# macos executor (builds and tests)
33-
workdir="/Users/distiller/project"
34-
elif [[ "$OSTYPE" == "msys" ]]; then
35-
# windows executor (builds and tests)
36-
workdir="/c/w"
37-
elif [[ -d "/home/circleci/project" ]]; then
38-
# machine executor (binary tests)
39-
workdir="/home/circleci/project"
40-
else
41-
# docker executor (binary builds)
42-
workdir="/"
43-
fi
44-
envfile="$workdir/env"
45-
touch "$envfile"
46-
chmod +x "$envfile"
47-
48-
# Parse the BUILD_ENVIRONMENT to package type, python, and cuda
49-
configs=($BUILD_ENVIRONMENT)
50-
export PACKAGE_TYPE="${configs[0]}"
51-
export DESIRED_PYTHON="${configs[1]}"
52-
export DESIRED_CUDA="${configs[2]}"
53-
if [[ "${OSTYPE}" == "msys" ]]; then
54-
export DESIRED_DEVTOOLSET=""
55-
export LIBTORCH_CONFIG="${configs[3]:-}"
56-
if [[ "$LIBTORCH_CONFIG" == 'debug' ]]; then
57-
export DEBUG=1
58-
fi
59-
else
60-
export DESIRED_DEVTOOLSET="${configs[3]:-}"
61-
fi
26+
envfile=${BINARY_ENV_FILE:-/tmp/env}
27+
if [[ -n "${PYTORCH_ROOT}" ]]; then
28+
workdir=$(dirname "${PYTORCH_ROOT}")
6229
else
63-
envfile=${BINARY_ENV_FILE:-/tmp/env}
64-
if [[ -n "${PYTORCH_ROOT}" ]]; then
65-
workdir=$(dirname "${PYTORCH_ROOT}")
66-
else
67-
# docker executor (binary builds)
68-
workdir="/"
69-
fi
30+
# docker executor (binary builds)
31+
workdir="/"
7032
fi
7133

7234
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
@@ -97,7 +59,7 @@ PIP_UPLOAD_FOLDER='nightly/'
9759
# We put this here so that OVERRIDE_PACKAGE_VERSION below can read from it
9860
export DATE="$(date -u +%Y%m%d)"
9961
#TODO: We should be pulling semver version from the base version.txt
100-
BASE_BUILD_VERSION="1.12.0.dev$DATE"
62+
BASE_BUILD_VERSION="1.13.0.dev$DATE"
10163
# Change BASE_BUILD_VERSION to git tag when on a git tag
10264
# Use 'git -C' to make doubly sure we're in the correct directory for checking
10365
# the git tag
@@ -164,7 +126,7 @@ else
164126
fi
165127
166128
export DATE="$DATE"
167-
export NIGHTLIES_DATE_PREAMBLE=1.12.0.dev
129+
export NIGHTLIES_DATE_PREAMBLE=1.13.0.dev
168130
export PYTORCH_BUILD_VERSION="$PYTORCH_BUILD_VERSION"
169131
export PYTORCH_BUILD_NUMBER="$PYTORCH_BUILD_NUMBER"
170132
export OVERRIDE_PACKAGE_VERSION="$PYTORCH_BUILD_VERSION"

.circleci/scripts/cpp_doc_push_script.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ git clone https://github.com/pytorch/cppdocs
5151

5252
set -ex
5353

54-
sudo apt-get -y install doxygen
55-
5654
# Generate ATen files
5755
pushd "${pt_checkout}"
5856
pip install -r requirements.txt

.github/actions/checkout-pytorch/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ runs:
2323
env:
2424
NO_SUDO: ${{ inputs.no-sudo }}
2525
run: |
26+
retry () {
27+
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
28+
}
2629
echo "${GITHUB_WORKSPACE}"
2730
if [ -z "${NO_SUDO}" ]; then
28-
sudo rm -rf "${GITHUB_WORKSPACE}"
31+
retry sudo rm -rf "${GITHUB_WORKSPACE}"
2932
else
30-
rm -rf "${GITHUB_WORKSPACE}"
33+
retry rm -rf "${GITHUB_WORKSPACE}"
3134
fi
3235
mkdir "${GITHUB_WORKSPACE}"
3336

.github/actions/download-build-artifacts/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
steps:
1616
- name: Download PyTorch Build Artifacts from S3
1717
if: ${{ !inputs.use-gha }}
18-
uses: seemethere/download-artifact-s3@v3
18+
uses: seemethere/download-artifact-s3@v4
1919
with:
2020
name: ${{ inputs.name }}
2121

.github/actions/upload-test-artifacts/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ runs:
5757
5858
# S3 upload
5959
- name: Store Test Downloaded JSONs on S3
60-
uses: seemethere/upload-artifact-s3@v4
60+
uses: seemethere/upload-artifact-s3@v5
6161
if: ${{ !inputs.use-gha }}
6262
with:
6363
retention-days: 14
6464
if-no-files-found: warn
6565
path: test-jsons-*.zip
6666

6767
- name: Store Test Reports on S3
68-
uses: seemethere/upload-artifact-s3@v4
68+
uses: seemethere/upload-artifact-s3@v5
6969
if: ${{ !inputs.use-gha }}
7070
with:
7171
retention-days: 14

0 commit comments

Comments
 (0)
0