Skip to content

Refactor and fix windows smoke tests (#1218) #1222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 0 additions & 67 deletions windows/internal/install_nightly_package.bat

This file was deleted.

45 changes: 11 additions & 34 deletions windows/internal/smoke_test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@ set "PATH=%CD%\Python%PYTHON_VERSION%\Scripts;%CD%\Python;%PATH%"
pip install -q numpy protobuf "mkl>=2019"
if errorlevel 1 exit /b 1

if "%TEST_NIGHTLY_PACKAGE%" == "1" (
call internal\install_nightly_package.bat
if errorlevel 1 exit /b 1
) else (
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.whl') do pip install "%%i"
if errorlevel 1 exit /b 1
)
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.whl') do pip install "%%i"
if errorlevel 1 exit /b 1

goto smoke_test

Expand All @@ -69,14 +64,11 @@ set "CONDA_HOME=%CD%\conda"
set "tmp_conda=%CONDA_HOME%"
set "miniconda_exe=%CD%\miniconda.exe"
set "CONDA_EXTRA_ARGS="
if "%CUDA_VERSION%" == "115" (
set "CONDA_EXTRA_ARGS=-c=nvidia"
)
if "%CUDA_VERSION%" == "116" (
set "CONDA_EXTRA_ARGS=-c=nvidia"
set "CONDA_EXTRA_ARGS=pytorch-cuda=11.6 -c nvidia -c pytorch-nightly"
)
if "%CUDA_VERSION%" == "117" (
set "CONDA_EXTRA_ARGS=-c=nvidia"
set "CONDA_EXTRA_ARGS=pytorch-cuda=11.7 -c nvidia -c pytorch-nightly"
)

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

call conda update -n base -y -c defaults conda

call conda install %CONDA_EXTRA_ARGS% -yq protobuf numpy
:: do conda install to make sure all the dependencies are installed
call conda install -yq pytorch %CONDA_EXTRA_ARGS%
if ERRORLEVEL 1 exit /b 1

set /a CUDA_VER=%CUDA_VERSION%
set CUDA_VER_MAJOR=%CUDA_VERSION:~0,-1%
set CUDA_VER_MINOR=%CUDA_VERSION:~-1,1%
set CUDA_VERSION_STR=%CUDA_VER_MAJOR%.%CUDA_VER_MINOR%

if "%TEST_NIGHTLY_PACKAGE%" == "1" (
call internal\install_nightly_package.bat
if errorlevel 1 exit /b 1
goto smoke_test
)

for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install %CONDA_EXTRA_ARGS% -y "%%i" --offline
:: Install package we just build
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *.tar.bz2') do call conda install -yq "%%i" --offline
if ERRORLEVEL 1 exit /b 1

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

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

goto smoke_test

:install_cpu_torch
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch
call conda install %CONDA_EXTRA_ARGS% -y cpuonly -c pytorch-nightly
if ERRORLEVEL 1 exit /b 1

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

if "%TEST_NIGHTLY_PACKAGE%" == "1" (
call internal\install_nightly_package.bat
if errorlevel 1 exit /b 1
) else (
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
if ERRORLEVEL 1 exit /b 1
)
for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *-latest.zip') do 7z x "%%i" -otmp
if ERRORLEVEL 1 exit /b 1

pushd tmp\libtorch

Expand Down