8000 Merge branch 'master' into mps-binops-dtype-precedence · pytorch/pytorch@152a797 · GitHub
[go: up one dir, main page]

Skip t 10000 o content

Commit 152a797

Browse files
committed
Merge branch 'master' into mps-binops-dtype-precedence
2 parents 174e34e + 716f767 commit 152a797

File tree

155 files changed

+2704
-1236
lines changed

Some content is hidden

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

155 files changed

+2704
-1236
lines changed

.github/merge_rules.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,19 @@
273273
"deploy-linux-xenial-cuda11.3-py3.7-gcc7 / build"
274274
]
275275
},
276+
{
277+
"name": "MPS",
278+
"patterns": [
279+
"test/test_mps.py",
280+
"aten/src/ATen/mps/**",
281+
"aten/src/ATen/native/mps/**"
282+
],
283+
"approved_by": ["kulinseth", "razarmehr"],
284+
"mandatory_checks_name": [
285+
"Facebook CLA Check",
286+
"Lint"
287+
]
288+
},
276289
{
277290
"name": "superuser",
278291
"patterns": ["*"],

.github/scripts/test_tryrebase.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ def test_rebase(self, mocked_post_comment: Any, mocked_run_git: Any, mocked_gql:
2222
mocked_run_git.assert_has_calls(calls)
2323
self.assertTrue("Successfully rebased `master` onto `master`" in mocked_post_comment.call_args[0][3])
2424

25+
@mock.patch('trymerge.gh_graphql', side_effect=mocked_gh_graphql)
26+
@mock.patch('gitutils.GitRepo._run_git')
27+
@mock.patch('tryrebase.gh_post_comment')
28+
def test_rebase_to_stable(self, mocked_post_comment: Any, mocked_run_git: Any, mocked_gql: Any) -> None:
29+
"Tests rebase to viable/strict successfully"
30+
pr = GitHubPR("pytorch", "pytorch", 31093)
31+
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
32+
rebase_onto(pr, repo, False, True)
33+
calls = [mock.call('fetch', 'origin', 'pull/31093/head:pull/31093/head'),
34+
mock.call('rebase', 'viable/strict', 'pull/31093/head'),
35+
mock.call('push', '-f', 'https://github.com/mingxiaoh/pytorch.git', 'pull/31093/head:master')]
36+
mocked_run_git.assert_has_calls(calls)
37+
self.assertTrue(
38+
"Successfully rebased `master` onto `viable/strict`" in mocked_post_comment.call_args[0][3])
39+
2540
@mock.patch('trymerge.gh_graphql', side_effect=mocked_gh_graphql)
2641
@mock.patch('gitutils.GitRepo._run_git', return_value="Everything up-to-date")
2742
@mock.patch('tryrebase.gh_post_comment')

.github/scripts/trymerge.py

Lines changed: 5 additions & 2 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,11 @@ def merge_into(self, repo: GitRepo, *, force: bool = False, dry_run: bool = Fals
718718
if not dry_run:
719719
gh_add_labels(self.org, self.project, self.pr_num, ["merged"])
720720

721+
721722
class MandatoryChecksMissingError(Exception):
722723
pass
724+
725+
723726
@dataclass
724727
class MergeRule:
725728
name: str
@@ -784,7 +787,7 @@ def find_matching_merge_rule(pr: GitHubPR,
784787
if len(rule.approved_by) > 0 and len(approved_by) == 0:
785788
if reject_reason_score < 10000:
786789
reject_reason_score = 10000
787-
reject_reason = f"Matched rule {rule_name}, but PR has not been reviewed yet"
790+
reject_reason = f"Matched rule {rule_name}, but PR #{pr.pr_num} has not been reviewed yet"
788791
continue
789792

790793
rule_approvers_set = set()
@@ -799,7 +802,7 @@ def find_matching_merge_rule(pr: GitHubPR,
799802
if len(approvers_intersection) == 0 and len(rule_approvers_set) > 0:
800803
if reject_reason_score < 10000:
801804
reject_reason_score = 10000
802-
reject_reason = (f"Matched rule {rule_name}, but it was not reviewed yet by any of:" +
805+
reject_reason = (f"Matched rule {rule_name}, but PR #{pr.pr_num} was not reviewed yet by any of:" +
803806
f"{','.join(list(rule_approvers_set)[:5])}{', ...' if len(rule_approvers_set) > 5 else ''}")
804807
continue
805808
if rule.mandatory_checks_name is not None:

.github/scripts/tryrebase.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ def parse_args() -> Any:
1313
from argparse import ArgumentParser
1414
parser = ArgumentParser("Rebase PR into branch")
1515
parser.add_argument("--dry-run", action="store_true")
16+
parser.add_argument("--stable", action="store_true")
1617
parser.add_argument("pr_num", type=int)
1718
return parser.parse_args()
1819

1920

20-
def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
21+
def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None:
2122
branch = f"pull/{pr.pr_num}/head"
22-
onto_branch = pr.default_branch()
23+
onto_branch = "viable/strict" if stable else pr.default_branch()
2324
remote_url = f"https://github.com/{pr.info['headRepository']['nameWithOwner']}.git"
2425
refspec = f"{branch}:{pr.head_ref()}"
2526

@@ -39,11 +40,11 @@ def rebase_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
3940
"git pull --rebase`)", dry_run=dry_run)
4041

4142

42-
def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False) -> None:
43+
def rebase_ghstack_onto(pr: GitHubPR, repo: GitRepo, dry_run: bool = False, stable: bool = False) -> None:
4344
if subprocess.run([sys.executable, "-m", "ghstack", "--help"], capture_output=True).returncode != 0:
4445
subprocess.run([sys.executable, "-m", "pip", "install", "ghstack"])
4546
orig_ref = f"{re.sub(r'/head$', '/orig', pr.head_ref())}"
46-
onto_branch = pr.default_branch()
47+
onto_branch = "viable/strict" if stable else pr.default_branch()
4748

4849
repo.fetch(orig_ref, orig_ref)
4950
repo._run_git("rebase", onto_branch, orig_ref)
@@ -102,9 +103,9 @@ def main() -> None:
102103

103104
try:
104105
if pr.is_ghstack_pr():
105-
rebase_ghstack_onto(pr, repo, dry_run=args.dry_run)
106+
rebase_ghstack_onto(pr, repo, dry_run=args.dry_run, stable=args.stable)
106107
return
107-
rebase_onto(pr, repo, dry_run=args.dry_run)
108+
rebase_onto(pr, repo, dry_run=args.dry_run, stable=args.stable)
108109
except Exception as e:
109110
msg = f"Rebase failed due to {e}"
110111
run_url = os.getenv("GH_RUN_URL")

.github/workflows/tryrebase.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@ jobs:
3030
GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
3131
PR_NUM: ${{ github.event.client_payload.pr_num }}
3232
GH_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
33+
STABLE: ${{ github.event.client_payload.stable}}
3334
run: |
34-
python3 .github/scripts/tryrebase.py "${PR_NUM}"
35+
set -ex
36+
if [ -n "${STABLE}" ]; then
37+
python3 .github/scripts/tryrebase.py --stable "${PR_NUM}"
38+
else
39+
python3 .github/scripts/tryrebase.py "${PR_NUM}"
40+
fi

.github/xla_commit_hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7f96fbf6f7e37810a805c741416e7c54ae65c8cd
1+
e2357ba8d8d128ed9fbbc92bad62dd5df91d1240

.jenkins/pytorch/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ if [[ "$BUILD_ENVIRONMENT" == *-bazel-* ]]; then
196196

197197
get_bazel
198198

199-
# first build torch for CPU-only
200-
tools/bazel build --config=no-tty :torch
199+
# first build torch, the Python module, and tests for CPU-only
200+
tools/bazel build --config=no-tty :torch :_C.so :all_tests
201201
# then build everything with CUDA
202202
tools/bazel build --config=no-tty --config=gpu :all
203203
else

.jenkins/pytorch/win-test-helpers/build_pytorch.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ set PATH=C:\Program Files\CMake\bin;C:\Program Files\7-Zip;C:\ProgramData\chocol
1010
:: able to see what our cl.exe commands are (since you can actually
1111
:: just copy-paste them into a local Windows setup to just rebuild a
1212
:: single file.)
13-
set CMAKE_VERBOSE_MAKEFILE=1
13+
:: log sizes are too long, but leaving this here incase someone wants to use it locally
14+
:: set CMAKE_VERBOSE_MAKEFILE=1
1415

1516

1617
set INSTALLER_DIR=%SCRIPT_HELPERS_DIR%\installation-helpers

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ filegroup(
213213
"aten/src/ATen/native/cudnn/*.cpp",
214214
"aten/src/ATen/native/miopen/*.cpp",
215215
"aten/src/ATen/native/nested/cuda/*.cpp",
216+
"aten/src/ATen/native/quantized/cuda/*.cpp",
216217
"aten/src/ATen/native/quantized/cudnn/*.cpp",
217218
"aten/src/ATen/native/sparse/cuda/*.cpp",
218219
"aten/src/ATen/native/transformers/cuda/*.cpp",

aten/src/ATen/BatchingRegistrations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Tensor expand_batching_rule(const Tensor& self, IntArrayRef size, bool implicit)
182182
}
183183

184184
Tensor expand_batching_rule_symint(const Tensor& self, SymIntArrayRef psize, bool implicit) {
185-
return expand_batching_rule(self, expectIntArrayRef(psize), implicit);
185+
return expand_batching_rule(self, asIntArrayRefSlow(psize), implicit);
186186
}
187187

188188

0 commit comments

Comments
 (0)
0