Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pytorch/pytorch into peter/…
Browse files Browse the repository at this point in the history
…cumulativeops
  • Loading branch information
Mr4k committed Aug 1, 2023
2 parents 13ff5a3 + 6d2162e commit cca389b
Show file tree
Hide file tree
Showing 568 changed files with 30,965 additions and 13,045 deletions.
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/triton.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9e3e10c5edb4a062cf547ae73e6ebfb19aad7bdf
e6216047b8b0aef1fe8da6ca8667a3ad0a016411
14 changes: 0 additions & 14 deletions .ci/docker/common/install_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,6 @@ install_ubuntu() {
# see: https://github.com/pytorch/pytorch/issues/65931
apt-get install -y libgnutls30

# cuda-toolkit does not work with gcc-11.2.0 which is default in Ubunutu 22.04
# see: https://github.com/NVlabs/instant-ngp/issues/119
if [[ "$UBUNTU_VERSION" == "22.04"* ]]; then
apt-get install -y g++-10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30
update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-10 30

# https://www.spinics.net/lists/libreoffice/msg07549.html
sudo rm -rf /usr/lib/gcc/x86_64-linux-gnu/11
wget https://github.com/gcc-mirror/gcc/commit/2b2d97fc545635a0f6aa9c9ee3b017394bc494bf.patch -O noexecpt.patch
sudo patch /usr/include/c++/10/bits/range_access.h noexecpt.patch
fi

# Cleanup package manager
apt-get autoclean && apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
2 changes: 1 addition & 1 deletion .ci/docker/common/install_docs_reqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ -n "$KATEX" ]; then
# Ignore error if gpg-agent doesn't exist (for Ubuntu 16.04)
apt-get install -y gpg-agent || :

curl --retry 3 -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl --retry 3 -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

