Skip to content

Commit dc103d4

Browse files
authored
Merge pull request #14 from iotamudelta/master
merge from upstream
2 parents 5645923 + 91738d9 commit dc103d4

File tree

601 files changed

+17839
-9188
lines changed

Some content is hidden

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

601 files changed

+17839
-9188
lines changed

.gitattributes

Lines changed: 0 additions & 5 deletions
This file was deleted.

.jenkins/caffe2/test.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,24 @@ if [[ $BUILD_ENVIRONMENT == conda* ]]; then
9090
conda_ignore_test+=("--ignore $CAFFE2_PYPATH/python/operator_test/checkpoint_test.py")
9191
fi
9292
93-
# Python tests
94-
echo "Running Python tests.."
95-
"$PYTHON" \
96-
-m pytest \
97-
-x \
98-
-v \
99-
--junit-xml="$TEST_DIR/python/result.xml" \
100-
--ignore "$CAFFE2_PYPATH/python/test/executor_test.py" \
101-
--ignore "$CAFFE2_PYPATH/python/operator_test/matmul_op_test.py" \
102-
--ignore "$CAFFE2_PYPATH/python/operator_test/pack_ops_test.py" \
103-
--ignore "$CAFFE2_PYPATH/python/mkl/mkl_sbn_speed_test.py" \
104-
${conda_ignore_test[@]} \
105-
"$CAFFE2_PYPATH/python" \
106-
"${EXTRA_TESTS[@]}"
93+
94+
# TODO: re-enable this for rocm CI jobs once we have more rocm workers
95+
if [[ $BUILD_ENVIRONMENT != *rocm* ]]; then
96+
# Python tests
97+
echo "Running Python tests.."
98+
"$PYTHON" \
99+
-m pytest \
100+
-x \
101+
-v \
102+
--junit-xml="$TEST_DIR/python/result.xml" \
103+
--ignore "$CAFFE2_PYPATH/python/test/executor_test.py" \
104+
--ignore "$CAFFE2_PYPATH/python/operator_test/matmul_op_test.py" \
105+
--ignore "$CAFFE2_PYPATH/python/operator_test/pack_ops_test.py" \
106+
--ignore "$CAFFE2_PYPATH/python/mkl/mkl_sbn_speed_test.py" \
107+
${conda_ignore_test[@]} \
108+
"$CAFFE2_PYPATH/python" \
109+
"${EXTRA_TESTS[@]}"
110+
fi
107111
108112
if [[ -n "$INTEGRATED" ]]; then
109113
pip install --user pytest-xdist torchvision

.jenkins/pytorch/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [[ "$BUILD_ENVIRONMENT" == "pytorch-linux-xenial-py3-clang5-asan" ]]; then
55
fi
66

77
# TODO: move this to Docker
8-
# TODO: add both NCCL and MPI in CI test by fixing these test first
8+
# TODO: add both NCCL and MPI in CI test by fixing these test first
99
# sudo apt-get update
1010
# sudo apt-get install libnccl-dev libnccl2
1111
# sudo apt-get install openmpi-bin libopenmpi-dev
@@ -23,6 +23,9 @@ python --version
2323
echo "GCC version:"
2424
gcc --version
2525

26+
echo "CMake version:"
27+
cmake --version
28+
2629
# TODO: Don't run this...
2730
pip install -r requirements.txt || true
2831

.jenkins/pytorch/common.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,23 @@ if [[ "$BUILD_ENVIRONMENT" == *pytorch-linux-xenial-cuda9-cudnn7-py3 ]] || \
118118
else
119119
BUILD_TEST_LIBTORCH=0
120120
fi
121+
122+
# Use conda cmake in some CI build. Conda cmake will be newer than our supported
123+
# min version 3.5, so we only do it in two builds that we know should use conda.
124+
if [[ "$BUILD_ENVIRONMENT" == *pytorch-linux-xenial-cuda* ]]; then
125+
if [[ "$BUILD_ENVIRONMENT" == *cuda8-cudnn6-py2* ]] || \
126+
[[ "$BUILD_ENVIRONMENT" == *cuda9-cudnn7-py3* ]]; then
127+
if ! which conda; then
128+
echo "Expected ${BUILD_ENVIRONMENT} to use conda, but 'which conda' returns empty"
129+
exit 1
130+
else
131+
conda install -q -y cmake
132+
fi
133+
else
134+
if ! cmake --version | grep 'cmake version 3\.5'; then
135+
echo "Expected ${BUILD_ENVIRONMENT} to have cmake version 3.5.* (min support version), but 'cmake --version' returns:"
136+
cmake --version
137+
exit 1
138+
fi
139+
fi
140+
fi

