Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .ci/scripts/unittest-windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Set-PSDebug -Trace 1
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true

conda create --yes --quiet -n et python=3.12
conda activate et

install_executorch.bat
if ($LASTEXITCODE -ne 0) {
Write-Host "Installation was unsuccessful. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

# Run pytest with coverage
pytest -n auto --cov=./ --cov-report=xml
9 changes: 9 additions & 0 deletions .github/workflows/_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ jobs:
# This is needed to get the prebuilt PyTorch wheel from S3
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
.ci/scripts/unittest-macos.sh --build-tool "${{ inputs.build-tool }}" --build-mode "${{ inputs.build-mode }}" --editable "${{ inputs.editable }}"

windows:
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
with:
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
conda init powershell
powershell .ci/scripts/unittest-windows.ps1
2 changes: 1 addition & 1 deletion backends/xnnpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ endforeach()
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(MV_COMMAND
powershell -Command
"Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}"
"Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs} -Force"
)
else()
set(MV_COMMAND mv ${_xnnpack_flatbuffer__outputs} ${_xnnpack_schema__outputs})
Expand Down
5 changes: 0 additions & 5 deletions install_executorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ def main(args):
return

cmake_args = [os.getenv("CMAKE_ARGS", "")]
# Use ClangCL on Windows.
# ClangCL is an alias to Clang that configures it to work in an MSVC-compatible
# mode. Using it on Windows to avoid compiler compatibility issues for MSVC.
if os.name == "nt":
cmake_args.append("-T ClangCL")
os.environ["CMAKE_ARGS"] = " ".join(cmake_args)

check_and_update_submodules()
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ def run(self): # noqa C901
f"-DCMAKE_BUILD_TYPE={cmake_build_type}",
]

# Use ClangCL on Windows.
if _is_windows():
cmake_configuration_args += ["-T ClangCL"]

# Allow adding extra cmake args through the environment. Used by some
# tests and demos to expand the set of targets included in the pip
# package.
Expand Down Expand Up @@ -795,7 +799,8 @@ def run(self): # noqa C901
dependent_cmake_flags=["EXECUTORCH_BUILD_EXTENSION_TRAINING"],
),
BuiltExtension(
src="codegen/tools/selective_build.*",
src_dir="%CMAKE_CACHE_DIR%/codegen/tools/%BUILD_TYPE%/",
src="selective_build.cp*" if _is_windows() else "selective_build.*",
modpath="executorch.codegen.tools.selective_build",
dependent_cmake_flags=["EXECUTORCH_BUILD_PYBIND"],
),
Expand Down
Loading