Skip to content

Commit

Permalink
Update on "Support different NSE in batches of CSR and CSC tensors"
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
pearu committed Sep 11, 2022
2 parents cf6565a + 2e51cbb commit 27a47f1
Show file tree
Hide file tree
Showing 396 changed files with 12,129 additions and 7,966 deletions.
2 changes: 1 addition & 1 deletion .circleci/cimodel/data/simple/util/branch_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

RC_PATTERN = r"/v[0-9]+(\.[0-9]+)*-rc[0-9]+/"

MAC_IOS_EXCLUSION_LIST = ["master", "nightly", "postnightly"]
MAC_IOS_EXCLUSION_LIST = ["nightly", "postnightly"]


def gen_filter_dict(
Expand Down
65 changes: 57 additions & 8 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .circleci/docker/common/install_ucc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function install_ucc() {
git submodule update --init --recursive

./autogen.sh
./configure --prefix=$UCC_HOME --with-ucx=$UCX_HOME --with-nccl=no --with-cuda=$with_cuda
./configure --prefix=$UCC_HOME --with-ucx=$UCX_HOME --with-cuda=$with_cuda
time make -j
sudo make install

Expand Down
2 changes: 2 additions & 0 deletions .circleci/generate_config_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import cimodel.data.simple.anaconda_prune_defintions
import cimodel.data.simple.macos_definitions
import cimodel.data.simple.upload_test_stats_definition
import cimodel.data.simple.ios_definitions
import cimodel.lib.miniutils as miniutils
import cimodel.lib.miniyaml as miniyaml

Expand Down Expand Up @@ -144,6 +145,7 @@ def gen_build_workflows_tree():
cimodel.data.simple.anaconda_prune_defintions.get_workflow_jobs,
cimodel.data.simple.macos_definitions.get_new_workflow_jobs,
cimodel.data.simple.upload_test_stats_definition.get_workflow_job,
cimodel.data.simple.ios_definitions.get_workflow_jobs,
]
build_jobs = [f() for f in build_workflows_functions]
build_jobs.extend(
Expand Down
35 changes: 34 additions & 1 deletion .circleci/verbatim-sources/job-specs/job-specs-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,40 @@
macos:
xcode: "12.5.1"
steps:
- checkout
- run:
name: checkout with retry
command: |
checkout() {
set -ex
# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
export HOME=$(getent passwd $(id -un) | cut -d: -f6)
fi
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
' >> ~/.ssh/known_hosts
# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true
echo 'Cloning git repository'
mkdir -p '/Users/distiller/project'
cd '/Users/distiller/project'
git clone "$CIRCLE_REPOSITORY_URL" .
echo 'Checking out branch'
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
}
retry () {
$* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*)
}
retry checkout
- run_brew_for_ios_build
- run:
name: Run Fastlane
Expand Down
13 changes: 12 additions & 1 deletion .github/actions/teardown-linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ runs:
# Always hold for active ssh sessions
shell: bash
if: inputs.skip-wait-ssh == ''
run: .github/scripts/wait_for_ssh_to_drain.sh
run: |
set -eou pipefail
echo "Holding runner for 2 hours until all ssh sessions have logged out"
for _ in $(seq 1440); do
# Break if no ssh session exists anymore
if [ "$(who)" = "" ]; then
break
fi
echo "."
sleep 5
done
- name: Kill containers, clean up images
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/torchdynamo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a2cc6466fc0793414e56674ea1d37d1c875b74bf
ffd056dc1510bdfecafb689ed87601055694f3e6
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/vision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9c3e2bf46bc49997679785d76b7d0a9fea0223c7
a67cc87a33a3f713aebf5299bdeb2672c98e0bc5
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/xla.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b8688ee3c03120a15978844db6c4fa73eceb6594
f00dd2f35ecf6455d97237d63c70c9c8ec190940
69 changes: 0 additions & 69 deletions .github/scale-config.yml

This file was deleted.

40 changes: 39 additions & 1 deletion .github/scripts/run_torchbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# 1. Does not reuse the build artifact in other CI workflows
# 2. CI jobs are serialized because there is only one worker
import os
import boto3 # type: ignore[import]
import git # type: ignore[import]
import pathlib
import argparse
import subprocess
from pathlib import Path

from typing import List, Tuple

Expand All @@ -31,6 +33,25 @@
direction: decrease
timeout: 720
tests:"""
S3_BUCKET = "ossci-metrics"
S3_PREFIX = "torchbench-pr-test"
S3_URL_BASE = f"https://{S3_BUCKET}.s3.amazonaws.com/"

class S3Client:
def __init__(self, bucket: str = S3_BUCKET, prefix: str = S3_PREFIX):
self.s3 = boto3.client('s3')
self.resource = boto3.resource('s3')
self.bucket = bucket
self.prefix = prefix

def upload_file(self, file_path: Path, filekey_prefix: str) -> None:
assert file_path.is_file(), f"Specified file path {file_path} does not exist or not file."
file_name = file_path.name
s3_key = f"{self.prefix}/{filekey_prefix}/{file_name}"
print(f"Uploading file {file_name} to S3 with key: {s3_key}")
self.s3.upload_file(str(file_path), self.bucket, s3_key)
# output the result URL
print(f"Uploaded the result file {file_name} to {S3_URL_BASE}{s3_key}")

def gen_abtest_config(control: str, treatment: str, models: List[str]) -> str:
d = {}
Expand Down Expand Up @@ -137,9 +158,21 @@ def run_userbenchmarks(pytorch_path: str, torchbench_path: str, base_sha: str, h
print(f"Running torchbench userbenchmark command: {command}")
subprocess.check_call(command, cwd=torchbench_path, env=env)

def process_upload_s3(result_dir: str) -> None:
# validate result directory
result_dir_path = Path(result_dir)
assert result_dir_path.exists(), f"Specified result directory {result_dir} doesn't exist."
# upload all files to S3 bucket oss-ci-metrics
files = [x for x in result_dir_path.iterdir() if x.is_file()]
# upload file to S3 bucket
s3_client: S3Client = S3Client()
filekey_prefix = result_dir_path.name
for f in files:
s3_client.upload_file(f, filekey_prefix)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Run TorchBench tests based on PR')
parser.add_argument('--pr-body', required=True, help="The file that contains body of a Pull Request")
parser.add_argument('--pr-body', help="The file that contains body of a Pull Request")

subparsers = parser.add_subparsers(dest='command')
# parser for setup the torchbench branch name env
Expand All @@ -151,6 +184,9 @@ def run_userbenchmarks(pytorch_path: str, torchbench_path: str, base_sha: str, h
run_parser.add_argument('--pr-head-sha', required=True, type=str, help="The Pull Request head hash")
run_parser.add_argument('--pytorch-path', required=True, type=str, help="Path to pytorch repository")
run_parser.add_argument('--torchbench-path', required=True, type=str, help="Path to TorchBench repository")
# parser to upload results to S3
upload_parser = subparsers.add_parser("upload-s3")
upload_parser.add_argument('--result-dir', required=True, type=str, help="Path to benchmark output")
args = parser.parse_args()

if args.command == 'set-torchbench-branch':
Expand Down Expand Up @@ -181,6 +217,8 @@ def run_userbenchmarks(pytorch_path: str, torchbench_path: str, base_sha: str, h
if not models and not userbenchmarks:
print("Can't parse valid models or userbenchmarks from the pr body. Quit.")
exit(-1)
elif args.command == 'upload-s3':
process_upload_s3(args.result_dir)
else:
print(f"The command {args.command} is not supported.")
exit(-1)

0 comments on commit 27a47f1

Please sign in to comment.