.jenkins/pytorch/perf_test/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ get_runtime_of_command () {
1111

1212
# runtime=$( { time ($@ &> /dev/null); } 2>&1 1>/dev/null)
1313
runtime=$( { time $@; } 2>&1 1>/dev/null)
14-
if [[ $runtime == *"Warning"* ]] || [[ $runtime == *"Error"* ]]; then
14+
if [[ $runtime == *"Error"* ]]; then
1515
exit 1
1616
fi
1717
runtime=${runtime#+++ $@}

.jenkins/pytorch/win-build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ if not "%USE_CUDA%"=="0" (
139139
140140
python setup.py install && sccache --show-stats && (
141141
if "%BUILD_ENVIRONMENT%"=="" (
142-
echo "NOTE: To run `import torch`, please make sure to activate the conda environment by running `call C:\\Jenkins\\Miniconda3\\Scripts\\activate.bat C:\\Jenkins\\Miniconda3` in Command Prompt before running Git Bash."
142+
echo "NOTE: To run \`import torch\`, please make sure to activate the conda environment by running \`call C:\\Jenkins\\Miniconda3\\Scripts\\activate.bat C:\\Jenkins\\Miniconda3\` in Command Prompt before running Git Bash."
143143
) else (
144144
7z a %IMAGE_COMMIT_TAG%.7z C:\\Jenkins\\Miniconda3\\Lib\\site-packages\\torch && python ci_scripts\\upload_image.py %IMAGE_COMMIT_TAG%.7z
145145
)
@@ -148,4 +148,8 @@ if not "%USE_CUDA%"=="0" (
148148
149149
EOL
150150

151-
ci_scripts/build_pytorch.bat && echo "BUILD PASSED"
151+
ci_scripts/build_pytorch.bat
152+
if [ ! -f $IMAGE_COMMIT_TAG.7z ] && [ ! ${BUILD_ENVIRONMENT} == "" ]; then
153+
exit 1
154+
fi
155+
echo "BUILD PASSED"

CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
22
#cmake_policy(SET CMP0022 NEW)
33
#cmake_policy(SET CMP0023 NEW)
44

@@ -197,23 +197,27 @@ if(NOT MSVC)
197197
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
198198
# Eigen fails to build with some versions, so convert this to a warning
199199
# Details at http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1459
200-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-partial-specialization")
201200
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
202201
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
203202
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
204203
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-type-limits")
205-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-typedef-redefinition")
206-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
207204
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
208205
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-sign-compare")
209206
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
210207
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
211208
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
212-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
213209
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
214-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override")
215-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-aligned-allocation-unavailable")
216210
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")
211+
# These flags are not available in GCC-4.8.5. Set only when using clang.
212+
# Compared against https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Option-Summary.html
213+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
214+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-partial-specialization")
215+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-typedef-redefinition")
216+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
217+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
218+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override")
219+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-aligned-allocation-unavailable")
220+
endif()
217221
if ((APPLE AND (NOT ("${CLANG_VERSION_STRING}" VERSION_LESS "9.0")))
218222
OR (CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)))
219223
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -faligned-new")

CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020
/torch/csrc/distributed/ @apaszke @pietern @teng-li
2121
/torch/distributed/ @apaszke @pietern @teng-li
2222
/test/test_c10d.py @apaszke @pietern @teng-li
23-
/third_party/ @orionr
2423
/torch/utils/cpp_extension.py @goldsborough @fmassa @apaszke @soumith @ezyang

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ We are in an early-release beta. Expect some adventures and rough edges.
2727
| Linux GPU | [![Build Status](https://ci.pytorch.org/jenkins/job/pytorch-master/badge/icon)](https://ci.pytorch.org/jenkins/job/pytorch-master/) | [![Build Status](https://ci.pytorch.org/jenkins/job/pytorch-master/badge/icon)](https://ci.pytorch.org/jenkins/job/pytorch-master/) |
2828
| Windows GPU | <center>—</center> | [![Build Status](https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-win-ws2016-cuda9-cudnn7-py3-trigger/badge/icon)](https://ci.pytorch.org/jenkins/job/pytorch-builds/job/pytorch-win-ws2016-cuda9-cudnn7-py3-trigger/)
2929

30-
See also the [ci.pytorch.org HUD](https://ezyang.github.io/pytorch-ci-hud/build/pytorch-master)
30+
See also the [ci.pytorch.org HUD](https://ezyang.github.io/pytorch-ci-hud/build/pytorch-master).
3131

3232

3333
## More about PyTorch

aten/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,12 @@ set(TH_CPU_INCLUDE
8383
${CMAKE_CURRENT_SOURCE_DIR}/src/THC
8484
${CMAKE_CURRENT_BINARY_DIR}/src/TH
8585
${CMAKE_CURRENT_BINARY_DIR}/src/THC
86-
# sparse
87-
${CMAKE_CURRENT_SOURCE_DIR}/src/THS
88-
${CMAKE_CURRENT_SOURCE_DIR}/src/THCS
89-
${CMAKE_CURRENT_BINARY_DIR}/src/THS
90-
${CMAKE_CURRENT_BINARY_DIR}/src/THCS
9186

9287
${CMAKE_CURRENT_SOURCE_DIR}/src
9388
${CMAKE_CURRENT_BINARY_DIR}/src
9489
${CMAKE_BINARY_DIR}/aten/src)
9590
list(APPEND ATen_CPU_INCLUDE ${TH_CPU_INCLUDE})
9691
add_subdirectory(src/THNN)
97-
add_subdirectory(src/THS)
9892

9993
# Find the HIP package, set the HIP paths, load the HIP CMake.
10094
IF(USE_ROCM)
@@ -115,13 +109,11 @@ if(USE_ROCM)
115109
SET(AT_CUDA_ENABLED 1)
116110
add_subdirectory(src/THC)
117111
add_subdirectory(src/THCUNN)
118-
add_subdirectory(src/THCS)
119112
message("ROCm is enabled.")
120113
elseif(USE_CUDA)
121114
SET(AT_CUDA_ENABLED 1)
122115
add_subdirectory(src/THC)
123116
add_subdirectory(src/THCUNN)
124-
add_subdirectory(src/THCS)
125117
else()
126118
message("disabling CUDA because USE_CUDA is set false")
127119
SET(AT_CUDA_ENABLED 0)

aten/src/ATen/ATen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
#include "ATen/DeviceGuard.h"
2121
#include "ATen/TensorOptions.h"
2222
#include "ATen/Layout.h"
23+
#include "ATen/OptionsGuard.h"

aten/src/ATen/Allocator.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,4 @@ struct Allocator {
1313
virtual void deallocate(void* ptr) const = 0;
1414
};
1515

16-
namespace detail {
17-
18-
struct AllocatorRetainable : public Retainable {
19-
AllocatorRetainable(std::unique_ptr<Allocator> allocator)
20-
: allocator(std::move(allocator)) {}
21-
22-
void* allocate(size_t n) {
23-
return allocator->allocate(n);
24-
}
25-
void deallocate(void* ptr) {
26-
return allocator->deallocate(ptr);
27-
}
28-
private:
29-
std::unique_ptr<Allocator> allocator;
30-
};
31-
32-
} // namespace at::detail
33-
3416
} // namespace at

aten/src/ATen/Context.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
#include <mutex>
1313
#include <cstdint>
1414

15-
// Forwarde declare these CUDA types here to avoid including CUDA headers in
16-
// ATen headers, which would make ATen always require CUDA to build.
17-
struct THCState;
18-
struct CUstream_st;
19-
typedef struct CUstream_st *cudaStream_t;
20-
struct cudaDeviceProp;
21-
2215
namespace at {
2316

2417
enum class IsVariable {
@@ -91,6 +84,11 @@ class AT_API Context {
9184
cudaStream_t getCurrentCUDAStreamOnDevice(int64_t device) const {
9285
return detail::getCUDAHooks().getCurrentCUDAStreamOnDevice(thc_state.get(), device);
9386
}
87+
#ifndef __HIP_PLATFORM_HCC__
88+
cusparseHandle_t getCurrentCUDASparseHandle() const {
89+
return detail::getCUDAHooks().getCurrentCUDASparseHandle(thc_state.get());
90+
}
91+
#endif
9492
cudaDeviceProp* getCurrentDeviceProperties() const {
9593
return detail::getCUDAHooks().getCurrentDeviceProperties(thc_state.get());
9694
}

0 commit comments

Comments
 (0)