Skip to content

Add native windows support. - #238

Open
chinazhangchao wants to merge 1 commit into
deepseek-ai:mainfrom
chinazhangchao:chao/windows
Open

chinazhangchao wants to merge 1 commit into
deepseek-ai:mainfrom
chinazhangchao:chao/windows

Conversation

@chinazhangchao

@chinazhangchao chinazhangchao commented Oct 22, 2026 •

Copy link
Copy Markdown

Hi @interestingLSY , I'm from Microsoft and recently I'm working on improving Windows ARM64 ecosystem support.
So I adds native Windows support for FlashMLA. Could you please help to review? Thanks.

This pull request introduces several important changes to improve Windows CUDA build compatibility, particularly with MSVC, and to enhance cross-platform support in CUDA kernel code. The changes include applying a CUTLASS patch for Windows, introducing MSVC-specific type and assembly handling, and adding compile-time checks for kernel features. These updates ensure that the codebase builds and runs correctly on both Linux and Windows platforms, especially with the MSVC toolchain.

Windows and MSVC compatibility improvements:

  • Added documentation in README.md about automatic application of the csrc/3rdparty/cutlass-windows.patch during Windows CUDA builds, detailing requirements and patch origin.
  • Introduced the cutlass-windows.patch file, which adds MSVC-specific guards and fixes to CUTLASS headers for Windows CUDA/MSVC builds.
  • Defined a new int128_t type as int4 for MSVC and adjusted all relevant CUDA kernel code to use int128_t instead of __int128_t, including MSVC-specific inline assembly for shared memory operations. [1] [2] [3] [4] [5] [6]

Cross-platform kernel and build logic:

  • Updated kernel launch and function definitions to handle MSVC-specific syntax and template instantiation, ensuring correct kernel launches on both Windows and Linux. [1] [2]
  • Added compile-time guards to CUDA kernel code to ensure certain kernels are only used when the appropriate architecture feature (CUTE_ARCH_TCGEN05_F16F32_MMA_ENABLED) is enabled, providing clearer error messages otherwise. [1] [2] [3] [4] [5] [6] [7] [8]

General code improvements:

  • Replaced use of __builtin_clz with cute::bit_floor for better portability in device intrinsics.

These changes collectively enhance the portability and reliability of the CUDA codebase for both Windows (MSVC) and Linux environments.

@chinazhangchao chinazhangchao changed the title add windows support Add native windows support. Oct 22, 2026
@chinazhangchao
chinazhangchao marked this pull request as ready for review October 22, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant