Commit 566a7ed
committed
[Windows] misc fixes to enable Windows build
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 4f02b33 commit 566a7ed
File tree
4 files changed
+28
-18
lines changed- backends/xnnpack
- extension/llm/custom_ops
4 files changed
+28
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | | - | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| 95 | + | |
| 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 | + | |
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
| |||
| 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 | | |
| |||
0 commit comments