Skip to content

Commit 1e921b8

Browse files
authored
Refactor and fix windows smoke tests (#1218)
* Fix windows smoke test * Fix first if statement * Refactor not to cal install nightly package * Revert "Refactor not to cal install nightly package" This reverts commit ac580c8. * Fix pip install command remove cu102 * Refacor the conda installation
1 parent 49980e3 commit 1e921b8

File tree

2 files changed

+12
-102
lines changed

2 files changed

+12
-102
lines changed

windows/internal/install_nightly_package.bat

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

windows/internal/smoke_test.bat

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,8 @@ set "PATH=%CD%\Python%PYTHON_VERSION%\Scripts;%CD%\Python;%PATH%"
5151
pip install -q numpy protobuf "mkl>=2019"
5252
if errorlevel 1 exit /b 1
5353

54-
if "%TEST_NIGHTLY_PACKAGE%" == "1" (
55-
call internal\install_nightly_package.bat
56-
if errorlevel 1 exit /b 1
57-
) else (
58-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.whl') do pip install "%%i"
59-
if errorlevel 1 exit /b 1
60-
)
54+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.whl') do pip install "%%i"
55+
if errorlevel 1 exit /b 1
6156

6257
goto smoke_test
6358

@@ -69,17 +64,14 @@ set "CONDA_HOME=%CD%\conda"
6964
set "tmp_conda=%CONDA_HOME%"
7065
set "miniconda_exe=%CD%\miniconda.exe"
7166
set "CONDA_EXTRA_ARGS="
72-
if "%CUDA_VERSION%" == "115" (
73-
set "CONDA_EXTRA_ARGS=-c=nvidia"
74-
)
7567
if "%CUDA_VERSION%" == "116" (
76-
set "CONDA_EXTRA_ARGS=-c=nvidia"
68+
set "CONDA_EXTRA_ARGS=pytorch-cuda=11.6 -c nvidia -c pytorch-nightly"
7769
)
7870
if "%CUDA_VERSION%" == "117" (
79-
set "CONDA_EXTRA_ARGS=-c=nvidia"
71+
set "CONDA_EXTRA_ARGS=pytorch-cuda=11.7 -c nvidia -c pytorch-nightly"
8072
)
8173
if "%CUDA_VERSION%" == "118" (
82-
set "CONDA_EXTRA_ARGS=-c=nvidia"
74+
set "CONDA_EXTRA_ARGS=pytorch-cuda=11.8 -c nvidia -c pytorch-nightly"
8375
)
8476

8577
rmdir /s /q conda
@@ -96,35 +88,25 @@ if errorlevel 1 exit /b 1
9688
call %CONDA_HOME%\condabin\activate.bat testenv
9789
if errorlevel 1 exit /b 1
9890

99-
call conda update -n base -y -c defaults conda
100-
101-
call conda install %CONDA_EXTRA_ARGS% -yq protobuf numpy
91+
:: do conda install to make sure all the dependencies are installed
92+
call conda install -yq pytorch %CONDA_EXTRA_ARGS%
10293
if ERRORLEVEL 1 exit /b 1
10394

10495
set /a CUDA_VER=%CUDA_VERSION%
10596
set CUDA_VER_MAJOR=%CUDA_VERSION:~0,-1%
10697
set CUDA_VER_MINOR=%CUDA_VERSION:~-1,1%
10798
set CUDA_VERSION_STR=%CUDA_VER_MAJOR%.%CUDA_VER_MINOR%
10899

109-
if "%TEST_NIGHTLY_PACKAGE%" == "1" (
110-
call internal\install_nightly_package.bat
111-
if errorlevel 1 exit /b 1
112-
goto smoke_test
113-
)
114-
115-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install %CONDA_EXTRA_ARGS% -y "%%i" --offline
100+
:: Install package we just build
101+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install -yq "%%i" --offline
116102
if ERRORLEVEL 1 exit /b 1
117103

118104
if "%CUDA_VERSION%" == "cpu" goto install_cpu_torch
119105

120-
:: We do an update --all here since that will install the dependencies for any package that's installed offline
121-
call conda update --all %CONDA_EXTRA_ARGS% -y -c pytorch -c defaults -c numba/label/dev
122-
if ERRORLEVEL 1 exit /b 1
123-
124106
goto smoke_test
125107

126108
:install_cpu_torch
127-
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch
109+
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch-nightly
128110
if ERRORLEVEL 1 exit /b 1
129111

130112
:smoke_test
@@ -168,13 +150,8 @@ echo "install and test libtorch"
168150
if "%VC_YEAR%" == "2017" powershell internal\vs2017_install.ps1
169151
if ERRORLEVEL 1 exit /b 1
170152

171-
if "%TEST_NIGHTLY_PACKAGE%" == "1" (
172-
call internal\install_nightly_package.bat
173-
if errorlevel 1 exit /b 1
174-
) else (
175-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
176-
if ERRORLEVEL 1 exit /b 1
177-
)
153+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
154+
if ERRORLEVEL 1 exit /b 1
178155

179156
pushd tmp\libtorch
180157

0 commit comments

Comments
 (0)