curl --retry 3 -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Expand Down
40 changes: 20 additions & 20 deletions .ci/pytorch/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ test_dynamo_shard() {
test_fx \
test_package \
test_legacy_vmap \
test_custom_op_testing \
test_custom_ops \
test_content_store \
export/test_db \
functorch/test_dims \
Expand Down Expand Up @@ -666,7 +666,7 @@ test_distributed() {
time python test/run_test.py --distributed-tests --shard "$SHARD_NUMBER" "$NUM_TEST_SHARDS" --verbose
assert_git_not_dirty

if [[ "$BUILD_ENVIRONMENT" == *cuda* && "$SHARD_NUMBER" == 1 ]]; then
if [[ ("$BUILD_ENVIRONMENT" == *cuda* || "$BUILD_ENVIRONMENT" == *rocm*) && "$SHARD_NUMBER" == 1 ]]; then
echo "Testing distributed C++ tests"
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
ln -sf "$TORCH_LIB_DIR"/libc10* "$TORCH_BIN_DIR"
Expand All @@ -678,30 +678,30 @@ test_distributed() {
python test/run_test.py --cpp --verbose -i cpp/HashStoreTest
python test/run_test.py --cpp --verbose -i cpp/TCPStoreTest

MPIEXEC=$(command -v mpiexec)
if [[ -n "$MPIEXEC" ]]; then
# NB: mpiexec only works directly with the C++ test binary here
MPICMD="${MPIEXEC} -np 2 $TORCH_BIN_DIR/ProcessGroupMPITest"
eval "$MPICMD"
fi
if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then
MPIEXEC=$(command -v mpiexec)
if [[ -n "$MPIEXEC" ]]; then
# NB: mpiexec only works directly with the C++ test binary here
MPICMD="${MPIEXEC} -np 2 $TORCH_BIN_DIR/ProcessGroupMPITest"
eval "$MPICMD"
fi

python test/run_test.py --cpp --verbose -i cpp/ProcessGroupGlooTest
python test/run_test.py --cpp --verbose -i cpp/ProcessGroupNCCLTest
python test/run_test.py --cpp --verbose -i cpp/ProcessGroupNCCLErrorsTest
python test/run_test.py --cpp --verbose -i cpp/ProcessGroupGlooTest
python test/run_test.py --cpp --verbose -i cpp/ProcessGroupNCCLTest
python test/run_test.py --cpp --verbose -i cpp/ProcessGroupNCCLErrorsTest
fi
fi
}

test_rpc() {
if [[ "$BUILD_ENVIRONMENT" != *rocm* ]]; then
echo "Testing RPC C++ tests"
# NB: the ending test_rpc must match the current function name for the current
# test reporting process to function as expected.
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
ln -sf "$TORCH_LIB_DIR"/libc10* "$TORCH_BIN_DIR"
ln -sf "$TORCH_LIB_DIR"/libtbb* "$TORCH_BIN_DIR"
echo "Testing RPC C++ tests"
# NB: the ending test_rpc must match the current function name for the current
# test reporting process to function as expected.
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
ln -sf "$TORCH_LIB_DIR"/libc10* "$TORCH_BIN_DIR"
ln -sf "$TORCH_LIB_DIR"/libtbb* "$TORCH_BIN_DIR"

CPP_TESTS_DIR="${TORCH_BIN_DIR}" python test/run_test.py --cpp --verbose -i cpp/test_cpp_rpc
fi
CPP_TESTS_DIR="${TORCH_BIN_DIR}" python test/run_test.py --cpp --verbose -i cpp/test_cpp_rpc
}

test_custom_backend() {
Expand Down
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
-performance-unnecessary-value-param,
readability-container-size-empty,
'
HeaderFilterRegex: '^(c10/(?!test)|torch/csrc/(?!deploy/interpreter/cpython)).*$'
Expand Down
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ e3900d2ba5c9f91a24a9ce34520794c8366d5c54
30fb2c4abaaaa966999eab11674f25b18460e609
# 2023-06-06 clang-format on Foreach / Multi-Tensor-Apply
515c4279416f13fcc3c898e560f8ae8f15139a03
# 2023-07-25 Apply UFMT to all files in benchmarks
dd3a77bc965adf9fe8ba582ee13bb7f14c9661b0
# 2023-07-26 Enable UFMT on a bunch of low traffic Python files outside of main files
f70844bec783bfce43c950ccf180dc494e86f2bf
# 2023-07-28 Apply UFMT to all non test/torch files
e6ec0efaf87703c5f889cfc20b29be455885d58d
# 2023-07-31 [optim][BE] split test file into logical parts: SWA, LR, optim
a53cda1ddc15336dc1ff0ce1eff2a49cdc5f882e
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/vision.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc0f9d02e1e7549e9e8ef1081a0d3b5d72f1297d
bdf16222f7e734f81af0f6ea6a5f413c7b353237
2 changes: 1 addition & 1 deletion .github/ci_commit_pins/xla.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f5edcb2088195db71bcd36d0f8f1b6a5e663afd8
ca5eab87a71f80cd3168630511d02549cc7d2516
5 changes: 4 additions & 1 deletion .github/scripts/gitutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def fuzzy_list_to_dict(items: List[Tuple[str, str]]) -> Dict[str, List[str]]:
"""
Converts list to dict preserving elements with duplicate keys
"""
rc: Dict[str, List[str]] = defaultdict(lambda: [])
rc: Dict[str, List[str]] = defaultdict(list)
for key, val in items:
rc[key].append(val)
return dict(rc)
Expand All @@ -53,6 +53,9 @@ def _check_output(items: List[str], encoding: str = "utf-8") -> str:
msg = f"Command `{' '.join(e.cmd)}` returned non-zero exit code {e.returncode}"
stdout = e.stdout.decode(encoding) if e.stdout is not None else ""
stderr = e.stderr.decode(encoding) if e.stderr is not None else ""
# These get swallowed up, so print them here for debugging
print(f"stdout: \n{stdout}")
print(f"stderr: \n{stderr}")
if len(stderr) == 0:
msg += f"\n```\n{stdout}```"
else:
Expand Down

0 comments on commit cca389b

Please sign in to comment.