Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
d6a70d6
Update
GregoryComer Aug 26, 2025
18866f4
Update
GregoryComer Aug 26, 2025
e7423a4
Update
GregoryComer Aug 26, 2025
323d96c
Update
GregoryComer Aug 26, 2025
bca23f5
Update
GregoryComer Aug 27, 2025
ab69e35
Update
GregoryComer Aug 27, 2025
c47d467
Update
GregoryComer Aug 27, 2025
cd8e9bc
Update
GregoryComer Aug 27, 2025
cb60871
Update
GregoryComer Aug 27, 2025
19dda19
Update
GregoryComer Aug 27, 2025
cd0178f
Update
GregoryComer Aug 27, 2025
ed4cffd
Update
GregoryComer Aug 27, 2025
934682f
Update
GregoryComer Aug 27, 2025
ef62839
Update
GregoryComer Aug 27, 2025
441fd5f
Update
GregoryComer Aug 27, 2025
7010cf3
Update
GregoryComer Aug 27, 2025
3cfae60
Update
GregoryComer Aug 27, 2025
b583635
Update
GregoryComer Aug 27, 2025
ed133f7
Update
GregoryComer Aug 27, 2025
228e146
Update
GregoryComer Aug 27, 2025
b64bd0f
Update
GregoryComer Aug 27, 2025
fe40834
Update
GregoryComer Aug 27, 2025
b97ba63
Update
GregoryComer Aug 27, 2025
5be90d9
Update
GregoryComer Aug 27, 2025
f15e674
Update
GregoryComer Aug 27, 2025
33da5e3
Update
GregoryComer Aug 28, 2025
2a6f87b
Update
GregoryComer Aug 28, 2025
8ce9df7
Update
GregoryComer Aug 28, 2025
d5efbf9
Update
GregoryComer Aug 28, 2025
e918a78
Update
GregoryComer Aug 28, 2025
3a12680
Update
GregoryComer Aug 28, 2025
f0511c6
Update
GregoryComer Aug 28, 2025
dcc1ad9
Update
GregoryComer Aug 28, 2025
4fcf61e
Update
GregoryComer Aug 28, 2025
3b38d5a
Update
GregoryComer Aug 28, 2025
2bc56f3
Update
GregoryComer Aug 28, 2025
6e392b6
Update
GregoryComer Aug 28, 2025
82b7858
Update
GregoryComer Aug 28, 2025
e2bf0b0
Update
GregoryComer Aug 28, 2025
fe214c0
Update
GregoryComer Aug 28, 2025
f7db054
Update
GregoryComer Aug 28, 2025
e075bed
Update
GregoryComer Aug 28, 2025
a1056d7
Update
GregoryComer Aug 28, 2025
3a64498
Update
GregoryComer Aug 28, 2025
1b9b951
Update
GregoryComer Aug 28, 2025
00ffef2
Update
GregoryComer Aug 28, 2025
8664d51
Update
GregoryComer Aug 28, 2025
ca165c7
Update
GregoryComer Aug 28, 2025
a3be73a
Update
GregoryComer Aug 29, 2025
9b3c472
Update
GregoryComer Aug 29, 2025
c46506d
Update
GregoryComer Aug 29, 2025
eca7e47
Update
GregoryComer Aug 29, 2025
ecf4665
Update
GregoryComer Aug 29, 2025
fa1b497
Update
GregoryComer Aug 29, 2025
5c0dd42
Update
GregoryComer Aug 29, 2025
c76e310
Update
GregoryComer Aug 29, 2025
612cec0
Update
GregoryComer Aug 29, 2025
0f9fdc5
Update
GregoryComer Aug 29, 2025
aad0d66
Update
GregoryComer Aug 29, 2025
480f09c
Update
GregoryComer Aug 29, 2025
07b3463
Update
GregoryComer Aug 29, 2025
083701d
Update
GregoryComer Aug 29, 2025
9173ed5
Update
GregoryComer Aug 29, 2025
e0d149e
Update
GregoryComer Aug 29, 2025
198cd72
Update
GregoryComer Aug 29, 2025
d138641
Update
GregoryComer Aug 30, 2025
715b648
Update
GregoryComer Aug 30, 2025
00aa3b4
Update
GregoryComer Aug 30, 2025
1b80338
Update
GregoryComer Aug 30, 2025
b55594f
Update
GregoryComer Aug 30, 2025
920c64f
Update
GregoryComer Aug 30, 2025
6b48e01
Update
GregoryComer Aug 30, 2025
70b980c
Update
GregoryComer Aug 30, 2025
5866307
Update
GregoryComer Aug 31, 2025
12bf1c9
Update
GregoryComer Aug 31, 2025
e5cdeea
Update
GregoryComer Aug 31, 2025
a267549
Update
GregoryComer Aug 31, 2025
fd59a13
Update
GregoryComer Aug 31, 2025
2202ef1
Update
GregoryComer Aug 31, 2025
8ce15a3
Update
GregoryComer Aug 31, 2025
2706db0
Update
GregoryComer Sep 2, 2025
f151c3d
Update
GregoryComer Sep 2, 2025
ae63814
Update
GregoryComer Sep 2, 2025
39b994c
Update
GregoryComer Sep 2, 2025
fdd8e12
Update
GregoryComer Sep 2, 2025
c285ecf
Update
GregoryComer Sep 2, 2025
edfd321
Update
GregoryComer Sep 3, 2025
95856ad
Update
GregoryComer Sep 3, 2025
b41ddee
Update
GregoryComer Sep 3, 2025
15b9ce0
Update
GregoryComer Sep 3, 2025
fd3d9c3
Update
GregoryComer Sep 3, 2025
fc9d9b9
Update
GregoryComer Sep 3, 2025
8a4a0e3
Update
GregoryComer Sep 3, 2025
aae2ad8
Update
GregoryComer Sep 3, 2025
fbde97d
Update
GregoryComer Sep 3, 2025
056b85d
Update
GregoryComer Sep 3, 2025
0360486
Update
GregoryComer Sep 3, 2025
d521e08
Update
GregoryComer Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .ci/scripts/setup-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
param (
[string]$editable = $false
)

