Skip to content

Commit 13a2cb9

Browse files
author
root
committed
Merge remote-tracking branch 'upstream/master' into IFU-master-2022-04-26
2 parents 625dd01 + 3684300 commit 13a2cb9

File tree

1,018 files changed

+61364
-38512
lines changed

Some content is hidden

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

1,018 files changed

+61364
-38512
lines changed

.circleci/cimodel/data/pytorch_build_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def child_constructor(self):
7474
"mlc": MLCConfigNode,
7575
"vulkan": VulkanConfigNode,
7676
"parallel_tbb": ParallelTBBConfigNode,
77-
"noarch": NoarchConfigNode,
77+
"crossref": CrossRefConfigNode,
7878
"parallel_native": ParallelNativeConfigNode,
7979
"onnx": ONNXConfigNode,
8080
"libtorch": LibTorchConfigNode,
@@ -171,9 +171,9 @@ def child_constructor(self):
171171
return ImportantConfigNode
172172

173173

174-
class NoarchConfigNode(TreeConfigNode):
174+
class CrossRefConfigNode(TreeConfigNode):
175175
def init2(self, node_name):
176-
self.props["is_noarch"] = node_name
176+
self.props["is_crossref"] = node_name
177177

178178
def child_constructor(self):
179179
return ImportantConfigNode

.circleci/cimodel/data/pytorch_build_definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def instantiate_configs(only_slow_gradcheck):
239239
compiler_version = fc.find_prop("compiler_version")
240240
is_xla = fc.find_prop("is_xla") or False
241241
is_asan = fc.find_prop("is_asan") or False
242-
is_noarch = fc.find_prop("is_noarch") or False
242+
is_crossref = fc.find_prop("is_crossref") or False
243243
is_onnx = fc.find_prop("is_onnx") or False
244244
is_pure_torch = fc.find_prop("is_pure_torch") or False
245245
is_vulkan = fc.find_prop("is_vulkan") or False
@@ -283,8 +283,8 @@ def instantiate_configs(only_slow_gradcheck):
283283
python_version = fc.find_prop("pyver")
284284
parms_list[0] = fc.find_prop("abbreviated_pyver")
285285

286-
if is_noarch:
287-
parms_list_ignored_for_docker_image.append("noarch")
286+
if is_crossref:
287+
parms_list_ignored_for_docker_image.append("crossref")
288288

289289
if is_onnx:
290290
parms_list.append("onnx")

.circleci/docker/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ case "$image" in
134134
VISION=yes
135135
KATEX=yes
136136
;;
137+
pytorch-linux-bionic-cuda11.3-cudnn8-py3-clang9)
138+
CUDA_VERSION=11.3.0 # Deviating from major.minor to conform to nvidia's Docker image names
139+
CUDNN_VERSION=8
140+
TENSORRT_VERSION=8.0.1.6
141+
ANACONDA_PYTHON_VERSION=3.7
142+
CMAKE_VERSION=3.10.3
143+
CLANG_VERSION=9
144+
PROTOBUF=yes
145+
DB=yes
146+
VISION=yes
147+
KATEX=yes
148+
;;
137149
pytorch-linux-bionic-cuda11.5-cudnn8-py3-gcc7)
138150
CUDA_VERSION=11.5.0
139151
CUDNN_VERSION=8

.circleci/scripts/cpp_doc_push_script.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ echo "cpp_doc_push_script.sh: Invoked with $*"
2020
# but since DOCS_INSTALL_PATH can be derived from DOCS_VERSION it's probably better to
2121
# try and gather it first, just so we don't potentially break people who rely on this script
2222
# Argument 2: What version of the Python API docs we are building.
23-
version="${2:-${DOCS_VERSION:-main}}"
23+
version="${2:-${DOCS_VERSION:-master}}"
2424
if [ -z "$version" ]; then
2525
echo "error: cpp_doc_push_script.sh: version (arg2) not specified"
2626
exit 1
@@ -35,7 +35,7 @@ echo "error: cpp_doc_push_script.sh: install_path (arg1) not specified"
3535
fi
3636

