Skip to content

Commit 0f0f218

Browse files
committed
Testing new windows runners
test Testing Testing testing testing test Test Testing testing Testing Testing test Test test testing testing Test testing test testing testing testing testing testing testing test test testing testing testing testing Test test test testing testing testing testing testing testing testing testing testing Refactor code
1 parent 736bac6 commit 0f0f218

File tree

3 files changed

+28
-111
lines changed

3 files changed

+28
-111
lines changed

.github/actions/validate-windows-binary/action.yml

-47
This file was deleted.

.github/workflows/validate-windows-binaries.yml

+26-63
Original file line numberDiff line numberDiff line change
@@ -20,74 +20,37 @@ on:
2020
- all
2121

2222
jobs:
23-
generate-windows-conda-matrix:
23+
generate-windows-matrix:
2424
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
2525
with:
26-
package-type: conda
26+
package-type: all
2727
os: windows
2828
channel: ${{ inputs.channel }}
29-
generate-windows-wheel-matrix:
30-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
31-
with:
32-
package-type: wheel
33-
os: windows
34-
channel: ${{ inputs.channel }}
35-
generate-windows-libtorch-matrix:
36-
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
37-
with:
38-
package-type: libtorch
39-
os: windows
40-
channel: ${{ inputs.channel }}
41-
42-
win-conda:
43-
needs: generate-windows-conda-matrix
44-
strategy:
45-
matrix:
46-
${{ fromJson(needs.generate-windows-conda-matrix.outputs.matrix) }}
47-
fail-fast: false
48-
runs-on: ${{ matrix.validation_runner }}
49-
steps:
50-
- name: Checkout PyTorch builder
51-
uses: actions/checkout@v2
52-
- name: Validate binary conda
53-
uses: ./.github/actions/validate-windows-binary
54-
with:
55-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
56-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
57-
installation: ${{ matrix.installation }}
58-
python_version: ${{ matrix.python_version }}
5929

60-
win-wheel:
61-
needs: generate-windows-wheel-matrix
30+
win:
31+
needs: generate-windows-matrix
6232
strategy:
63-
matrix:
64-
${{ fromJson(needs.generate-windows-wheel-matrix.outputs.matrix) }}
33+
matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }}
6534
fail-fast: false
66-
runs-on: ${{ matrix.validation_runner }}
67-
steps:
68-
- name: Checkout PyTorch builder
69-
uses: actions/checkout@v2
70-
- name: Validate binary wheel
71-
uses: ./.github/actions/validate-windows-binary
72-
with:
73-
gpu_arch_type: ${{ matrix.gpu_arch_type }}
74-
gpu_arch_ver: ${{ matrix.gpu_arch_version }}
75-
installation: ${{ matrix.installation }}
76-
python_version: ${{ matrix.python_version }}
35+
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
36+
with:
37+
runner: ${{ matrix.validation_runner }}
38+
repository: "pytorch/builder"
39+
job-name: ${{ matrix.build_name }}
40+
script: |
41+
set -ex
42+
export ENV_NAME="conda-env-${{ github.run_id }}"
43+
export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}"
44+
export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}"
45+
export INSTALLATION="${{ matrix.installation }}"
46+
export CUDA_VER="${{ matrix.desired_cuda }}"
7747
78-
win-libt:
79-
needs: generate-windows-libtorch-matrix
80-
strategy:
81-
matrix:
82-
${{ fromJson(needs.generate-windows-libtorch-matrix.outputs.matrix) }}
83-
fail-fast: false
84-
runs-on: "windows-2019"
85-
env:
86-
PYTHON_VERSION: ${{ matrix.python_version }}
87-
steps:
88-
- name: Install pytorch and smoke test
89-
shell: powershell
90-
run: |
91-
$install = '${{ matrix.installation }}'
92-
Invoke-WebRequest -Uri $install -OutFile 'libtorch.zip'
93-
Expand-Archive -Force libtorch.zip .
48+
if [[ ${{ matrix.package_type }} == "libtorch" ]]; then
49+
curl ${{ matrix.installation }} -o libtorch.zip
50+
unzip libtorch.zip
51+
else
52+
conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow
53+
conda activate ${ENV_NAME}
54+
eval $INSTALLATION
55+
python ./test/smoke_test/smoke_test.py
56+
fi

test/smoke_test/smoke_test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pathlib import Path
55
import argparse
66
import torch
7+
import platform
78

89
gpu_arch_ver = os.getenv("GPU_ARCH_VER")
910
gpu_arch_type = os.getenv("GPU_ARCH_TYPE")
@@ -78,7 +79,7 @@ def smoke_test_cuda(package: str) -> None:
7879
if(package == 'all'):
7980
import torchaudio
8081
import torchvision
81-
if installation_str.find("nightly") != -1:
82+
if installation_str.find("nightly") != -1 or platform.system() == "Windows" :
8283
# just print out cuda version, as version check were already performed during import
8384
print(f"torchvision cuda: {torch.ops.torchvision._cuda_version()}")
8485
print(f"torchaudio cuda: {torch.ops.torchaudio.cuda_version()}")

0 commit comments

Comments
 (0)