File tree Expand file tree Collapse file tree 16 files changed +208
-26
lines changed
models/llama/source_transformation Expand file tree Collapse file tree 16 files changed +208
-26
lines changed Original file line number Diff line number Diff line change 1+ param (
2+ [string ]$editable
3+ )
4+
5+ Set-PSDebug - Trace 1
6+ $ErrorActionPreference = ' Stop'
7+ $PSNativeCommandUseErrorActionPreference = $true
8+
9+ conda create -- yes -- quiet - n et python= 3.12
10+ conda activate et
11+
12+ # Activate the VS environment - this is required for Dynamo to work, as it uses MSVC.
13+ # There are a bunch of environment variables that it requires.
14+ # See https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line.
15+ & " C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1" - Arch amd64
16+
17+ # Install test dependencies
18+ pip install - r .ci/ docker/ requirements- ci.txt
19+
20+ if ($editable -eq ' true' ) {
21+ install_executorch.bat -- editable
22+ } else {
23+ install_executorch.bat
24+ }
25+ if ($LASTEXITCODE -ne 0 ) {
26+ Write-Host " Installation was unsuccessful. Exit code: $LASTEXITCODE ."
27+ exit $LASTEXITCODE
28+ }
29+
30+ # Run pytest with coverage
31+ # pytest -n auto --cov=./ --cov-report=xml
32+ pytest - v -- full- trace - c pytest- windows.ini
33+ if ($LASTEXITCODE -ne 0 ) {
34+ Write-Host " Pytest invocation was unsuccessful. Exit code: $LASTEXITCODE ."
35+ exit $LASTEXITCODE
36+ }
Original file line number Diff line number Diff line change 1919 required : false
2020 type : string
2121 description : Install ExecuTorch in editable mode or not.
22+ default : ' false'
2223 python-version :
2324 required : false
2425 type : string
5253 # This is needed to get the prebuilt PyTorch wheel from S3
5354 ${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
5455 .ci/scripts/unittest-macos.sh --build-tool "${{ inputs.build-tool }}" --build-mode "${{ inputs.build-mode }}" --editable "${{ inputs.editable }}"
56+
57+ windows :
58+ if : ${{ inputs.build-tool == 'cmake' }}
59+ uses : pytorch/test-infra/.github/workflows/windows_job.yml@main
60+ with :
61+ submodules : ' recursive'
62+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
63+ timeout : 120
64+ script : |
65+ conda init powershell
66+ powershell .ci/scripts/unittest-windows.ps1 -editable "${{ inputs.editable }}"
Original file line number Diff line number Diff line change @@ -65,3 +65,7 @@ xcuserdata/
6565
6666# Android
6767* .aar
68+
69+ # Windows
70+ * .dll
71+ * .pyd
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ endforeach()
6262if (WIN32 AND NOT CMAKE_CROSSCOMPILING )
6363 set (MV_COMMAND
6464 powershell -Command
65- "Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs} "
65+ "Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs} -Force "
6666 )
6767else ()
6868 set (MV_COMMAND mv ${_xnnpack_flatbuffer__outputs} ${_xnnpack_schema__outputs} )
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ collect_ignore_glob : list [str ] = []
4+
5+ # Skip Apple tests on Windows. Note that some Core ML tests can run on Linux, as the AOT flow
6+ # is available. Tests will manage this internally. However, the coremltools import is not available
7+ # on Windows and causes collection to fail. The easiest way to manage this seems to be to just
8+ # skip collection for this subdirectory on unsupported platforms.
9+ if sys .platform == "win32" :
10+ collect_ignore_glob += [
11+ "backends/apple/**" ,
12+ ]
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ find "$CMAKE_BUILD_DIR_PATH/" -name 'libcoreml_inmemoryfs.a' -exec cp -f "{}" "$
9393find " $CMAKE_BUILD_DIR_PATH /" -name ' libcoremldelegate.a' -exec cp -f " {}" " $LIBRARIES_DIR_PATH /libcoremldelegate.a" \;
9494find " $CMAKE_BUILD_DIR_PATH /" -name ' libportable_ops_lib.a' -exec cp -f " {}" " $LIBRARIES_DIR_PATH /libportable_ops_lib.a" \;
9595find " $CMAKE_BUILD_DIR_PATH /" -name ' libportable_kernels.a' -exec cp -f " {}" " $LIBRARIES_DIR_PATH /libportable_kernels.a" \;
96- cp -f " $CMAKE_BUILD_DIR_PATH /third-party/flatcc_external_project /lib/libflatccrt.a" " $LIBRARIES_DIR_PATH /libflatccrt.a"
96+ cp -f " $CMAKE_BUILD_DIR_PATH /third-party/flatcc_ep /lib/libflatccrt.a" " $LIBRARIES_DIR_PATH /libflatccrt.a"
9797
9898# Build the runner
9999echo " ExecuTorch: Building runner"
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ def replace_kv_cache_with_quantized_kv_cache(module):
269269 executorch_package_path = executorch .__path__ [- 1 ]
270270 libs = list (
271271 glob .glob (
272- f"{ executorch_package_path } /**/libquantized_ops_aot_lib .*" ,
272+ f"{ executorch_package_path } /**/*quantized_ops_aot_lib .*" ,
273273 recursive = True ,
274274 )
275275 )
Original file line number Diff line number Diff line change 4848from torch ._decomp import get_decompositions
4949from torch ._dynamo .guards import Guard
5050from torch ._functorch .eager_transforms import _maybe_unwrap_functional_tensor
51+
5152from torch .export import default_decompositions
5253from torch .func import functionalize
5354from torch .fx .operator_schemas import normalize_function
Original file line number Diff line number Diff line change 3333 package_path = Path (__file__ ).parent .resolve ()
3434 logging .info (f"Looking for libcustom_ops_aot_lib.so in { package_path } " )
3535
36- libs = list (package_path .glob ("**/libcustom_ops_aot_lib .*" ))
36+ libs = list (package_path .glob ("**/*custom_ops_aot_lib .*" ))
3737
3838 assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
3939 logging .info (f"Loading custom ops library: { libs [0 ]} " )
Original file line number Diff line number Diff line change 1313 tile_crop = torch .ops .preprocess .tile_crop .default
1414 assert tile_crop is not None
1515except :
16- libs = list (Path (__file__ ).parent .resolve ().glob ("libcustom_ops_aot_lib .*" ))
16+ libs = list (Path (__file__ ).parent .resolve ().glob ("*custom_ops_aot_lib .*" ))
1717 assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
1818 logging .info (f"Loading custom ops library: { libs [0 ]} " )
1919 torch .ops .load_library (libs [0 ])
You can’t perform that action at this time.
0 commit comments