3737
is_main_doc=false
38-
if [ "$version" == "main" ]; then
38+
if [ "$version" == "master" ]; then
3939
is_main_doc=true
4040
fi
4141

@@ -56,7 +56,7 @@ sudo apt-get -y install doxygen
5656
# Generate ATen files
5757
pushd "${pt_checkout}"
5858
pip install -r requirements.txt
59-
time python -m tools.codegen.gen \
59+
time python -m torchgen.gen \
6060
-s aten/src/ATen \
6161
-d build/aten/src/ATen
6262

.circleci/scripts/python_doc_push_script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set -ex
2323
# but since DOCS_INSTALL_PATH can be derived from DOCS_VERSION it's probably better to
2424
# try and gather it first, just so we don't potentially break people who rely on this script
2525
# Argument 2: What version of the docs we are building.
26-
version="${2:-${DOCS_VERSION:-main}}"
26+
version="${2:-${DOCS_VERSION:-master}}"
2727
if [ -z "$version" ]; then
2828
echo "error: python_doc_push_script.sh: version (arg2) not specified"
2929
exit 1
@@ -38,7 +38,7 @@ echo "error: python_doc_push_script.sh: install_path (arg1) not specified"
3838
fi
3939

4040
is_main_doc=false
41-
if [ "$version" == "main" ]; then
41+
if [ "$version" == "master" ]; then
4242
is_main_doc=true
4343
fi
4444

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.github/workflows/generated-*.yml linguist-generated=true
44
.github/generated-* linguist-generated=true
55
.github/scripts/gql_mocks.json linguist-generated=true
6+
third_party/LICENSES_BUNDLED.txt linguist-generated=true

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ inputs:
66
no-sudo:
77
description: If set to any value, don't use sudo to clean the workspace
88
required: false
9+
submodules:
10+
description: Works as stated in actions/checkout, but the default value is recursive
11+
required: false
12+
default: recursive
13+
fetch-depth:
14+
description: Works as stated in actions/checkout, but the default value is 0
15+
required: false
16+
default: "0"
917

1018
runs:
1119
using: composite
@@ -27,6 +35,6 @@ runs:
2735
uses: zhouzhuojie/checkout@05b13c9a0d21f08f6d5e64a1d5042246d13619d9
2836
with:
2937
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
30-
# deep clone, to allow use of git merge-base
31-
fetch-depth: 0
32-
submodules: recursive
38+
# --depth=1 for speed, manually fetch history and other refs as necessary
39+
fetch-depth: ${{ inputs.fetch-depth }}
40+
submodules: ${{ inputs.submodules }}

.github/actions/setup-ssh/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ runs:
1414
uses: seemethere/add-github-ssh-key@v1
1515
with:
1616
GITHUB_TOKEN: ${{ inputs.github-secret }}
17+
activate-with-label: false

