Skip to content

Commit 4a2d4fb

Browse files
author
Ailing Zhang
committed
merge with master
2 parents 5ea83b7 + 78a3765 commit 4a2d4fb

File tree

119 files changed

+2795
-1407
lines changed

Some content is hidden

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

119 files changed

+2795
-1407
lines changed

.circleci/cimodel/data/pytorch_build_data.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
("5.4", [
1717
XImportant("3.6"),
1818
("3.6", [
19-
("xla", [X(True)]),
19+
("xla", [XImportant(True)]),
2020
("namedtensor", [X(True)]),
2121
]),
2222
]),
@@ -147,6 +147,9 @@ def modify_label(self, label):
147147
def init2(self, node_name):
148148
self.props["is_xla"] = node_name
149149

150+
def child_constructor(self):
151+
return ImportantConfigNode
152+
150153

151154
class NamedTensorConfigNode(TreeConfigNode):
152155
def modify_label(self, label):
@@ -163,6 +166,9 @@ def modify_label(self, label):
163166
def init2(self, node_name):
164167
self.props["is_important"] = node_name
165168

169+
def get_children(self):
170+
return []
171+
166172

167173
class XenialCompilerConfigNode(TreeConfigNode):
168174

.circleci/config.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,16 +2438,10 @@ workflows:
24382438
- pytorch_xla_linux_trusty_py3_6_gcc5_4_build:
24392439
requires:
24402440
- setup
2441-
filters:
2442-
branches:
2443-
only: master
24442441
- pytorch_xla_linux_trusty_py3_6_gcc5_4_test:
24452442
requires:
24462443
- setup
24472444
- pytorch_xla_linux_trusty_py3_6_gcc5_4_build
2448-
filters:
2449-
branches:
2450-
only: master
24512445
- pytorch_namedtensor_linux_trusty_py3_6_gcc5_4_build:
24522446
requires:
24532447
- setup

.circleci/scripts/setup_linux_system_environment.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ done
2929
# See if we actually were successful
3030
systemctl list-units --all | cat
3131

32+
# For good luck, try even harder to kill apt-get
33+
sudo pkill apt-get || true
34+
35+
# For even better luck, purge unattended-upgrades
3236
sudo apt-get purge -y unattended-upgrades
3337

3438
cat /etc/apt/sources.list
3539

36-
# For good luck, try even harder to kill apt-get
37-
pkill apt-get || true
38-
3940
# Bail out early if we detect apt/dpkg is stuck
4041
ps auxfww | (! grep '[a]pt')
4142
ps auxfww | (! grep '[d]pkg')

.circleci/scripts/should_run_job.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env bash
22
set -exu -o pipefail
33

4-
echo "This check is currently disabled in favor of branch-based filtering"
5-
exit 0
6-
74
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
85

96
# Check if we should actually run

