From 2d110d256dbfa5de95ae535f7b21549a42557b2b Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Mon, 10 Nov 2025 13:22:16 -0800 Subject: [PATCH 1/2] only block when building with MSVC --- tools/cmake/preset/llm.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/cmake/preset/llm.cmake b/tools/cmake/preset/llm.cmake index 231a25f0c1e..cde7d0622f5 100644 --- a/tools/cmake/preset/llm.cmake +++ b/tools/cmake/preset/llm.cmake @@ -18,9 +18,7 @@ set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) # Turn on the quantized and LLM kernels unless on windows cuda build which # currently doesn't support this due to using msvc. -if(NOT (EXECUTORCH_BUILD_CUDA AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" - OR CMAKE_SYSTEM_NAME STREQUAL "WIN32")) -) +if(NOT (EXECUTORCH_BUILD_CUDA AND MSVC)) set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) endif() From b3af9b063f87af51701600dacc6cfaf4a24087aa Mon Sep 17 00:00:00 2001 From: Jacob Szwejbka Date: Mon, 10 Nov 2025 13:32:34 -0800 Subject: [PATCH 2/2] try 2 --- tools/cmake/preset/llm.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/cmake/preset/llm.cmake b/tools/cmake/preset/llm.cmake index cde7d0622f5..86a1c0dbe1b 100644 --- a/tools/cmake/preset/llm.cmake +++ b/tools/cmake/preset/llm.cmake @@ -16,11 +16,21 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) -# Turn on the quantized and LLM kernels unless on windows cuda build which -# currently doesn't support this due to using msvc. -if(NOT (EXECUTORCH_BUILD_CUDA AND MSVC)) +# Turn on the quantized and LLM kernels unless on Windows with MSVC build since +# they don't currently compile. +if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL + "WIN32") AND MSVC) +) set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) +else() + if(NOT EXECUTORCH_BUILD_CUDA) + message( + WARNING + "The llm custom kernels and the quantized kernels will not be built when using MSVC on Windows. " + "If you need them (since you appear to be building for CPU) try building with -T ClangCL" + ) + endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")