Skip to content

Commit 3cafda4

Browse files
committed
Code refactor (#4)
* Refactor the build config file * Minor fixes * Minor fixes * More fixes * Fixes on linux build task * Use simple if syntax * Fix wrong values * Change neq to ne * Change always to a normal expression * Fix indentation * Fix more indentions * . * . * Fix indention again * . * Use absolute path * . * Fix path issues * Fix if conditions * Revert conditions * Remove conditions for templates * Add quotes on strings * . * Fix syntax error * . * Fix if conditions * Fail build if no CUDA and fix cpu upload * Cleanup * Unify style * Unify if style Minor typo fix Another typo fix More typo fix Unify all booleans
1 parent afe6d7b commit 3cafda4

17 files changed

+444
-570
lines changed

windows/azure-pipelines.yml

Lines changed: 29 additions & 442 deletions
Large diffs are not rendered by default.

windows/cuda100.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ set NO_CUDA=
1717
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
1818

1919
IF "%NVTOOLSEXT_PATH%"=="" (
20-
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21-
set NO_CUDA=1
20+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing
21+
exit /b 1
2222
goto optcheck
2323
)
2424

2525
IF "%CUDA_PATH_V10_0%"=="" (
26-
echo CUDA 10.0 not found, disabling it
27-
set NO_CUDA=1
26+
echo CUDA 10.0 not found, failing
27+
exit /b 1
2828
) ELSE (
2929
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0;7.5
3030
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all

windows/cuda80.bat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ set NO_CUDA=
1717
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
1818

1919
IF "%NVTOOLSEXT_PATH%"=="" (
20-
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21-
set NO_CUDA=1
20+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing
21+
exit /b 1
2222
goto optcheck
2323
)
2424

2525
IF "%CUDA_PATH_V8_0%"=="" (
26-
echo CUDA 8 not found, disabling it
27-
set NO_CUDA=1
26+
echo CUDA 8 not found, failing
27+
exit /b 1
2828
) ELSE (
2929
IF "%VS140COMNTOOLS%"=="" (
30-
echo CUDA 8 found, but VS2015 not found, disabling it
31-
set NO_CUDA=1
30+
echo CUDA 8 found, but VS2015 not found, failing
31+
exit /b 1
3232
) ELSE (
3333
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1
3434
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all

windows/cuda90.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ set NO_CUDA=
1717
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
1818

1919
IF "%NVTOOLSEXT_PATH%"=="" (
20-
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21-
set NO_CUDA=1
20+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing
21+
exit /b 1
2222
goto optcheck
2323
)
2424

2525
IF "%CUDA_PATH_V9_0%"=="" (
26-
echo CUDA 9 not found, disabling it
27-
set NO_CUDA=1
26+
echo CUDA 9 not found, failing
27+
exit /b 1
2828
) ELSE (
2929
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;7.0
3030
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
@echo off
2-
3-
IF NOT EXIST "setup.py" IF NOT EXIST "pytorch" (
4-
call internal\clone.bat
5-
cd ..
6-
IF ERRORLEVEL 1 goto eof
7-
) ELSE (
8-
call internal\clean.bat
9-
)
10-
11-
call internal\check_deps.bat
12-
IF ERRORLEVEL 1 goto eof
13-
14-
REM Check for optional components
15-
16-
set NO_CUDA=
17-
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
18-
19-
IF "%NVTOOLSEXT_PATH%"=="" (
20-
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21-
set NO_CUDA=1
22-
goto optcheck
23-
)
24-
25-
IF "%CUDA_PATH_V9_1%"=="" (
26-
echo CUDA 9.1 not found, disabling it
27-
set NO_CUDA=1
28-
) ELSE (
29-
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0
30-
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
31-
32-
set "CUDA_PATH=%CUDA_PATH_V9_1%"
33-
set "PATH=%CUDA_PATH_V9_1%\bin;%PATH%"
34-
)
35-
36-
:optcheck
37-
38-
call internal\check_opts.bat
39-
IF ERRORLEVEL 1 goto eof
40-
41-
call internal\copy.bat
42-
IF ERRORLEVEL 1 goto eof
43-
44-
call internal\setup.bat
45-
IF ERRORLEVEL 1 goto eof
46-
47-
:eof
1+
@echo off
2+
3+
IF NOT EXIST "setup.py" IF NOT EXIST "pytorch" (
4+
call internal\clone.bat
5+
cd ..
6+
IF ERRORLEVEL 1 goto eof
7+
) ELSE (
8+
call internal\clean.bat
9+
)
10+
11+
call internal\check_deps.bat
12+
IF ERRORLEVEL 1 goto eof
13+
14+
REM Check for optional components
15+
16+
set NO_CUDA=
17+
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
18+
19+
IF "%NVTOOLSEXT_PATH%"=="" (
20+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21+
set NO_CUDA=1
22+
goto optcheck
23+
)
24+
25+
IF "%CUDA_PATH_V9_1%"=="" (
26+
echo CUDA 9.1 not found, disabling it
27+
set NO_CUDA=1
28+
) ELSE (
29+
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0
30+
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
31+
32+
set "CUDA_PATH=%CUDA_PATH_V9_1%"
33+
set "PATH=%CUDA_PATH_V9_1%\bin;%PATH%"
34+
)
35+
36+
:optcheck
37+
38+
call internal\check_opts.bat
39+
IF ERRORLEVEL 1 goto eof
40+
41+
call internal\copy.bat
42+
IF ERRORLEVEL 1 goto eof
43+
44+
call internal\setup.bat
45+
IF ERRORLEVEL 1 goto eof
46+
47+
:eof
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
@echo off
2-
3-
IF NOT EXIST "setup.py" IF NOT EXIST "pytorch" (
4-
call internal\clone.bat
5-
cd ..
6-
IF ERRORLEVEL 1 goto eof
7-
) ELSE (
8-
call internal\clean.bat
9-
)
10-
11-
call internal\check_deps.bat
12-
IF ERRORLEVEL 1 goto eof
13-
14-
REM Check for optional components
15-
16-
set NO_CUDA=
17-
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
18-
19-
IF "%NVTOOLSEXT_PATH%"=="" (
20-
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21-
set NO_CUDA=1
22-
goto optcheck
23-
)
24-
25-
IF "%CUDA_PATH_V9_2%"=="" (
26-
echo CUDA 9.2 not found, disabling it
27-
set NO_CUDA=1
28-
) ELSE (
29-
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0
30-
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
31-
32-
set "CUDA_PATH=%CUDA_PATH_V9_2%"
33-
set "PATH=%CUDA_PATH_V9_2%\bin;%PATH%"
34-
)
35-
36-
:optcheck
37-
38-
call internal\check_opts.bat
39-
IF ERRORLEVEL 1 goto eof
40-
41-
call internal\copy.bat
42-
IF ERRORLEVEL 1 goto eof
43-
44-
call internal\setup.bat
45-
IF ERRORLEVEL 1 goto eof
46-
47-
:eof
1+
@echo off
2+
3+
IF NOT EXIST "setup.py" IF NOT EXIST "pytorch" (
4+
call internal\clone.bat
5+
cd ..
6+
IF ERRORLEVEL 1 goto eof
7+
) ELSE (
8+
call internal\clean.bat
9+
)
10+
11+
call internal\check_deps.bat
12+
IF ERRORLEVEL 1 goto eof
13+
14+
REM Check for optional components
15+
16+
set NO_CUDA=
17+
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
18+
19+
IF "%NVTOOLSEXT_PATH%"=="" (
20+
echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, disabling CUDA
21+
set NO_CUDA=1
22+
goto optcheck
23+
)
24+
25+
IF "%CUDA_PATH_V9_2%"=="" (
26+
echo CUDA 9.2 not found, disabling it
27+
set NO_CUDA=1
28+
) ELSE (
29+
set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0
30+
set TORCH_NVCC_FLAGS=-Xfatbin -compress-all
31+
32+
set "CUDA_PATH=%CUDA_PATH_V9_2%"
33+
set "PATH=%CUDA_PATH_V9_2%\bin;%PATH%"
34+
)
35+
36+
:optcheck
37+
38+
call internal\check_opts.bat
39+
IF ERRORLEVEL 1 goto eof
40+
41+
call internal\copy.bat
42+
IF ERRORLEVEL 1 goto eof
43+
44+
call internal\setup.bat
45+
IF ERRORLEVEL 1 goto eof
46+
47+
:eof

windows/templates/auth_task.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
jobs:
2+
- job: 'VSTS_Auth_Task'
3+
timeoutInMinutes: 5
4+
cancelTimeoutInMinutes: 5
5+
variables:
6+
- group: 'peterjc-vsts-token'
7+
8+
pool:
9+
vmImage: 'win1803'
10+
11+
steps:
12+
- checkout: self
13+
clean: true
14+
15+
- template: vsts_auth.yml
16+
parameters:
17+
auth: $(vsts_auth)

windows/templates/build_conda.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
parameters:
2+
msagent: false
3+
4+
steps:
5+
- script: 'if not exist %PYTORCH_FINAL_PACKAGE_DIR% mkdir %PYTORCH_FINAL_PACKAGE_DIR%'
6+
displayName: 'Create final package directory'
7+
8+
- bash: './conda/build_pytorch.sh $CUDA_VERSION $PYTORCH_BUILD_VERSION $PYTORCH_BUILD_NUMBER'
9+
displayName: Build
10+
env:
11+
${{ if eq(parameters.msagent, 'true') }}:
12+
MAX_JOBS: 2

0 commit comments

Comments
 (0)