Skip to content

Commit d79e45b

Browse files
peterjc123facebook-github-bot
authored andcommitted
Add some smoke tests for Windows
Summary: Pull Request resolved: pytorch#16496 Differential Revision: D13863489 Pulled By: soumith fbshipit-source-id: 518003c27a6b788b5a78b58cdb8698f0bb6ce4d8
1 parent 6a6983e commit d79e45b

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.jenkins/pytorch/win-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if not "%USE_CUDA%"=="0" (
158158
echo NOTE: To run \`import torch\`, please make sure to activate the conda environment by running \`call %CONDA_PARENT_DIR%\\Miniconda3\\Scripts\\activate.bat %CONDA_PARENT_DIR%\\Miniconda3\` in Command Prompt before running Git Bash.
159159
) else (
160160
mv %CD%\\build\\bin\\test_api.exe %CONDA_PARENT_DIR%\\Miniconda3\\Lib\\site-packages\\torch\\lib
161-
7z a %IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\\Miniconda3\\Lib\\site-packages\\torch && python ci_scripts\\upload_image.py %IMAGE_COMMIT_TAG%.7z
161+
7z a %IMAGE_COMMIT_TAG%.7z %CONDA_PARENT_DIR%\\Miniconda3\\Lib\\site-packages\\torch %CONDA_PARENT_DIR%\\Miniconda3\\Lib\\site-packages\\caffe2 && python ci_scripts\\upload_image.py %IMAGE_COMMIT_TAG%.7z
162162
)
163163
)
164164
)

.jenkins/pytorch/win-test.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if NOT "%BUILD_ENVIRONMENT%"=="" (
5252
call %CONDA_PARENT_DIR%\\Miniconda3\\Scripts\\activate.bat %CONDA_PARENT_DIR%\\Miniconda3
5353
if NOT "%BUILD_ENVIRONMENT%"=="" (
5454
:: We have to pin Python version to 3.6.7, until mkl supports Python 3.7
55-
call conda install -y -q python=3.6.7 numpy mkl cffi pyyaml boto3
55+
call conda install -y -q python=3.6.7 numpy mkl cffi pyyaml boto3 protobuf
5656
)
5757
pip install ninja future hypothesis librosa>=0.6.2 psutil
5858
@@ -82,6 +82,26 @@ EOL
8282

8383
cat >ci_scripts/test_python_nn.bat <<EOL
8484
call ci_scripts/setup_pytorch_env.bat
85+
:: Some smoke tests
86+
cd test/
87+
:: Checking that caffe2.python is available
88+
python -c "from caffe2.python import core"
89+
if ERRORLEVEL 1 exit /b 1
90+
:: Checking that MKL is available
91+
python -c "import torch; exit(0 if torch.backends.mkl.is_available() else 1)"
92+
if ERRORLEVEL 1 exit /b 1
93+
:: Checking that CUDA archs are setup correctly
94+
python -c "import torch; torch.randn([3,5]).cuda()"
95+
if ERRORLEVEL 1 exit /b 1
96+
:: Checking that magma is available
97+
python -c "import torch; torch.rand(1).cuda(); exit(0 if torch.cuda.has_magma else 1)"
98+
if ERRORLEVEL 1 exit /b 1
99+
:: Checking that CuDNN is available
100+
python -c "import torch; exit(0 if torch.backends.cudnn.is_available() else 1)"
101+
if ERRORLEVEL 1 exit /b 1
102+
cd ..
103+
104+
:: Run nn tests
85105
cd test/ && python run_test.py --include nn --verbose && cd ..
86106
EOL
87107

0 commit comments

Comments
 (0)