mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #373] [CLOSED] HIP: build with Visual Studio 2026's C++ library (MSVC 14.51+) #2603
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2603
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/373
Author: @BlueKingMuch
Created: 10/1/2026
Status: ❌ Closed
Base:
main← Head:win-vs2026📝 Commits (10+)
2575cb1C-3: the prompt path's GDN short conv tiled over tokensdf6980dE-2: prefetch the i-quant expert rows ahead of the AVX-512 decode; an opt-in gather decodecf68b00D-5: the prompt path's expert stream is issued by its own host threadcb91f2aserve: keep image parts in tool/assistant messages456011eLayer split limits: docs/MULTI_GPU.md and bench/results/2026-09-29-layer-split-limitsf0bbe97E-4 (prompt side): the draft layer's pass over a prompt chunk without a host sync per groupefddd74E-6: a verify layer whose routed experts are all in VRAM needs nothing from the host66f4341D-2: the prompt path's GDN recurrence split over value columns, the output norm in its own kernel0abcd5bE-6: the device plan opt-in (STRATA_VERIFY_DEVICE_PLAN=1)57fa1fdserve: routing traces from the live server (--dump-routing under --serve)📊 Changes
2 files changed (+22 additions, -0 deletions)
View changed files
📝
cmake/hip_backend.cmake(+8 -0)➕
include/strata/hip_compat/windows/cmath(+14 -0)📄 Description
With the HIP SDK 7.2 and the C++ library of Visual Studio 2026 18.6 or newer (MSVC 14.51+), every HIP compile on Windows fails, CMake's identification of the HIP compiler included, so the Windows HIP engine (#356) does not get past the configure:
Since MSVC 14.51 the Microsoft STL declares
isgreater,isless& co.constexprwhen the compiler is clang (microsoft/STL#5717). The HIP SDK 7.2's clang includes<cmath>before its own__device__math declarations, so thoseconstexprfunctions are already implicitly__host__ __device__when clang's__device__overloads arrive, and the two collide. clang with llvm/llvm-project#201563 includes its declarations first; llama.cpp ran into the same error (ggml-org/llama.cpp#22570).What changes
include/strata/hip_compat/windows/cmathis found for<cmath>ahead of the Visual Studio headers. It includes clang's__clang_cuda_math_forward_declares.h(HIP compiles only, not hipRTC), then the real<cmath>with#include_next: the order llvm/llvm-project#201563 gives clang itself.cmake/hip_backend.cmakeputs that folder onCMAKE_HIP_FLAGSbeforeenable_language(HIP), on Windows only, so CMake's compiler checks get it too.With an older MSVC the order makes no difference (its comparisons are not
constexpr), and a clang that has the fix includes the declarations first by itself; their header has an include guard, so it is read once either way. Linux and CUDA builds never see the folder.Tested
Windows 11, Visual Studio 2026 Build Tools (MSVC 14.51), HIP SDK 7.2 (clang 21), CMake 4.0.1, RX 6800. Without the folder the configure stops at the HIP compiler's identification with the error above (that compile is CMake's own test file, so it does not depend on Strata's sources; seen here on 0.1.30 with #247's Windows build). With it, 0.1.31 with #356 and #311 configures, builds and runs.
Not tested with MSVC 14.50 or older. Going by the STL's changelog and sources, those declare these comparisons
inline, notconstexpr, so they should not need this, and the reordering does nothing there.🤖 Generated with Claude Code
https://claude.ai/code/session_015Ld5YDzuKW1hgMVwwgRZDP
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.