[PR #284] Windows support #342

Open
opened 2026-10-26 21:16:28 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/284
Author: @tori29umai0123
Created: 2/2/2026
Status: 🔄 Open

Base: main ← Head: windows-support


📝 Commits (4)

📊 Changes

30 files changed (+811 additions, -534 deletions)

View changed files

📝 .gitignore (+8 -1)
📝 CMakeLists.txt (+19 -4)
📝 README.md (+58 -1)
📝 csrc/apis/gemm.hpp (+55 -35)
📝 csrc/jit/cache.hpp (+3 -2)
📝 csrc/jit/compiler.hpp (+42 -10)
📝 csrc/jit/handle.hpp (+34 -4)
📝 csrc/jit/kernel_runtime.hpp (+29 -12)
📝 csrc/jit_kernels/heuristics/common.hpp (+15 -9)
📝 csrc/jit_kernels/heuristics/sm100.hpp (+3 -3)
📝 csrc/jit_kernels/impls/sm100_bf16_gemm.hpp (+61 -61)
📝 csrc/jit_kernels/impls/sm100_bmk_bnk_mn.hpp (+11 -12)
📝 csrc/jit_kernels/impls/sm100_fp8_gemm_1d1d.hpp (+72 -77)
📝 csrc/jit_kernels/impls/sm100_tf32_hc_prenorm_gemm.hpp (+12 -13)
📝 csrc/jit_kernels/impls/sm90_bf16_gemm.hpp (+61 -61)
📝 csrc/jit_kernels/impls/sm90_bmk_bnk_mn.hpp (+10 -11)
📝 csrc/jit_kernels/impls/sm90_fp8_gemm_1d1d.hpp (+31 -31)
📝 csrc/jit_kernels/impls/sm90_fp8_gemm_1d2d.hpp (+58 -58)
📝 csrc/jit_kernels/impls/sm90_tf32_hc_prenorm_gemm.hpp (+12 -13)
📝 csrc/jit_kernels/impls/smxx_clean_logits.hpp (+11 -11)

...and 10 more files

📄 Description

Summary

This PR adds Windows/MSVC build support for DeepGEMM while maintaining full compatibility with existing Linux/GCC
builds.

Changes

MSVC Compatibility Layer

  • Add csrc/utils/msvc_compat.hpp with POSIX compatibility macros (popen, pclose, WEXITSTATUS)
  • Add DG_MSVC preprocessor macro for platform-conditional compilation

Code Fixes for MSVC

  • Convert C++20 designated initializers to positional brace initialization (MSVC requires aggregate types)
  • Fix std::filesystem::path handling (use .string() for conversions, as c_str() returns wchar_t* on Windows)
  • Add .exe suffix for Windows executables (nvcc.exe, cuobjdump.exe)

Build System

  • Update setup.py with Windows-specific compiler flags (/std:c++latest, /O2, /EHsc, etc.)
  • Add cuBLASLt and cuBLAS library linking
  • Fix wheel platform tag (lowercase win_amd64)
  • Fix wheel filename format to comply with PEP 427

Documentation

  • Add Windows build instructions to README.md

Testing

  • Successfully built on Windows 11 with:
    • Visual Studio 2022 (MSVC 14.43)
    • CUDA Toolkit 12.8
    • PyTorch 2.10
    • Python 3.10

Notes

  • All changes use conditional compilation to preserve Linux/GCC compatibility
  • No changes to kernel code or CUDA device code

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepGEMM/pull/284 **Author:** [@tori29umai0123](https://github.com/tori29umai0123) **Created:** 2/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `windows-support` --- ### 📝 Commits (4) - [`ff59631`](https://github.com/deepseek-ai/DeepGEMM/commit/ff59631c511c0d37cf11325ea6d5ed3c2aad4e70) Add Windows/MSVC compatibility support - [`f2ee7a4`](https://github.com/deepseek-ai/DeepGEMM/commit/f2ee7a45214561f85f0b6cd6f3e0baf15e458ac1) bug fix - [`1fab197`](https://github.com/deepseek-ai/DeepGEMM/commit/1fab197d601af1a98602f61c58434832a9b42f8b) Windows compatible - [`8d143f8`](https://github.com/deepseek-ai/DeepGEMM/commit/8d143f85b47fec86e6718a56135955a61ba92718) Windows compatible ### 📊 Changes **30 files changed** (+811 additions, -534 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+8 -1) 📝 `CMakeLists.txt` (+19 -4) 📝 `README.md` (+58 -1) 📝 `csrc/apis/gemm.hpp` (+55 -35) 📝 `csrc/jit/cache.hpp` (+3 -2) 📝 `csrc/jit/compiler.hpp` (+42 -10) 📝 `csrc/jit/handle.hpp` (+34 -4) 📝 `csrc/jit/kernel_runtime.hpp` (+29 -12) 📝 `csrc/jit_kernels/heuristics/common.hpp` (+15 -9) 📝 `csrc/jit_kernels/heuristics/sm100.hpp` (+3 -3) 📝 `csrc/jit_kernels/impls/sm100_bf16_gemm.hpp` (+61 -61) 📝 `csrc/jit_kernels/impls/sm100_bmk_bnk_mn.hpp` (+11 -12) 📝 `csrc/jit_kernels/impls/sm100_fp8_gemm_1d1d.hpp` (+72 -77) 📝 `csrc/jit_kernels/impls/sm100_tf32_hc_prenorm_gemm.hpp` (+12 -13) 📝 `csrc/jit_kernels/impls/sm90_bf16_gemm.hpp` (+61 -61) 📝 `csrc/jit_kernels/impls/sm90_bmk_bnk_mn.hpp` (+10 -11) 📝 `csrc/jit_kernels/impls/sm90_fp8_gemm_1d1d.hpp` (+31 -31) 📝 `csrc/jit_kernels/impls/sm90_fp8_gemm_1d2d.hpp` (+58 -58) 📝 `csrc/jit_kernels/impls/sm90_tf32_hc_prenorm_gemm.hpp` (+12 -13) 📝 `csrc/jit_kernels/impls/smxx_clean_logits.hpp` (+11 -11) _...and 10 more files_ </details> ### 📄 Description ## Summary This PR adds Windows/MSVC build support for DeepGEMM while maintaining full compatibility with existing Linux/GCC builds. ## Changes ### MSVC Compatibility Layer - Add `csrc/utils/msvc_compat.hpp` with POSIX compatibility macros (`popen`, `pclose`, `WEXITSTATUS`) - Add `DG_MSVC` preprocessor macro for platform-conditional compilation ### Code Fixes for MSVC - Convert C++20 designated initializers to positional brace initialization (MSVC requires aggregate types) - Fix `std::filesystem::path` handling (use `.string()` for conversions, as `c_str()` returns `wchar_t*` on Windows) - Add `.exe` suffix for Windows executables (nvcc.exe, cuobjdump.exe) ### Build System - Update `setup.py` with Windows-specific compiler flags (`/std:c++latest`, `/O2`, `/EHsc`, etc.) - Add cuBLASLt and cuBLAS library linking - Fix wheel platform tag (lowercase `win_amd64`) - Fix wheel filename format to comply with PEP 427 ### Documentation - Add Windows build instructions to README.md ## Testing - Successfully built on Windows 11 with: - Visual Studio 2022 (MSVC 14.43) - CUDA Toolkit 12.8 - PyTorch 2.10 - Python 3.10 ## Notes - All changes use conditional compilation to preserve Linux/GCC compatibility - No changes to kernel code or CUDA device code --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepGEMM#342
No description provided.