.jenkins/pytorch/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ test_libtorch() {
162162
python test/cpp/jit/tests_setup.py setup
163163
CPP_BUILD="$PWD/../cpp-build"
164164
if [[ "$BUILD_ENVIRONMENT" == *cuda* ]]; then
165-
"$CPP_BUILD"/caffe2/bin/test_jit
165+
"$CPP_BUILD"/caffe2/build/bin/test_jit
166166
else
167-
"$CPP_BUILD"/caffe2/bin/test_jit "[cpu]"
167+
"$CPP_BUILD"/caffe2/build/bin/test_jit "[cpu]"
168168
fi
169169
python test/cpp/jit/tests_setup.py shutdown
170170
python tools/download_mnist.py --quiet -d test/cpp/api/mnist
171-
OMP_NUM_THREADS=2 TORCH_CPP_TEST_MNIST_PATH="test/cpp/api/mnist" "$CPP_BUILD"/caffe2/bin/test_api
171+
OMP_NUM_THREADS=2 TORCH_CPP_TEST_MNIST_PATH="test/cpp/api/mnist" "$CPP_BUILD"/caffe2/build/bin/test_api
172172
assert_git_not_dirty
173173
fi
174174
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ if not "%USE_CUDA%"=="0" (
102102
if "%BUILD_ENVIRONMENT%"=="" (
103103
echo NOTE: To run `import torch`, please make sure to activate the conda environment by running `call %CONDA_PARENT_DIR%\Miniconda3\Scripts\activate.bat %CONDA_PARENT_DIR%\Miniconda3` in Command Prompt before running Git Bash.
104104
) else (
105-
mv %CD%\build\bin\test_api.exe %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch\lib
106105
7z a %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\torch %CONDA_PARENT_DIR%\Miniconda3\Lib\site-packages\caffe2 && python %SCRIPT_HELPERS_DIR%\upload_image.py %TMP_DIR_WIN%\%IMAGE_COMMIT_TAG%.7z
107106
)
108107
)

.jenkins/pytorch/win-test-helpers/download_image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python
2+
13
import os
24
import sys
35
import boto3
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
call %SCRIPT_HELPERS_DIR%\setup_pytorch_env.bat
22

3-
dir
4-
dir %TMP_DIR_WIN%\build
5-
dir %TMP_DIR_WIN%\build\torch
6-
dir %TMP_DIR_WIN%\build\torch\lib
7-
cd %TMP_DIR_WIN%\build\torch\lib
3+
cd %TMP_DIR_WIN%\build\torch\bin
84
set PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64;%TMP_DIR_WIN%\build\torch\lib;%PATH%
95
test_api.exe --gtest_filter="-IntegrationTest.MNIST*"
6+
7+
if errorlevel 1 exit /b 1

.jenkins/pytorch/win-test-helpers/upload_image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python
2+
13
import os
24
import sys
35
import boto3

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,39 @@ If the version of Visual Studio 2017 is higher than 15.4.5, installing of "VC++
212212
NVTX is a part of CUDA distributive, where it is called "Nsight Compute". For installing it onto already installed CUDA run CUDA installation once again and check the corresponding checkbox.
213213
Be sure that CUDA with Nsight Compute is installed after Visual Studio 2017.
214214

215+
Currently VS 2017, VS 2019 and Ninja are supported as the generator of CMake. If `ninja.exe` is detected in `PATH`, then Ninja will be used as the default generator, otherwise it will use VS 2017.
216+
<br/> If Ninja is selected as the generator, the latest MSVC which is newer than VS 2015 (14.0) will get selected as the underlying toolchain if you have Python > 3.5, otherwise VS 2015 will be selected so you'll have to activate the environment. If you use CMake <= 3.14.2 and has VS 2019 installed, then even if you specify VS 2017 as the generator, VS 2019 will get selected as the generator.
217+
218+
CUDA and MSVC has strong version dependencies, so even if you use VS 2017 / 2019, you will get build errors like `nvcc fatal : Host compiler targets unsupported OS`. For this kind of problem, please install the corresponding VS toolchain in the table below and then you can either specify the toolset during activation (recommended) or set `CUDAHOSTCXX` to override the cuda host compiler (not recommended if there are big version differences).
219+
220+
| CUDA version | Newest supported VS version |
221+
| ------------ | ------------------------------------------------------- |
222+
| 9.0 / 9.1 | Visual Studio 2017 Update 4 (15.4) (`_MSC_VER` <= 1911) |
223+
| 9.2 | Visual Studio 2017 Update 5 (15.5) (`_MSC_VER` <= 1912) |
224+
| 10.0 | Visual Studio 2017 (15.X) (`_MSC_VER` < 1920) |
225+
| 10.1 | Visual Studio 2019 (16.X) (`_MSC_VER` < 1930) |
226+
215227
```cmd
216228
cmd
217-
REM [Optional] The following two lines are needed for Python 2.7, but the support for it is very experimental.
229+
:: [Optional] Only add the next two lines if you need Python 2.7. If you use Python 3, ignore these two lines.
218230
set MSSdk=1
219231
set FORCE_PY27_BUILD=1
220232
221-
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
233+
:: [Optional] If you want to build with VS 2019 generator, please change the value in the next line to `Visual Studio 16 2019`.
234+
:: Note: This value is useless if Ninja is detected. However, you can force that by using `set USE_NINJA=OFF`.
235+
set CMAKE_GENERATOR=Visual Studio 15 2017
236+
237+
:: Read the content in the previous section carefully before you preceed.
238+
:: [Optional] If you want to override the underlying toolset used by Ninja and Visual Studio with CUDA, please run the following script block.
239+
:: "Visual Studio 2017 Developer Command Prompt" will be run automatically.
240+
:: Make sure you have CMake >= 3.12 before you do this when you use the Visual Studio generator.
241+
:: It's an essential step if you use Python 3.5.
242+
set CMAKE_GENERATOR_TOOLSET_VERSION=14.11
222243
set DISTUTILS_USE_SDK=1
244+
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=%CMAKE_GENERATOR_TOOLSET_VERSION%
223245
224-
REM Run "Visual Studio 2017 Developer Command Prompt"
225-
for /f "usebackq tokens=*" %i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [15^,16^) -products * -latest -property installationPath`) do call "%i\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
246+
:: [Optional] If you want to override the cuda host compiler
247+
set CUDAHOSTCXX=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\cl.exe
226248
227249
python setup.py install
228250

0 commit comments

Comments
 (0)