-
Notifications
You must be signed in to change notification settings - Fork 28
181 lines (155 loc) · 5.09 KB
/
Copy path_build_windows.yml
File metadata and controls
181 lines (155 loc) · 5.09 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: " - Wheel (Windows)"
on:
workflow_call:
inputs:
machine:
type: string
default: "windows-latest"
machine_gpu:
type: string
default: "4-core-windows-gpu-t4"
python-version:
required: true
type: string
free-threaded:
description: 'Whether FT Python or not. Valid value is "ft" or not.'
default: ''
type: string
use-nvdec:
default: "nvdec"
type: string
description: 'Whether build NVDEC extension. Valid value is "nvdec" or not.'
run-test:
required: false
default: 'false'
type: string
env:
ARTIFACT: wheel-win-py${{ inputs.python-version }}${{ inputs.free-threaded }}
SPDL_USE_TRACING: 0
SPDL_USE_CUDA: 1
SPDL_USE_NVCODEC: "${{ inputs.use-nvdec == 'nvdec' }}"
jobs:
build:
runs-on: "${{ inputs.machine }}"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Cuda Toolkit 12.4 on Windows
shell: bash
run: |
choco install unzip -y --no-progress
.github/scripts/windows/install_cuda_toolkit_12.4.sh
echo "C:\\\\Program Files\\\\NVIDIA GPU Computing Toolkit\\\\CUDA\\\\v12.4\\\\bin" >> $GITHUB_PATH
echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.4" >> $GITHUB_ENV
- name: Build
run: |
.\packaging\vc_env_helper.bat `
bash `
.github/scripts/windows/build_package.sh `
"${{ inputs.python-version }}" `
"${{ inputs.free-threaded }}"
- uses: actions/upload-artifact@v4
name: Upload build artifact
with:
name: "${{ env.ARTIFACT }}"
path: package
if-no-files-found: error
retention-days: 7
overwrite: true
- name: Check package
run: |
.\packaging\vc_env_helper.bat `
bash `
.github/scripts/windows/check_package.sh
test-gpu:
if: "${{ inputs.run-test == 'true' }}"
name: "test-gpu ffmpeg"
needs: ["build"]
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["8.0"]
runs-on: "${{ inputs.machine_gpu }}"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: "${{ env.ARTIFACT }}"
path: package
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}
conda-remove-defaults: "true"
- name: Unit test
run: |
nvidia-smi
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
conda install -q -c conda-forge python-freethreading
fi
# Install SPDL
pip install $(find package -name '*.whl' -depth -maxdepth 1)
# Install PyTorch and others
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
pip install torch numpy pytest
else
pip install torch numpy numba pytest
fi
# Install FFmpeg
conda install -q -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version }}"
# Run test
python -c 'import spdl.io.utils;assert spdl.io.utils.built_with_cuda()'
if "${{ inputs.use-nvdec == 'nvdec' }}" ; then
python -c 'import spdl.io.utils;assert spdl.io.utils.built_with_nvcodec()'
fi
pytest -v \
tests/spdl_unittest/cuda/ \
tests/spdl_unittest/io/
test-cpu:
if: "${{ inputs.run-test == 'true' }}"
name: "test-cpu ffmpeg"
needs: ["build"]
strategy:
fail-fast: false
matrix:
ffmpeg-version: ["8.0"]
runs-on: "${{ inputs.machine }}"
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: "${{ env.ARTIFACT }}"
path: package
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ inputs.python-version }}
conda-remove-defaults: "true"
- name: Unit test
run: |
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
conda install -q -c conda-forge python-freethreading
fi
# Install SPDL
pip install $(find package -name '*.whl' -depth -maxdepth 1)
# Install PyTorch and others
if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
pip install torch numpy pytest
else
pip install torch numpy numba pytest
fi
# Install FFmpeg
conda install -q -c conda-forge "ffmpeg==${{ matrix.ffmpeg-version }}"
# Run test
pytest -v \
tests/spdl_unittest/io/ \
tests/spdl_unittest/dataloader/