-
Notifications
You must be signed in to change notification settings - Fork 712
[Windows] Add model run CI #13836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[Windows] Add model run CI #13836
Changes from 96 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
d6a70d6
Update
GregoryComer 18866f4
Update
GregoryComer e7423a4
Update
GregoryComer 323d96c
Update
GregoryComer bca23f5
Update
GregoryComer ab69e35
Update
GregoryComer c47d467
Update
GregoryComer cd8e9bc
Update
GregoryComer cb60871
Update
GregoryComer 19dda19
Update
GregoryComer cd0178f
Update
GregoryComer ed4cffd
Update
GregoryComer 934682f
Update
GregoryComer ef62839
Update
GregoryComer 441fd5f
Update
GregoryComer 7010cf3
Update
GregoryComer 3cfae60
Update
GregoryComer b583635
Update
GregoryComer ed133f7
Update
GregoryComer 228e146
Update
GregoryComer b64bd0f
Update
GregoryComer fe40834
Update
GregoryComer b97ba63
Update
GregoryComer 5be90d9
Update
GregoryComer f15e674
Update
GregoryComer 33da5e3
Update
GregoryComer 2a6f87b
Update
GregoryComer 8ce9df7
Update
GregoryComer d5efbf9
Update
GregoryComer e918a78
Update
GregoryComer 3a12680
Update
GregoryComer f0511c6
Update
GregoryComer dcc1ad9
Update
GregoryComer 4fcf61e
Update
GregoryComer 3b38d5a
Update
GregoryComer 2bc56f3
Update
GregoryComer 6e392b6
Update
GregoryComer 82b7858
Update
GregoryComer e2bf0b0
Update
GregoryComer fe214c0
Update
GregoryComer f7db054
Update
GregoryComer e075bed
Update
GregoryComer a1056d7
Update
GregoryComer 3a64498
Update
GregoryComer 1b9b951
Update
GregoryComer 00ffef2
Update
GregoryComer 8664d51
Update
GregoryComer ca165c7
Update
GregoryComer a3be73a
Update
GregoryComer 9b3c472
Update
GregoryComer c46506d
Update
GregoryComer eca7e47
Update
GregoryComer ecf4665
Update
GregoryComer fa1b497
Update
GregoryComer 5c0dd42
Update
GregoryComer c76e310
Update
GregoryComer 612cec0
Update
GregoryComer 0f9fdc5
Update
GregoryComer aad0d66
Update
GregoryComer 480f09c
Update
GregoryComer 07b3463
Update
GregoryComer 083701d
Update
GregoryComer 9173ed5
Update
GregoryComer e0d149e
Update
GregoryComer 198cd72
Update
GregoryComer d138641
Update
GregoryComer 715b648
Update
GregoryComer 00aa3b4
Update
GregoryComer 1b80338
Update
GregoryComer b55594f
Update
GregoryComer 920c64f
Update
GregoryComer 6b48e01
Update
GregoryComer 70b980c
Update
GregoryComer 5866307
Update
GregoryComer 12bf1c9
Update
GregoryComer e5cdeea
Update
GregoryComer a267549
Update
GregoryComer fd59a13
Update
GregoryComer 2202ef1
Update
GregoryComer 8ce15a3
Update
GregoryComer 2706db0
Update
GregoryComer f151c3d
Update
GregoryComer ae63814
Update
GregoryComer 39b994c
Update
GregoryComer fdd8e12
Update
GregoryComer c285ecf
Update
GregoryComer edfd321
Update
GregoryComer 95856ad
Update
GregoryComer b41ddee
Update
GregoryComer 15b9ce0
Update
GregoryComer fd3d9c3
Update
GregoryComer fc9d9b9
Update
GregoryComer 8a4a0e3
Update
GregoryComer aae2ad8
Update
GregoryComer fbde97d
Update
GregoryComer 056b85d
Update
GregoryComer 0360486
Update
GregoryComer d521e08
Update
GregoryComer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| 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 | ||
| ) | ||
|
|
||
| python -m examples.xnnpack.aot_compiler --model_name="${MODEL_NAME}" --delegate | Write-Host | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Model export failed. Exit code: $LASTEXITCODE." | ||
| exit $LASTEXITCODE | ||
| } | ||
|
|
||
| "$($modelName)_xnnpack_fp32.pte" | ||
| } | ||
|
|
||
| .ci/scripts/setup-windows.ps1 | ||
|
|
||
| # 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" { | ||
GregoryComer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $model_path = ExportModel-Xnnpack -model_name $modelName | ||
| } | ||
| 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 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| param ( | ||
| [string]$editable = $false | ||
| ) | ||
|
|
||
| Set-PSDebug -Trace 1 | ||
| $ErrorActionPreference = 'Stop' | ||
| $PSNativeCommandUseErrorActionPreference = $true | ||
|
|
||
| .ci/scripts/setup-windows.ps1 -editable $editable | ||
|
|
||
| # Run pytest with coverage | ||
| # pytest -n auto --cov=./ --cov-report=xml | ||
| pytest -v --full-trace -c pytest-windows.ini | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE." | ||
| exit $LASTEXITCODE | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,3 +65,7 @@ xcuserdata/ | |
|
|
||
| # Android | ||
| *.aar | ||
|
|
||
| # Windows | ||
| *.dll | ||
| *.pyd | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import sys | ||
|
|
||
| collect_ignore_glob: list[str] = [] | ||
|
|
||
| # Skip Apple tests on Windows. Note that some Core ML tests can run on Linux, as the AOT flow | ||
| # is available. Tests will manage this internally. However, the coremltools import is not available | ||
| # on Windows and causes collection to fail. The easiest way to manage this seems to be to just | ||
| # skip collection for this subdirectory on unsupported platforms. | ||
| if sys.platform == "win32": | ||
| collect_ignore_glob += [ | ||
| "backends/apple/**", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # NOTE: This file is a copy of pytest.ini, but with additional tests disabled for Windows. This | ||
| # is intended to be a short-term solution to allow for incrementally enabling tests on Windows. | ||
| # This file is intended to be deleted once the enablement is complete. | ||
|
|
||
| [pytest] | ||
| addopts = | ||
| # show summary of all tests that did not pass | ||
| -rEfX | ||
| # Make tracebacks shorter | ||
| --tb=native | ||
| # capture only Python print and C++ py::print, but not C output (low-level Python errors) | ||
| --capture=sys | ||
| # don't suppress warnings, but don't shove them all to the end either | ||
| -p no:warnings | ||
| # Ignore backends/arm tests you need to run examples/arm/setup.sh to install some tool to make them work | ||
| # For GitHub testing this is setup/executed in the unittest-arm job see .github/workflows/pull.yml for more info. | ||
| --ignore-glob=backends/arm/**/* | ||
| # explicitly list out tests that are running successfully in oss | ||
| .ci/scripts/tests | ||
| examples/models/test | ||
| devtools/ | ||
| --ignore=devtools/visualization/visualization_utils_test.py | ||
| # examples | ||
| # examples/models/llava/test TODO: enable this | ||
| # exir | ||
| exir/_serialize/test | ||
| exir/backend/test | ||
| exir/dialects/backend/test | ||
| exir/dialects/edge/test | ||
| exir/dialects/test | ||
| exir/emit/test | ||
| exir/program/test | ||
| exir/tests/ | ||
| # executorch/export | ||
| export/tests | ||
| --ignore=export/tests/test_export_stages.py | ||
| # kernels/ | ||
| kernels/prim_ops/test | ||
| kernels/quantized | ||
| # Because this test depends on test only cpp ops lib | ||
| # Will add test only cmake targets to re-enable this test | ||
| # but maybe it is a bit of anti-pattern | ||
| --ignore=kernels/quantized/test/test_quant_dequant_per_token.py | ||
| kernels/test/test_case_gen.py | ||
| # backends/test | ||
| # This effort is WIP and will be enabled in CI once testing infra | ||
| # is stable and signal to noise ratio is good (no irrelevant failures). | ||
| # See https://github.com/pytorch/executorch/discussions/11140 | ||
| --ignore=backends/test | ||
| backends/test/harness/tests | ||
| backends/test/suite/tests | ||
| # backends/xnnpack | ||
| backends/xnnpack/test/ops | ||
| --ignore=backends/xnnpack/test/ops/test_bmm.py | ||
| --ignore=backends/xnnpack/test/ops/test_conv2d.py | ||
| --ignore=backends/xnnpack/test/ops/test_linear.py | ||
| --ignore=backends/xnnpack/test/ops/test_sdpa.py | ||
| backends/xnnpack/test/passes | ||
| backends/xnnpack/test/recipes | ||
| backends/xnnpack/test/serialization | ||
| # backends/apple/coreml | ||
| backends/apple/coreml/test | ||
| # extension/ | ||
| extension/llm/custom_ops/test_sdpa_with_kv_cache.py | ||
| extension/llm/custom_ops/test_update_cache.py | ||
| extension/llm/custom_ops/test_quantized_sdpa.py | ||
| extension/pybindings/test | ||
| extension/training/pybindings/test | ||
| # Runtime | ||
| runtime | ||
| # Tools | ||
| codegen/test | ||
| tools/cmake | ||
| # test TODO: fix these tests | ||
| # test/end2end/test_end2end.py | ||
| --ignore=backends/xnnpack/test/ops/linear.py | ||
| --ignore=backends/xnnpack/test/models/llama2_et_example.py | ||
| # T200992559: Add torchao to ET as core dependency | ||
| --ignore=examples/models/llama/tests/test_pre_quantization_transforms.py | ||
| --ignore=exir/backend/test/demos | ||
| --ignore=exir/backend/test/test_backends.py | ||
| --ignore=exir/backend/test/test_backends_lifted.py | ||
| --ignore=exir/backend/test/test_partitioner.py | ||
| --ignore=exir/tests/test_common.py | ||
| --ignore=exir/tests/test_memory_format_ops_pass_aten.py | ||
| --ignore=exir/tests/test_memory_planning.py | ||
| --ignore=exir/tests/test_op_convert.py | ||
| --ignore=exir/tests/test_passes.py | ||
| --ignore=exir/tests/test_quant_fusion_pass.py | ||
| --ignore=exir/tests/test_quantization.py | ||
| --ignore=exir/tests/test_verification.py | ||
| # Tests that are (temporarily) disabled for Windows | ||
| # TODO(gjcomer) Re-enable the LLM tests when tokenizers library is available on Windows. | ||
| #examples/models/llama3_2_vision/preprocess | ||
| #examples/models/llama3_2_vision/vision_encoder/test | ||
| #examples/models/llama3_2_vision/text_decoder/test | ||
| #examples/models/llama/tests | ||
| #examples/models/llama/config | ||
| #extension/llm/modules/test | ||
| #extension/llm/export | ||
| --deselect=extension/pybindings/test/test_pybindings.py::PybindingsTest::test_method_quantized_ops | ||
| --deselect=extension/pybindings/test/test_pybindings.py::PybindingsTest::test_quantized_ops | ||
| --deselect=runtime/test/test_runtime.py::RuntimeTest::test_load_program_with_path | ||
| --deselect=exir/backend/test/test_compatibility.py::TestCompatibility::test_compatibility_in_runtime | ||
| --deselect=exir/backend/test/test_compatibility.py::TestCompatibility::test_compatibility_in_runtime_edge_program_manager | ||
| --deselect=exir/backend/test/test_lowered_backend_module.py::TestBackendAPI::test_emit_lowered_backend_module_end_to_end | ||
| --deselect=exir/backend/test/test_to_backend_multi_method.py::TestToBackendMultiMethod::test_multi_method_end_to_end | ||
| --deselect=extension/llm/custom_ops/test_sdpa_with_kv_cache.py::SDPATestForSpeculativeDecode::test_sdpa_with_cache_seq_len_130 | ||
| --deselect=devtools/inspector/tests/inspector_test.py::TestInspector::test_etrecord_populates_correct_edge_dialect_aot_intermediate_outputs | ||
| --deselect=devtools/inspector/tests/inspector_test.py::TestInspector::test_etrecord_populates_correct_export_program_aot_intermediate_outputs | ||
|
|
||
| # run the same tests multiple times to determine their | ||
| # flakiness status. Default to 50 re-runs | ||
| flake-finder = true | ||
| flake-runs = 50 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.