diff --git a/.ci/scripts/setup-windows-msvc.ps1 b/.ci/scripts/setup-windows-msvc.ps1 new file mode 100644 index 00000000000..e15a003d803 --- /dev/null +++ b/.ci/scripts/setup-windows-msvc.ps1 @@ -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!" diff --git a/.github/workflows/windows-msvc.yml b/.github/workflows/windows-msvc.yml new file mode 100644 index 00000000000..de813b5632d --- /dev/null +++ b/.github/workflows/windows-msvc.yml @@ -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 + }" diff --git a/extension/llm/tokenizers b/extension/llm/tokenizers index 572e4073117..0bcd9f5325c 160000 --- a/extension/llm/tokenizers +++ b/extension/llm/tokenizers @@ -1 +1 @@ -Subproject commit 572e4073117cb8f8bb4651d2e738ae0d3a4f476a +Subproject commit 0bcd9f5325c42d2e05765d584131900dbc8835c8