forked from pytorch/executorch
-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (196 loc) · 8.93 KB
/
Copy pathcuda-windows.yml
File metadata and controls
212 lines (196 loc) · 8.93 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# Test ExecuTorch CUDA Windows Artifacts
# This workflow exports models targeting CUDA Windows using optimum-executorch on Linux.
# Then it runs those exported artifacts on a Windows CI machine.
name: Test CUDA Windows Export and E2E
on:
push:
branches:
- main
- release/*
tags:
- ciflow/cuda/*
pull_request:
paths:
- .github/workflows/cuda-windows.yml
- backends/cuda/**
- backends/aoti/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: false
permissions:
contents: read
jobs:
changed-files:
name: Get changed files
uses: ./.github/workflows/_get-changed-files.yml
with:
include-push-diff: true
run-decision:
name: CI run decision
uses: ./.github/workflows/_ci-run-decision.yml
export-model-cuda-windows-artifact:
name: export-model-cuda-windows-artifact
# Skip this job if the pull request is from a fork (HuggingFace secrets are not available).
# Path-filtered on push: mirrors the workflow-level pull_request `paths:`
# filter so push commits that don't touch CUDA-relevant paths skip
# this job on non-sampled commits. See _ci-run-decision.yml for
# the sampling policy.
needs: [changed-files, run-decision]
if: |
(github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request') &&
(
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda-windows.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
)
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
id-token: write
contents: read
secrets: inherit
strategy:
fail-fast: false
matrix:
include:
- model_repo: "mistralai"
model_name: "Voxtral-Mini-3B-2507"
quant: "non-quantized"
- model_repo: "mistralai"
model_name: "Voxtral-Mini-3B-2507"
quant: "quantized-int4-weight-only"
- model_repo: "nvidia"
model_name: "parakeet-tdt"
quant: "non-quantized"
- model_repo: "nvidia"
model_name: "parakeet-tdt"
quant: "quantized-int4-weight-only"
# TODO: sortformer produces 0 segments on Windows after D97788666.
# Temporarily disabled until root cause is debugged.
# - model_repo: "nvidia"
# model_name: "diar_streaming_sortformer_4spk-v2"
# quant: "non-quantized"
- model_repo: "mistralai"
model_name: "Voxtral-Mini-4B-Realtime-2602"
quant: "quantized-int4-tile-packed"
- model_repo: "facebook"
model_name: "dinov2-small-imagenet1k-1-layer"
quant: "non-quantized"
with:
timeout: 90
secrets-env: EXECUTORCH_HF_TOKEN
runner: linux.g5.4xlarge.nvidia.gpu
gpu-arch-type: cuda
gpu-arch-version: "13.0"
docker-image: ci-image:executorch-ubuntu-22.04-cuda-windows
submodules: recursive
upload-artifact: ${{ matrix.model_repo }}-${{ matrix.model_name }}-cuda-windows-${{ matrix.quant }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
set -eux
echo "::group::Fix libstdc++ GLIBCXX version"
# The executorch pybindings require GLIBCXX_3.4.30 which conda's libstdc++ doesn't have.
# Replace conda's libstdc++ with the system version to fix ImportError.
# Verify system version has GLIBCXX_3.4.30
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.30
# Backup and replace conda's version
mv /opt/conda/lib/libstdc++.so.6 /opt/conda/lib/libstdc++.so.6.bak || true
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/conda/lib/libstdc++.so.6
echo "::endgroup::"
echo "::group::Verify pre-installed dependencies"
x86_64-w64-mingw32-g++ --version
nvcc --version
echo "WINDOWS_CUDA_HOME=${WINDOWS_CUDA_HOME}"
ls -la "${WINDOWS_CUDA_HOME}"
echo "::endgroup::"
echo "::group::Setup ExecuTorch"
# Disable MKL to avoid duplicate target error when conda has multiple MKL installations
export USE_MKL=OFF
PYTHON_EXECUTABLE=python ./install_executorch.sh
echo "::endgroup::"
# Setup Huggingface only for models that need it (not dinov2)
if [ "${{ matrix.model_name }}" != "dinov2-small-imagenet1k-1-layer" ]; then
echo "::group::Setup Huggingface"
pip install -U "huggingface_hub[cli]>=1.2.1,<2.0" accelerate "optimum~=2.0.0" "transformers==5.0.0rc1"
HF_AUTH_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')"
hf auth login --token "$HF_AUTH_TOKEN"
OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt)
pip install --no-deps git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION}
echo "::endgroup::"
fi
VR_MODE=""
if [ "${{ matrix.model_name }}" = "Voxtral-Mini-4B-Realtime-2602" ]; then
VR_MODE="vr-offline"
fi
source .ci/scripts/export_model_artifact.sh cuda-windows "${{ matrix.model_repo }}/${{ matrix.model_name }}" "${{ matrix.quant }}" "${RUNNER_ARTIFACT_DIR}" "${VR_MODE}"
test-model-cuda-windows-e2e:
name: test-model-cuda-windows-e2e
# Same path filter as the export job above. Also explicitly gated
# on the export job succeeding — when needs: jobs are *skipped*
# (e.g. fork PR), GitHub still evaluates this if:, so without the
# explicit success-check this job would run and then fail trying
# to download an artifact that was never produced.
needs: [changed-files, export-model-cuda-windows-artifact, run-decision]
if: |
needs.export-model-cuda-windows-artifact.result == 'success' &&
(
contains(needs.changed-files.outputs.changed-files, 'backends/cuda') ||
contains(needs.changed-files.outputs.changed-files, 'backends/aoti') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/cuda-windows.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
)
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
strategy:
fail-fast: false
matrix:
include:
- model_repo: "mistralai"
model_name: "Voxtral-Mini-3B-2507"
quant: "non-quantized"
- model_repo: "mistralai"
model_name: "Voxtral-Mini-3B-2507"
quant: "quantized-int4-weight-only"
- model_repo: "nvidia"
model_name: "parakeet-tdt"
quant: "non-quantized"
- model_repo: "nvidia"
model_name: "parakeet-tdt"
quant: "quantized-int4-weight-only"
# TODO: sortformer produces 0 segments on Windows after D97788666.
# Temporarily disabled until root cause is debugged.
# - model_repo: "nvidia"
# model_name: "diar_streaming_sortformer_4spk-v2"
# quant: "non-quantized"
- model_repo: "mistralai"
model_name: "Voxtral-Mini-4B-Realtime-2602"
quant: "quantized-int4-tile-packed"
- model_repo: "facebook"
model_name: "dinov2-small-imagenet1k-1-layer"
quant: "non-quantized"
with:
timeout: 240
runner: windows.g5.4xlarge.nvidia.gpu
gpu-arch-type: cuda
gpu-arch-version: "13.0"
download-artifact: ${{ matrix.model_repo }}-${{ matrix.model_name }}-cuda-windows-${{ matrix.quant }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
git config --global http.sslBackend openssl
git submodule update --init --recursive
conda init powershell
powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true
\$env:CUDA_HOME = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0'
\$env:CUDA_PATH = \$env:CUDA_HOME
\$env:PATH = \"\$env:CUDA_HOME\bin;\$env:PATH\"
nvcc --version
.ci/scripts/setup-windows.ps1
\$artifactDir = \$env:RUNNER_ARTIFACT_DIR
if ([string]::IsNullOrWhiteSpace(\$artifactDir)) {
throw 'RUNNER_ARTIFACT_DIR is empty. Ensure download-artifact is configured for windows_job.yml.'
}
.ci/scripts/test_model_e2e_windows.ps1 -Device cuda-windows -HfModel '${{ matrix.model_repo }}/${{ matrix.model_name }}' -QuantName '${{ matrix.quant }}' -ModelDir \$artifactDir -ExpectedCudaVersion '13.0'
}"