conda create --yes --quiet -n et python=3.12
conda activate et

# Activate the VS environment - this is required for Dynamo to work, as it uses MSVC.
# There are a bunch of environment variables that it requires.
# See https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line.
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64

# Install test dependencies
pip install -r .ci/docker/requirements-ci.txt

if ($editable -eq 'true') {
install_executorch.bat --editable
} else {
install_executorch.bat
}
if ($LASTEXITCODE -ne 0) {
Write-Host "Installation was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}
89 changes: 89 additions & 0 deletions .ci/scripts/test_model.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
param (
[string]$modelName,
[string]$backend,
[string]$buildDir = "cmake-out",
[bool]$strict = $false
)

Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true

function ExportModel-Portable {
param (
[string]$model_name,
[bool]$strict
)

$exportParams = "--model_name", "$modelName"
if ($strict) {
$exportParams += "--strict"
}
python -m examples.portable.scripts.export @exportParams | Write-Host
if ($LASTEXITCODE -ne 0) {
Write-Host "Model export failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

"$modelName.pte"
}

function ExportModel-Xnnpack {
param (
[string]$model_name,
[bool]$quantize
)

if $(quantize) {
python -m examples.xnnpack.aot_compiler --model_name="${MODEL_NAME}" --delegate --quantize | Write-Host
$modelFile = "$($modelName)_xnnpack_q8.pte"
} else {
python -m examples.xnnpack.aot_compiler --model_name="${MODEL_NAME}" --delegate | Write-Host
$modelFile = "$($modelName)_xnnpack_fp32.pte"
}
if ($LASTEXITCODE -ne 0) {
Write-Host "Model export failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

$modelFile
}

# Build the runner
if (Test-Path -Path $buildDir) {
Remove-Item -Path $buildDir -Recurse -Force
}
New-Item -Path $buildDir -ItemType Directory
Push-Location $buildDir
cmake .. --preset windows
cmake --build . -t executor_runner -j16 --config Release
if ($LASTEXITCODE -ne 0) {
Write-Host "Runner build failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}
$executorBinaryPath = Join-Path -Path $buildDir -ChildPath "Release\executor_runner.exe"
Pop-Location

# Export the model
switch ($backend) {
"portable" {
$model_path = ExportModel-Portable -model_name $modelName -strict $strict
}
"xnnpack-f32" {
$model_path = ExportModel-Xnnpack -model_name $modelName -quantize $false
}
"xnnpack-q8" {
$model_path = ExportModel-Xnnpack -model_name $modelName -quantize $true
}
default {
Write-Host "Unknown backend $backend."
exit 1
}
}

# Run the runner
& "$executorBinaryPath" --model_path="$model_path"
if ($LASTEXITCODE -ne 0) {
Write-Host "Model execution failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}
23 changes: 1 addition & 22 deletions .ci/scripts/unittest-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
param (
[string]$editable
[string]$editable = $false
)

Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true

conda create --yes --quiet -n et python=3.12
conda activate et

# Activate the VS environment - this is required for Dynamo to work, as it uses MSVC.
# There are a bunch of environment variables that it requires.
# See https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line.
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64

# Install test dependencies
pip install -r .ci/docker/requirements-ci.txt

if ($editable -eq 'true') {
install_executorch.bat --editable
} else {
install_executorch.bat
}
if ($LASTEXITCODE -ne 0) {
Write-Host "Installation was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

# Run pytest with coverage
# pytest -n auto --cov=./ --cov-report=xml
pytest -v --full-trace -c pytest-windows.ini
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,13 @@ jobs:
timeout: 120
script: |
conda init powershell
powershell .ci/scripts/unittest-windows.ps1 -editable "${{ inputs.editable }}"

powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows.ps1

powershell .ci/scripts/unittest-windows.ps1 -editable "${{ inputs.editable }}"
}"
24 changes: 24 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -979,3 +979,27 @@ jobs:
# Run MCU models
chmod +x examples/arm/run_mcu_models_fvp.sh
examples/arm/run_mcu_models_fvp.sh --target=cortex-m55

test-models-windows:
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
strategy:
fail-fast: false
matrix:
model: [linear, add, add_mul, ic3, ic4, mv2, mv3, resnet18, resnet50, vit, w2l, mobilebert, emformer_join, emformer_transcribe]
backend: [portable, xnnpack-f32, xnnpack-q8]
with:
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 60
script: |
conda init powershell

powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows.ps1

powershell .ci/scripts/test_model.ps1 -modelName ${{ matrix.model }} -backend ${{ matrix.backend }}
}"
Loading