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 19
19
required : false
20
20
type : string
21
21
description : Install ExecuTorch in editable mode or not.
22
+ default : ' false'
22
23
python-version :
23
24
required : false
24
25
type : string
52
53
# This is needed to get the prebuilt PyTorch wheel from S3
53
54
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
54
55
.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/
65
65
66
66
# Android
67
67
* .aar
68
+
69
+ # Windows
70
+ * .dll
71
+ * .pyd
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ endforeach()
62
62
if (WIN32 AND NOT CMAKE_CROSSCOMPILING )
63
63
set (MV_COMMAND
64
64
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 "
66
66
)
67
67
else ()
68
68
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 "{}" "$
93
93
find " $CMAKE_BUILD_DIR_PATH /" -name ' libcoremldelegate.a' -exec cp -f " {}" " $LIBRARIES_DIR_PATH /libcoremldelegate.a" \;
94
94
find " $CMAKE_BUILD_DIR_PATH /" -name ' libportable_ops_lib.a' -exec cp -f " {}" " $LIBRARIES_DIR_PATH /libportable_ops_lib.a" \;
95
95
find " $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"
97
97
98
98
# Build the runner
99
99
echo " 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):
269
269
executorch_package_path = executorch .__path__ [- 1 ]
270
270
libs = list (
271
271
glob .glob (
272
- f"{ executorch_package_path } /**/libquantized_ops_aot_lib .*" ,
272
+ f"{ executorch_package_path } /**/*quantized_ops_aot_lib .*" ,
273
273
recursive = True ,
274
274
)
275
275
)
Original file line number Diff line number Diff line change 48
48
from torch ._decomp import get_decompositions
49
49
from torch ._dynamo .guards import Guard
50
50
from torch ._functorch .eager_transforms import _maybe_unwrap_functional_tensor
51
+
51
52
from torch .export import default_decompositions
52
53
from torch .func import functionalize
53
54
from torch .fx .operator_schemas import normalize_function
Original file line number Diff line number Diff line change 33
33
package_path = Path (__file__ ).parent .resolve ()
34
34
logging .info (f"Looking for libcustom_ops_aot_lib.so in { package_path } " )
35
35
36
- libs = list (package_path .glob ("**/libcustom_ops_aot_lib .*" ))
36
+ libs = list (package_path .glob ("**/*custom_ops_aot_lib .*" ))
37
37
38
38
assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
39
39
logging .info (f"Loading custom ops library: { libs [0 ]} " )
Original file line number Diff line number Diff line change 13
13
tile_crop = torch .ops .preprocess .tile_crop .default
14
14
assert tile_crop is not None
15
15
except :
16
- libs = list (Path (__file__ ).parent .resolve ().glob ("libcustom_ops_aot_lib .*" ))
16
+ libs = list (Path (__file__ ).parent .resolve ().glob ("*custom_ops_aot_lib .*" ))
17
17
assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
18
18
logging .info (f"Loading custom ops library: { libs [0 ]} " )
19
19
torch .ops .load_library (libs [0 ])
You can’t perform that action at this time.
0 commit comments