Commit 3137889
authored
[Windows] misc fixes to enable Windows build (#9198)
Summary:
## Context
Implement some small miscellaneous fixes to enable installing ExecuTorch
on Windows. Currently, the optimized kernels cannot be built
successfully but the installation works in custom ops are not built.
## Installation
```powershell
cd executorch
# Need to disable building custom kernels; there are a bunch of build errors
$env:EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=0
# For some reason need to explicitly enable tensor extension otherwise I see a linker error
$env:CMAKE_ARGS="-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON"
python install_executorch.py
# Unset if you want
Remove-Item Env:\EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT
Remove-Item Env:\CMAKE_ARGS
```
## Testing
I am able to follow the [Getting Started
tutorial](https://pytorch.org/executorch/stable/getting-started-setup.html#run-your-program)
successfully.
## Outstanding Build Issues
Currently, with CMake I can successfully build with the following
settings:
```
del -Recurse -Force cmake-out; `
cmake . `
-DCMAKE_INSTALL_PREFIX=cmake-out `
-DPYTHON_EXECUTABLE=C:\\Users\\ssjia\\AppData\\Local\\miniconda3\\python.exe `
-DCMAKE_PREFIX_PATH=C:\\Users\\ssjia\\AppData\\Local\\miniconda3\\Lib\\site-packages `
-DCMAKE_BUILD_TYPE=Release `
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON `
-DEXECUTORCH_BUILD_PYBIND=ON `
-DEXECUTORCH_BUILD_XNNPACK=ON `
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON `
-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=ON `
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=OFF `
-T ClangCL `
-Bcmake-out; `
cmake --build cmake-out -j64 --target install
```
If I switch `EXECUTORCH_BUILD_KERNELS_CUSTOM` to `ON`, then the build
fails. The primary offenders appear to be the `gelu`. The implementation
includes a header from ATen which is causing the majority of the errors.1 parent d44d6cd commit 3137889
File tree
5 files changed
+41
-21
lines changed- backends/xnnpack
- extension/llm/custom_ops
5 files changed
+41
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
510 | 509 | | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
514 | 513 | | |
515 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
516 | 521 | | |
517 | 522 | | |
518 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
93 | | - | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 10 | + | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
20 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
356 | 359 | | |
357 | 360 | | |
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
362 | 370 | | |
363 | | - | |
| 371 | + | |
364 | 372 | | |
365 | 373 | | |
366 | 374 | | |
| |||
780 | 788 | | |
781 | 789 | | |
782 | 790 | | |
783 | | - | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
784 | 797 | | |
785 | 798 | | |
786 | 799 | | |
| |||
0 commit comments