8000 Update on "gen_aten output into aten/src/ATen/" · pytorch/pytorch@19b88fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 19b88fc

Browse files
author
Michael Andreas Dagitses
committed
Update on "gen_aten output into aten/src/ATen/"
This is more natural for the Bazel build. Differential Revision: [D36487559](https://our.internmc.facebook.com/intern/diff/D36487559/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36487559/)! [ghstack-poisoned]
2 parents ebd1fbb + 98c77b6 commit 19b88fc

File tree

765 files changed

+41840
-21044
lines changed

Some content is hidden

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

765 files changed

+41840
-21044
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ build --copt=-isystem --copt=bazel-out/k8-fastbuild-cpu-only/bin
3131
# rules_cuda configuration
3232
build:cpu-only --@rules_cuda//cuda:enable_cuda=False
3333

34+
# Definition of --config=shell
35+
# interactive shell immediately before execution
36+
build:shell --run_under="//tools/bazel_tools:shellwrap"
37+
3438
# Disable all warnings for external repositories. We don't care about
3539
# their warnings.
3640
build --per_file_copt=^external/@-w

.buckconfig.oss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
[cxx]
1616
cxxflags = -std=c++17
1717
should_remap_host_platform = true
18+
cpp = /usr/bin/clang
19+
cc = /usr/bin/clang
20+
cxx = /usr/bin/clang++
21+
cxxpp = /usr/bin/clang++
22+
ld = /usr/bin/clang++
1823

1924
[project]
2025
default_flavors_mode=all

.circleci/cimodel/data/pytorch_build_data.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def child_constructor(self):
7575
"vulkan": VulkanConfigNode,
7676
"parallel_tbb": ParallelTBBConfigNode,
7777
"crossref": CrossRefConfigNode,
78+
"dynamo": DynamoConfigNode,
7879
"parallel_native": ParallelNativeConfigNode,
7980
"onnx": ONNXConfigNode,
8081
"libtorch": LibTorchConfigNode,
@@ -179,6 +180,14 @@ def child_constructor(self):
179180
return ImportantConfigNode
180181

181182

183+
class DynamoConfigNode(TreeConfigNode):
184+
def init2(self, node_name):
185+
self.props["is_dynamo"] = node_name
186+
187+
def child_constructor(self):
188+
return ImportantConfigNode
189+
190+
182191
class ParallelNativeConfigNode(TreeConfigNode):
183192
def modify_label(self, label):
184193
return "PARALLELNATIVE=" + str(label)

.circleci/cimodel/data/pytorch_build_definitions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def instantiate_configs(only_slow_gradcheck):
240240
is_xla = fc.find_prop("is_xla") or False
241241
is_asan = fc.find_prop("is_asan") or False
242242
is_crossref = fc.find_prop("is_crossref") or False
243+
is_dynamo = fc.find_prop("is_dynamo") or False
243244
is_onnx = fc.find_prop("is_onnx") or False
244245
is_pure_torch = fc.find_prop("is_pure_torch") or False
245246
is_vulkan = fc.find_prop("is_vulkan") or False
@@ -286,6 +287,9 @@ def instantiate_configs(only_slow_gradcheck):
286287
if is_crossref:
287288
parms_list_ignored_for_docker_image.append("crossref")
288289

290+
if is_dynamo:
291+
parms_list_ignored_for_docker_image.append("dynamo")
292+
289293
if is_onnx:
290294
parms_list.append("onnx")
291295
python_version = fc.find_prop("pyver")

.circleci/docker/build_docker.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ fi
4848

4949
# Only push if `DOCKER_SKIP_PUSH` = false
5050
if [ "${DOCKER_SKIP_PUSH:-true}" = "false" ]; then
51-
docker push "${image}:${tag}"
51+
# Only push if docker image doesn't exist already.
52+
# ECR image tags are immutable so this will avoid pushing if only just testing if the docker jobs work
53+
# NOTE: The only workflow that should push these images should be the docker-builds.yml workflow
54+
if ! docker manifest inspect "${image}:${tag}" >/dev/null 2>/dev/null; then
55+
docker push "${image}:${tag}"
56+
fi
5257
fi
5358

5459
if [ -z "${DOCKER_SKIP_S3_UPLOAD:-}" ]; then

.github/actions/build-android/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ runs:
3737
shell: bash
3838
env:
3939
BRANCH: ${{ inputs.branch }}
40-
JOB_BASE_NAME: ${{ inputs.build-environment }}-build-and-test
4140
BUILD_ENVIRONMENT: pytorch-linux-xenial-py3-clang5-android-ndk-r19c-${{ inputs.arch-for-build-env }}-build"
4241
AWS_DEFAULT_REGION: us-east-1
4342
PR_NUMBER: ${{ github.event.pull_request.number }}
@@ -51,7 +50,6 @@ runs:
5150
export container_name
5251
container_name=$(docker run \
5352
-e BUILD_ENVIRONMENT \
54-
-e JOB_BASE_NAME \
5553
-e MAX_JOBS="$(nproc --ignore=2)" \
5654
-e AWS_DEFAULT_REGION \
5755
-e PR_NUMBER \

.github/actions/calculate-docker-image/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ inputs:
1717
pull:
1818
description: If set to any value, run `docker pull`` on the calculated image.
1919
required: false
20+
skip_push:
21+
description: If set to true value, skip will be pushed, default is to skip so that pushing will be explicit
22+
required: true
2023
force_push:
2124
description: If set to any value, always run the push
2225
required: false
@@ -96,7 +99,8 @@ runs:
9699
env:
97100
IMAGE_NAME: ${{inputs.docker-image-name}}
98101
DOCKER_SKIP_S3_UPLOAD: "1"
99-
DOCKER_SKIP_PUSH: ${{ steps.check.outputs.skip_push || 'false' }}
102+
# Skip push if we don't need it, or if specified in the inputs
103+
DOCKER_SKIP_PUSH: ${{ steps.check.outputs.skip_push || inputs.skip_push }}
100104
DOCKER_TAG: ${{ steps.calculate-tag.outputs.docker-tag }}
101105
working-directory: .circleci/docker
102106
shell: bash

.github/actions/pull-docker-image/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ runs:
1717
run: |
1818
retry () { "$@" || (sleep 1 && "$@") || (sleep 2 && "$@") }
1919
# ignore output since only exit code is used for conditional
20-
if docker inspect --type=image "${DOCKER_IMAGE}" >/dev/null 2>/dev/null; then
20+
# only pull docker image if it's not available locally
21+
if ! docker inspect --type=image "${DOCKER_IMAGE}" >/dev/null 2>/dev/null; then
2122
retry docker pull "${DOCKER_IMAGE}"
2223
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2d43de8576e47a1d7f287011f14a55e93b568428
1+
ad21e440dc9e5cdd77785fe1ea9979a53262114e

.github/ci_commit_pins/xla.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
02346af955653a179b896eef5475e569ab8d4229
1+
8f0f0d3ea0818f2fc8c7a81a17d60fdf95c956d0

.github/merge_rules.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"name": "ONNX exporter",
44
"patterns": [
55
".jenkins/caffe2/*",
6-
"scripts/onnx/**",
6+
"aten/src/ATen/core/interned_strings.h",
77
"docs/source/onnx.rst",
8-
"test/onnx/**",
8+
"docs/source/scripts/onnx/**",
9+
"scripts/onnx/**",
910
"test/jit/test_export_modes.py",
10-
"aten/src/ATen/core/interned_strings.h",
11+
"test/onnx/**",
1112
"tools/onnx/**",
1213
"torch/_C/__init__.pyi.in",
1314
"torch/csrc/jit/passes/onnx.*",
@@ -51,14 +52,28 @@
5152
},
5253
{
5354
"name": "CI Pinned Hashes",
54-
"patterns": [".github/ci_commit_pins/**"],
55+
"patterns": [
56+
".github/ci_commit_pins/vision.txt",
57+
".github/ci_commit_pins/torchdynamo.txt"
58+
],
5559
"approved_by": ["pytorchbot", "ezyang", "pytorch/pytorch-dev-infra"],
5660
"mandatory_checks_name": [
5761
"Facebook CLA Check",
5862
"Lint",
5963
"pull"
6064
]
6165
},
66+
{
67+
"name": "XLA hash pin update",
68+
"patterns": [".github/ci_commit_pins/xla.txt"],
69+
"approved_by": ["pytorchbot", "ezyang", "pytorch/pytorch-dev-infra"],
70+
"mandatory_checks_name": [
71+
"Facebook CLA Check",
72+
"Lint",
73+
"pull / linux-bionic-py3_7-clang8-xla / build",
74+
"pull / linux-bionic-py3_7-clang8-xla / test (xla, 1, 1, linux.2xlarge)"
75+
]
76+
},
6277
{
6378
"name": "Documentation",
6479
"patterns": ["docs/**", "torch/*docs.py"],
@@ -161,6 +176,19 @@
161176
"pull"
162177
]
163178
},
179+
{
180+
"name": "Distributions",
181+
"patterns": [
182+
"torch/distributions/**",
183+
"test/distributions/**"
184+
],
185+
"approved_by": ["fritzo", "neerajprad", "alicanb", "vishwakftw"],
186+
"mandatory_checks_name": [
187+
"Facebook CLA Check",
188+
"Lint",
189+
"pull"
190+
]
191+
},
164192
{
165193
"name": "Distributed",
166194
"patterns": [

.github/scripts/print_latest_commits.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import sys
12
from typing import Any, Dict, List, NamedTuple, Tuple
23
from gitutils import _check_output
34

45
import rockset # type: ignore[import]
56
import os
67
import re
78

9+
def eprint(msg: str) -> None:
10+
print(msg, file=sys.stderr)
11+
812
class WorkflowCheck(NamedTuple):
913
workflowName: str
1014
name: str
@@ -68,7 +72,6 @@ def isGreen(commit: str, results: Dict[str, Any]) -> Tuple[bool, str]:
6872
"trunk": False,
6973
"lint": False,
7074
"linux-binary": False,
71-
"android-tests": False,
7275
"windows-binary": False,
7376
}
7477

@@ -92,8 +95,13 @@ def isGreen(commit: str, results: Dict[str, Any]) -> Tuple[bool, str]:
9295

9396
def get_latest_green_commit(commits: List[str], results: Dict[str, Any]) -> Any:
9497
for commit in commits:
95-
if isGreen(commit, results)[0]:
98+
eprint(f"Checking {commit}")
99+
is_green, msg = isGreen(commit, results)
100+
if is_green:
101+
eprint("GREEN")
96102
return commit
103+
else:
104+
eprint("RED: " + msg)
97105
return None
98106

99107
def main() -> None:

.github/scripts/test_print_latest_commits.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_no_workflows(self, mock_get_commit_results: Any) -> None:
9595
workflow_checks = mock_get_commit_results()
9696
result = isGreen("sha", workflow_checks)
9797
self.assertFalse(result[0])
98-
self.assertEqual(result[1], "missing required workflows: pull, trunk, lint, linux-binary, android-tests, windows-binary")
98+
self.assertEqual(result[1], "missing required workflows: pull, trunk, lint, linux-binary, windows-binary")
9999

100100
if __name__ == "__main__":
101101
main()

.github/scripts/test_trymerge.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def __init__(self) -> None:
7474
self.comment_id = 0
7575
self.on_mandatory = False
7676
self.on_green = False
77+
self.land_checks = False
7778
self.reason = 'this is for testing'
7879

7980
return Object()
@@ -90,6 +91,7 @@ def mock_merge(pr_num: int, repo: GitRepo,
9091
comment_id: Optional[int] = None,
9192
mandatory_only: bool = False,
9293
on_green: bool = False,
94+
land_checks: bool = False,
9395
timeout_minutes: int = 400,
9496
stale_pr_days: int = 3) -> None:
9597
pass
@@ -273,6 +275,7 @@ def test_main_force(self, mock_merge: Any, mock_parse_args: Any, mock_gh_get_inf
273275
force=True,
274276
comment_id=mock.ANY,
275277
on_green=False,
278+
land_checks=False,
276279
mandatory_only=False)
277280

278281
@mock.patch('trymerge.gh_get_pr_info', return_value=mock_gh_get_info())
@@ -286,6 +289,7 @@ def test_main_merge(self, mock_merge: Any, mock_parse_args: Any, mock_gh_get_inf
286289
force=False,
287290
comment_id=mock.ANY,
288291
on_green=False,
292+
land_checks=False,
289293
mandatory_only=False)
290294

291295
if __name__ == "__main__":

0 commit comments

Comments
 (0)
0