.github/merge_rules.json

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
"name": "ONNX exporter",
44
"patterns": [
55
".jenkins/caffe2/*",
6+
"scripts/onnx/**",
67
"docs/source/onnx.rst",
78
"test/onnx/**",
9+
"test/jit/test_export_modes.py",
10+
"aten/src/ATen/core/interned_strings.h",
811
"tools/onnx/**",
912
"torch/_C/__init__.pyi.in",
1013
"torch/csrc/jit/passes/onnx.*",
@@ -20,7 +23,7 @@
2023
{
2124
"name": "NVFuser",
2225
"patterns": ["torch/csrc/jit/codegen/fuser/cuda/**", "torch/csrc/jit/codegen/cuda/**", "benchmarks/cpp/nvfuser/**"],
23-
"approved_by": ["csarofeen", "ngimel"],
26+
"approved_by": ["csarofeen", "ngimel", "jjsjann123"],
2427
"mandatory_checks_name": ["Facebook CLA Check", "Lint"]
2528
},
2629
{
@@ -41,6 +44,62 @@
4144
"approved_by": ["linbinyu", "kit1980", "IvanKobzarev", "dreiss"],
4245
"mandatory_checks_name": ["Facebook CLA Check", "Lint"]
4346
},
47+
{
48+
"name": "Linear Algebra",
49+
"patterns": [
50+
"aten/src/ATen/native/cuda/linalg/**",
51+
"aten/src/ATen/LinalgBackend.h",
52+
"aten/src/ATen/native/**/*LinearAlgebra*",
53+
"docs/source/linalg.rst",
54+
"torch/linalg/**",
55+
"torch/_linalg_utils.py",
56+
"torch/**/python_linalg_functions.*",
57+
"torch/**/linalg.h",
58+
"tools/autograd/templates/python_linalg_functions.cpp",
59+
"test/test_linalg.py"
60+
],
61+
"approved_by": ["nikitaved", "mruberry", "pearu", "Lezcano", "IvanYashchuk"],
62+
"mandatory_checks_name": ["Facebook CLA Check", "Lint"]
63+
},
64+
{
65+
"name": "FFT",
66+
"patterns": [
67+
"aten/src/ATen/native/cuda/*FFT*.h",
68+
"aten/src/ATen/native/SpectralOps.cpp",
69+
"aten/src/ATen/native/mkl/SpectralOps.cpp",
70+
"aten/src/ATen/native/cuda/SpectralOps.*",
71+
"docs/source/fft.rst",
72+
"torch/fft/**",
73+
"torch/csrc/api/include/torch/fft.h",
74+
"torch/**/python_fft_functions.*",
75+
"tools/autograd/templates/python_fft_functions.cpp",
76+
"test/cpp/api/fft.cpp"
77+
],
78+
"approved_by": ["mruberry", "peterbell10"],
79+
"mandatory_checks_name": ["Facebook CLA Check", "Lint"]
80+
},
81+
{
82+
"name": "Sparse",
83+
"patterns": [
84+
"benchmarks/sparse",
85+
"c10/util/sparse_bitset.h",
86+
"docs/source/sparse.rst",
87+
"torch/**/sparse/**",
88+
"torch/**/*sparse*",
89+
"torch/optim/sparse*",
90+
"torch/ao/nn/sparse/**",
91+
"torch/utils/benchmark/**/*sparse*",
92+
"aten/src/ATen/native/ao_sparse/**",
93+
"aten/src/ATen/native/sparse/**",
94+
"aten/src/ATen/**/*Sparse*",
95+
"aten/src/ATen/*Sparse*",
96+
"torch/_masked/**",
97+
"test/*_masked*",
98+
"test/**/*sparse*"
99+
],
100+
"approved_by": ["nikitaved", "cpuhrsch", "pearu", "IvanYashchuk"],
101+
"mandatory_checks_name": ["Facebook CLA Check", "Lint"]
102+
},
44103
{
45104
"name": "superuser",
46105
"patterns": ["*"],
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import json
2+
import subprocess
3+
import sys
4+
5+
from enum import Enum
6+
from pathlib import Path
7+
from typing import NamedTuple, Optional
8+
9+
# From: https://docs.github.com/en/rest/reference/checks
10+
class GitHubAnnotationLevel(str, Enum):
11+
NOTICE = "notice"
12+
WARNING = "warning"
13+
FAILURE = "failure"
14+
15+
16+
class GitHubAnnotation(NamedTuple):
17+
path: str
18+
start_line: int
19+
end_line: int
20+
start_column: Optional[int]
21+
end_column: Optional[int]
22+
annotation_level: GitHubAnnotationLevel
23+
message: str
24+
title: Optional[str]
25+
raw_details: Optional[str]
26+
27+
PYTORCH_ROOT = Path(subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).decode('ascii').strip())
28+
29+
annotations = []
30+
for line in sys.stdin:
31+
lint_message = json.loads(line)
32+
33+
path = lint_message.get("path")
34+
line = lint_message.get("line")
35+
36+
37+
code = lint_message["code"]
38+
severity = lint_message["severity"]
39+
name = lint_message["name"]
40+
description = lint_message.get("description")
41+
42+
# These fields are required by the GitHub API, but optional in lintrunner.
43+
# If they don't exist, just skip.
44+
if path is None or line is None:
45+
print(f"No path/line for lint: ({code}) {name}", file=sys.stderr)
46+
continue
47+
48+
# normalize path relative to git root
49+
path = Path(path).relative_to(PYTORCH_ROOT)
50+
51+
annotations.append(GitHubAnnotation(
52+
path=str(path),
53+
start_line=int(line),
54+
end_line=int(line),
55+
start_column=None,
56+
end_column=None,
57+
annotation_level=GitHubAnnotationLevel.FAILURE,
58+
message=description,
59+
title=f"({code}) {name}",
60+
raw_details=None,
61+
)._asdict())
62+
63+
print(json.dumps(annotations), flush=True)

.github/scripts/generate_binary_build_matrix.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from typing import Dict, List, Tuple, Optional
1414

1515

16-
CUDA_ARCHES = ["10.2", "11.3", "11.5", "11.6"]
16+
CUDA_ARCHES = ["10.2", "11.3", "11.6"]
1717

1818

1919
ROCM_ARCHES = ["4.5.2", "5.0"]
@@ -148,6 +148,9 @@ def generate_libtorch_matrix(os: str, abi_version: str,
148148
# matter
149149
gpu_arch_type = arch_type(arch_version)
150150
gpu_arch_version = "" if arch_version == "cpu" else arch_version
151+
# ROCm builds without-deps failed even in ROCm runners; skip for now
152+
if gpu_arch_type == "rocm" and "without-deps" in libtorch_variant:
153+
continue
151154
ret.append(
152155
{
153156
"gpu_arch_type": gpu_arch_type,

.github/scripts/gitutils.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def compute_branch_diffs(self, from_branch: str, to_branch: str) -> Tuple[List[s
200200
# which creates a tracking problem
201201
if (
202202
"pytorch/pytorch" not in self.remote_url() or
203-
frc.commit_hash != "0a6a1b27a464ba5be5f587cce2ee12ab8c504dbf"
203+
frc.commit_hash not in {"0a6a1b27a464ba5be5f587cce2ee12ab8c504dbf",
204+
"6d0f4a1d545a8f161df459e8d4ccafd4b9017dbe",
205+
"edf909e58f06150f7be41da2f98a3b9de3167bca"}
204206
):
205207
raise RuntimeError(f"Unexpected differences between {frc} and {toc}")
206208
from_commits.remove(frc.commit_hash)
@@ -210,6 +212,15 @@ def compute_branch_diffs(self, from_branch: str, to_branch: str) -> Tuple[List[s
210212
from_commits.remove(commit)
211213
for commit in to_values:
212214
to_commits.remove(commit)
215+
# Another HACK: Patch-id is not stable for commits with binary files or for big changes across commits
216+
# I.e. cherry-picking those from one branch into another will change patchid
217+
if "pytorch/pytorch" in self.remote_url():
218+
for excluded_commit in {"8e09e20c1dafcdbdb45c2d1574da68a32e54a3a5",
219+
"5f37e5c2a39c3acb776756a17730b865f0953432",
220+
"b5222584e6d6990c6585981a936defd1af14c0ba"}:
221+
if excluded_commit in from_commits:
222+
from_commits.remove(excluded_commit)
223+
213224
return (from_commits, to_commits)
214225

215226
def cherry_pick_commits(self, from_branch: str, to_branch: str) -> None:

0 commit comments

Comments
 (0)