diff --git a/windows/internal/install_nightly_package.bat b/windows/internal/install_nightly_package.bat deleted file mode 100644 index 7db23ebd6..000000000 --- a/windows/internal/install_nightly_package.bat +++ /dev/null @@ -1,67 +0,0 @@ -if "%PACKAGE_TYPE%" == "wheel" goto wheel -if "%PACKAGE_TYPE%" == "conda" goto conda -if "%PACKAGE_TYPE%" == "libtorch" goto libtorch - -:wheel -echo "install pytorch wheel from nightly" - -set pip_url="https://download.pytorch.org/whl/nightly/%DESIRED_CUDA%/torch_nightly.html" -if "%DESIRED_CUDA%" == "cu102" ( - set package_name_and_version="torch==%NIGHTLIES_DATE_PREAMBLE%%DATE%" -) else ( - set package_name_and_version="torch==%NIGHTLIES_DATE_PREAMBLE%%DATE%+%DESIRED_CUDA%" -) -pip install "%package_name_and_version%" -f "%pip_url%" --no-cache-dir --no-index -q -if errorlevel 1 exit /b 1 - -exit /b 0 - -:conda -echo "install pytorch conda from nightly" -set package_name_and_version="pytorch==%NIGHTLIES_DATE_PREAMBLE%%DATE%" - -if "%DESIRED_CUDA%" == "cpu" ( - call conda install -yq -c pytorch-nightly %package_name_and_version% cpuonly -) else ( - call conda install -yq -c pytorch-nightly "cudatoolkit=%CUDA_VERSION_STR%" %package_name_and_version% -) -if ERRORLEVEL 1 exit /b 1 - -FOR /f %%i in ('python -c "import sys;print(sys.version)"') do set cur_python=%%i - -if not %cur_python:~0,3% == %DESIRED_PYTHON% ( - echo "The Python version has changed to %cur_python%" - echo "Probably the package for the version we want does not exist" - echo "conda will change the Python version even if it was explicitly declared" -) - -if "%DESIRED_CUDA%" == "cpu" ( - call conda list torch | findstr cuda || exit /b 0 - echo "The installed package is built for CUDA, the full package is" - call conda list torch -) else ( - call conda list torch | findstr cuda%CUDA_VERSION% && exit /b 0 - echo "The installed package doesn't seem to be built for CUDA "%CUDA_VERSION_STR% - echo "the full package is " - call conda list torch -) -exit /b 1 - -:libtorch -echo "install libtorch from nightly" -if "%LIBTORCH_CONFIG%" == "debug" ( - set NAME_PREFIX=libtorch-win-shared-with-deps-debug -) else ( - set NAME_PREFIX=libtorch-win-shared-with-deps -) -if "%DESIRED_CUDA%" == "cu102" ( - set package_name=%NAME_PREFIX%-%NIGHTLIES_DATE_PREAMBLE%%DATE%.zip -) else ( - set package_name=%NAME_PREFIX%-%NIGHTLIES_DATE_PREAMBLE%%DATE%%%2B%DESIRED_CUDA%.zip -) -set libtorch_url="https://download.pytorch.org/libtorch/nightly/%DESIRED_CUDA%/%package_name%" -curl --retry 3 -k "%libtorch_url%" -o %package_name% -if ERRORLEVEL 1 exit /b 1 - -7z x %package_name% -otmp -if ERRORLEVEL 1 exit /b 1 diff --git a/windows/internal/smoke_test.bat b/windows/internal/smoke_test.bat index 836a04311..c2cd0b565 100644 --- a/windows/internal/smoke_test.bat +++ b/windows/internal/smoke_test.bat @@ -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 @@ -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 @@ -93,9 +85,8 @@ 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% @@ -103,25 +94,16 @@ 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 @@ -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