Skip to content

Commit

Permalink
Merge branch 'minjean/mkldnn_tbb_support' of https://github.com/min-j…
Browse files Browse the repository at this point in the history
…ean-cho/pytorch into minjean/mkldnn_tbb_support
  • Loading branch information
min-jean-cho committed Oct 25, 2022
2 parents 45aa7e0 + e06e3fa commit 8d6a1a3
Show file tree
Hide file tree
Showing 151 changed files with 17,983 additions and 1,136 deletions.
1 change: 1 addition & 0 deletions .github/ci_commit_pins/huggingface.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ebee0a27940adfbb30444d83387b9ea0f1173f40
1 change: 1 addition & 0 deletions .github/ci_commit_pins/timm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ebee0a27940adfbb30444d83387b9ea0f1173f40
1 change: 1 addition & 0 deletions .github/ci_commit_pins/torchbench.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24b95f2f627bf07a61cefed653419389a7586357
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/xla.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e1f5a49664b904e3ec1ddb9095ca75b6bbb5c10d
eff277e81fcfdeccba71e75ff40b6e2f3e29e27b
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
"module: inductor":
- torch/_inductor/**
- test/inductor/**

"ciflow/inductor":
- torch/_dynamo/**
- torch/_inductor/**
- benchmarks/dynamo/**
2 changes: 2 additions & 0 deletions .github/requirements-gha-cache.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
# docs/cpp/requirements.txt
# functorch/docs/requirements.txt
# .circleci/docker/requirements-ci.txt
boto3==1.19.12
cffi==1.15.0
dataclasses==0.6
jinja2==3.0.1
lintrunner==0.9.2
ninja==1.10.0.post1
pynvml==11.4.1
pyyaml==6.0
requests==2.26
rich==10.9.0
rockset==0.8.10
84 changes: 84 additions & 0 deletions .github/scripts/check_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env python3
"""check_labels.py"""

from typing import Any, List
from datetime import datetime, timedelta

from export_pytorch_labels import get_pytorch_labels
from gitutils import (
get_git_remote_name,
get_git_repo_dir,
GitRepo,
)
from trymerge import (
_fetch_url,
gh_post_pr_comment,
GitHubPR,
)


BOT_AUTHORS = ["github-actions", "pytorchmergebot", "pytorch-bot"]

ERR_MSG_TITLE = "This PR needs a label"
ERR_MSG = (
f"# {ERR_MSG_TITLE}\n"
"If your changes are user facing and intended to be a part of release notes, please use a label starting with `release notes:`.\n\n" # noqa: E501 pylint: disable=line-too-long
"If not, please add the `topic: not user facing` label.\n\n"
"For more information, see https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work." # noqa: E501 pylint: disable=line-too-long
)


def get_release_notes_labels() -> List[str]:
return [label for label in get_pytorch_labels() if label.lstrip().startswith("release notes:")]


def delete_comment(comment_id: int) -> None:
url = f"https://api.github.com/repos/pytorch/pytorch/issues/comments/{comment_id}"
_fetch_url(url, method="DELETE")


def has_required_labels(pr: GitHubPR) -> bool:
pr_labels = pr.get_labels()

# Check if PR is not user facing
is_not_user_facing_pr = any(label.strip() == "topic: not user facing" for label in pr_labels)
if is_not_user_facing_pr:
return True

# Check if bot has already posted a message within the past hour to include a release notes label
for comment in pr.get_comments():
if comment.body_text.lstrip(" #").startswith(ERR_MSG_TITLE) and comment.author_login in BOT_AUTHORS:
ts = datetime.strptime(comment.created_at, "%Y-%m-%dT%H:%M:%SZ")
if (datetime.utcnow() - ts) < timedelta(hours=1):
return True
delete_comment(comment.database_id)
break

return any(label.strip() in get_release_notes_labels() for label in pr_labels)


def parse_args() -> Any:
from argparse import ArgumentParser
parser = ArgumentParser("Check PR labels")
parser.add_argument("pr_num", type=int)

return parser.parse_args()


def main() -> None:
args = parse_args()
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
org, project = repo.gh_owner_and_name()
pr = GitHubPR(org, project, args.pr_num)

try:
if not has_required_labels(pr):
print(ERR_MSG)
gh_post_pr_comment(pr.org, pr.project, pr.pr_num, ERR_MSG)
exit(1)
except Exception as e:
pass


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions .github/scripts/filter_test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dynamo",
"force_on_cpu",
"functorch",
"inductor",
"jit_legacy",
"multigpu",
"nogpu_AVX512",
Expand Down
Loading

0 comments on commit 8d6a1a3

Please sign in to comment.