forked from pytorch/pytorch
/
action.yml
66 lines (58 loc) · 2.17 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Setup Windows
description: Set up for windows jobs
inputs:
cuda-version:
description: which cuda version to install, 'cpu' for none
required: true
runs:
using: composite
steps:
- name: Display EC2 information
shell: bash
run: |
set -euo pipefail
function get_ec2_metadata() {
# Pulled from instance metadata endpoint for EC2
# see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
category=$1
curl -fsSL "http://169.254.169.254/latest/meta-data/${category}"
}
echo "ami-id: $(get_ec2_metadata ami-id)"
echo "instance-id: $(get_ec2_metadata instance-id)"
echo "instance-type: $(get_ec2_metadata instance-type)"
echo "system info $(uname -a)"
# Needed for binary builds, see: https://github.com/pytorch/pytorch/issues/73339#issuecomment-1058981560
- name: Enable long paths on Windows
shell: powershell
run: |
Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
# Since it's just a defensive command, the workflow should continue even the command fails
- name: Disables Windows Defender scheduled and real-time scanning for files in pytorch directory.
shell: powershell
run: |
Add-MpPreference -ExclusionPath $(Get-Location).tostring() -ErrorAction Ignore
- name: Install Visual Studio 2019 toolchain
shell: powershell
env:
VS_VERSION: "16.8.6"
INSTALL_WINDOWS_SDK: "1"
run: |
.\.circleci\scripts\vs_install.ps1
- name: Install CUDA and CUDNN
shell: bash
if: inputs.cuda-version != 'cpu'
env:
CUDA_VERSION: ${{ inputs.cuda-version }}
run: |
.circleci/scripts/windows_cuda_install.sh
.circleci/scripts/windows_cudnn_install.sh
- name: Setup Python3
uses: actions/setup-python@v4
with:
python-version: 3.x
check-latest: false
cache: pip
cache-dependency-path: |
**/requirements.txt
**/.circleci/docker/requirements-ci.txt
**/.github/requirements-gha-cache.txt