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
52 changes: 52 additions & 0 deletions .ci/scripts/setup-windows-msvc.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
conda create --yes --quiet -n et python=3.12
conda activate et

# Install cmake
conda install -y cmake

# Activate the VS environment - this is required for MSVC to work
# There are a bunch of environment variables that it requires.
# See https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line.
& "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64

# Install CI requirements
pip install -r .ci/docker/requirements-ci.txt

# Create build directory
$buildDir = "cmake-out-msvc"
if (Test-Path -Path $buildDir) {
Remove-Item -Path $buildDir -Recurse -Force
}
New-Item -Path $buildDir -ItemType Directory

# Configure CMake with MSVC (not ClangCL) and disable custom/quantized ops
cmake -S . -B $buildDir `
-DCMAKE_BUILD_TYPE=Release `
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=ON `
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON `
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON `
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON `
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON `
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON `
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON `
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=OFF `
-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=OFF `
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=OFF `
-DEXECUTORCH_BUILD_XNNPACK=ON `
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON `
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON

if ($LASTEXITCODE -ne 0) {
Write-Host "CMake configuration failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

# Build with MSVC
cmake --build $buildDir --config Release -j16

if ($LASTEXITCODE -ne 0) {
Write-Host "Build failed. Exit code: $LASTEXITCODE."
exit $LASTEXITCODE
}

Write-Host "MSVC build completed successfully!"
37 changes: 37 additions & 0 deletions .github/workflows/windows-msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Windows MSVC Build

on:
push:
branches:
- main
- release/*
tags:
- ciflow/trunk/*
pull_request:
paths:
- .ci/docker/ci_commit_pins/pytorch.txt
- .ci/scripts/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

jobs:
build-windows-msvc:
name: build-windows-msvc
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 }}
timeout: 60
script: |
conda init powershell

powershell -Command "& {
Set-PSDebug -Trace 1
\$ErrorActionPreference = 'Stop'
\$PSNativeCommandUseErrorActionPreference = \$true

.ci/scripts/setup-windows-msvc.ps1
}"
2 changes: 1 addition & 1 deletion extension/llm/tokenizers
Loading