Skip to content

Commit d08f226

Browse files
authored
Refactor and fix windows smoke tests (#1218) (#1222)
* 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 452327b commit d08f226

File tree

2 files changed

+11
-101
lines changed

2 files changed

+11
-101
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: 11 additions & 34 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,14 +64,11 @@ 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

8274
rmdir /s /q conda
@@ -93,35 +85,25 @@ if errorlevel 1 exit /b 1
9385
call %CONDA_HOME%\condabin\activate.bat testenv
9486
if errorlevel 1 exit /b 1
9587

96-
call conda update -n base -y -c defaults conda
97-
98-
call conda install %CONDA_EXTRA_ARGS% -yq protobuf numpy
88+
:: do conda install to make sure all the dependencies are installed
89+
call conda install -yq pytorch %CONDA_EXTRA_ARGS%
9990
if ERRORLEVEL 1 exit /b 1
10091

10192
set /a CUDA_VER=%CUDA_VERSION%
10293
set CUDA_VER_MAJOR=%CUDA_VERSION:~0,-1%
10394
set CUDA_VER_MINOR=%CUDA_VERSION:~-1,1%
10495
set CUDA_VERSION_STR=%CUDA_VER_MAJOR%.%CUDA_VER_MINOR%
10596

106-
if "%TEST_NIGHTLY_PACKAGE%" == "1" (
107-
call internal\install_nightly_package.bat
108-
if errorlevel 1 exit /b 1
109-
goto smoke_test
110-
)
111-
112-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install %CONDA_EXTRA_ARGS% -y "%%i" --offline
97+
:: Install package we just build
98+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install -yq "%%i" --offline
11399
if ERRORLEVEL 1 exit /b 1
114100

115101
if "%CUDA_VERSION%" == "cpu" goto install_cpu_torch
116102

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

123105
:install_cpu_torch
124-
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch
106+
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch-nightly
125107
if ERRORLEVEL 1 exit /b 1
126108

127109
:smoke_test
@@ -165,13 +147,8 @@ echo "install and test libtorch"
165147
if "%VC_YEAR%" == "2017" powershell internal\vs2017_install.ps1
166148
if ERRORLEVEL 1 exit /b 1
167149

168-
if "%TEST_NIGHTLY_PACKAGE%" == "1" (
169-
call internal\install_nightly_package.bat
170-
if errorlevel 1 exit /b 1
171-
) else (
172-
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
173-
if ERRORLEVEL 1 exit /b 1
174-
)
150+
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
151+
if ERRORLEVEL 1 exit /b 1
175152

176153
pushd tmp\libtorch
177154

0 commit comments

Comments
 (0)