Skip to content

Fix native Windows CUDA compilation - #26

Open
chinazhangchao wants to merge 3 commits into
deepseek-ai:mainfrom
chinazhangchao:chao/windows
Open

chinazhangchao wants to merge 3 commits into
deepseek-ai:mainfrom
chinazhangchao:chao/windows

Conversation

@chinazhangchao

@chinazhangchao chinazhangchao commented Oct 21, 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 CUDA support. Could you please help to review? Thanks.

This pull request adds robust support for Windows CUDA builds, improves platform detection, and introduces a portable 128-bit payload type for CUDA kernels. It ensures correct compiler and linker flags for both Windows and Linux, provides clear build instructions, and adds comprehensive tests for CUDA build portability and platform-specific logic.

Platform portability and build improvements:

  • Added detailed Windows CUDA build instructions to README.md, including requirements, environment setup, and testing steps.
  • Updated setup.py to detect Windows vs. Linux, set appropriate compiler flags, library directories, and handle CUTLASS submodule checks. Now supports both platforms with correct arguments and error handling. [1] [2] [3]
  • Improved platform detection in tests/kernelkit/platform.py to use PyTorch's CUDA availability instead of relying on lspci, making it cross-platform and not dependent on system tools. [1] [2]
  • Adjusted tool paths in tests/kernelkit/build.py to use the correct executable (cuobjdump.exe on Windows, cuobjdump on Linux).

CUDA kernel portability and 128-bit payload handling:

  • Introduced a portable int128_t type in kerutils/device/cuda/common.h, using int4 on MSVC (Windows) and __int128_t elsewhere, with a helper function for construction. Updated all relevant CUDA kernels and helpers to use this type for 128-bit shared memory operations, ensuring correct alignment and compatibility across compilers. [1] [2] [3] [4] [5] [6] [7] [8]

Testing and validation:

  • Added tests/cuda_portability.cu to verify 128-bit payload storage, retrieval, and round-trip correctness across platforms and compilers.
  • Added tests/test_cuda_build.py to test setup arguments, CUTLASS submodule checks, explicit CUDA targeting without a GPU, and platform-specific tool paths, ensuring the build system behaves correctly on both Windows and Linux.

chinazhangchao and others added 2 commits October 21, 2026 12:11
Adapt and refine the DeepSelect fixes from vortex-captain/vllm-windows commit 7d75d7f4917e4e248860fb19ec66c7ea9b25fa15.

Centralize portable 128-bit payload construction while preserving the Linux PTX path. Avoid the CUTLASS host-adapter dependency through narrower CuTe includes instead of modifying the submodule. Select native Windows build flags, driver linkage, and CUDA tool paths, and add compilation and build-configuration regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@chinazhangchao
chinazhangchao marked this pull request as ready for review October 21, 2026 08:38
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