[PR #69] [CLOSED] Add Windows support for AMD HIP backend with Strix Halo/Gorgon Halo #313

Closed
opened 2026-10-29 21:24:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/69
Author: @mw00
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: claude/eager-carson-bhc1g4


📝 Commits (7)

  • 53b0869 AMD on Windows: START-MAYA.bat --backend hip, Strix Halo / Gorgon Halo included
  • ec6bf8f Windows HIP: VS 2026, rocm-sdk init first, the SDK's HIP runtime beside strata.exe
  • 10c0c7d Merge remote-tracking branch 'origin/main' into claude/eager-carson-bhc1g4
  • 49df00f Windows HIP on a real Gorgon Halo: AMD's HIP SDK, every launch submitted, the HIP checks pass
  • 76cdf6a Merge remote-tracking branch 'origin/main' into claude/eager-carson-bhc1g4
  • 3ba9eb7 Maya-L runs on a Gorgon Halo under Windows: the pool in pieces, submission without flushing every launch
  • e93e42d Merge remote-tracking branch 'origin/claude/eager-carson-bhc1g4' into claude/eager-carson-bhc1g4

📊 Changes

13 files changed (+799 additions, -72 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 CHANGELOG.md (+28 -0)
📝 README.md (+12 -7)
📝 docs/AMD_MAYA.md (+52 -2)
📝 include/strata/hip_compat/cuda_runtime.h (+3 -0)
📝 maya.py (+228 -45)
📝 setup.py (+85 -9)
📝 src/core/glm_fast_path.cu (+70 -3)
📝 src/core/glm_fast_state.hpp (+3 -1)
📝 tests/hip/glm_handoff.cpp (+5 -2)
📝 tests/hip/handoff.cpp (+4 -2)
📝 tests/hip/prefill_mmq_parity.cpp (+4 -1)
📝 tools/test_maya_hip.py (+304 -0)

📄 Description

Summary

Native Windows support for Maya's experimental AMD HIP backend: START-MAYA.bat --backend hip now sets Maya up on Windows 10/11 as ./maya.sh --backend hip does on Linux, for Strix Halo / Gorgon Halo (Ryzen AI Max 300 / 400, Radeon 8050S / 8060S / 8065S, gfx1151) and the discrete cards (RX 7900 XT / XTX, RX 9070 / R9700). Before, check_hip_pc refused Windows and only the manual tools\hip\build_maya_windows.bat (#54) existed.

Key Changes

  • GPU detection (setup.py): parse_hipinfo() reads ROCm's hipInfo (HIP's own order and gcnArchName); without it, parse_display_adapters() reads Windows' AMD display adapters from the registry (PCI device ID, then name). hipInfo that sees no GPU warns before the compile and the download.
  • ROCm (maya.py): ROCM_PATH, else TheRock's rocm-sdk (ROCM_VENV, Maya's .venv, PATH; rocm-sdk init runs, shown and with no time limit, before any rocm-sdk path), else AMD's HIP SDK (HIP_PATH, else the newest in C:\Program Files\AMD\ROCm). With none, the setup offers rocm[libraries,devel,device-<arch>]==7.14.1 from repo.amd.com/rocm/whl-multi-arch into .venv, and does the same when a chosen GPU's rocm-sdk-device-<arch> is missing; --check prints the command instead.
  • Build: compile_engine_hip() on Windows follows build_maya_windows.bat: ROCm's clang for C/C++/HIP, Ninja, vcvars64, forward-slash paths, STRATA_PORTABLE=ON, HIP_DEVICE_LIB_PATH. Visual Studio Build Tools 2022 or 2026 (find_vcvars(cuda=False); the [16, 18) cap stays CUDA-only), checked before the ROCm download. The SDK's amdhip64*.dll, amd_comgr*.dll and rocm_kpack*.dll are copied next to build-hip\strata.exe, because Windows loads System32's (the driver's HIP runtime) before PATH.
  • Engine on a Windows APU:
    • F->unified_memory is not set on Windows. Windows gives the APU's GPU a fixed carve-out (Variable Graphics Memory) that it does not count as RAM, so the APU is sized like a discrete card: the pool from cudaMemGetInfo free, the RAM tier from min(free RAM, free commit). Linux is unchanged.
    • Windows' HIP runtime allocates at most 64 GiB plus the RAM Windows sees in one piece, so a larger pool goes into several allocations, each holding whole layers. This only happens when one allocation fails.
    • Windows' HIP runtime holds queued launches until the host waits. The service thread therefore submits them with cudaStreamQuery after 1 ms without a route, under _WIN32 && STRATA_USE_HIP only.
  • Config for a Windows APU: STRATA_GLM_RESERVE_MB=3072 (the desktop runs on that GPU), and the prompt budget is picked by RAM + GPU memory.
  • --report on Windows lists hipInfo's GPUs. Docs (README, docs/AMD_MAYA.md#windows, CHANGELOG) and installer tests in tools/test_maya_hip.py. Two HIP test fixes in tests/hip/ (glm_handoff's skip_from argument; prefill_mmq_parity's sentinel memset on the null stream).

Status

Run on a Ryzen AI Max+ PRO 495 / Radeon 8065S (Gorgon Halo, 192 GB, 160 GB of it the GPU's), Windows 11, HIP SDK 7.2:

  • Setup downloads, builds and packs Maya-L, and every expert stays in the GPU pool (134.3 GB).
  • --bench decodes 15.9 tokens/s and reads 345 tokens/s of an 8K-token prompt.
  • Answers, a 4.7K-token prompt and thinking mode come out right.
  • All 15 HIP checks of docs/AMD_MAYA.md pass.

The TheRock-wheel install path (rocm-sdk) was not the one exercised there.

https://claude.ai/code/session_01F9nLHFUGB34377u9Mr9cVW

🤖 Generated with Claude 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/mw00/project-maya/pull/69 **Author:** [@mw00](https://github.com/mw00) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `claude/eager-carson-bhc1g4` --- ### 📝 Commits (7) - [`53b0869`](https://github.com/mw00/project-maya/commit/53b0869ec0d3e227c8ec8ba902bff53e80f30ba9) AMD on Windows: START-MAYA.bat --backend hip, Strix Halo / Gorgon Halo included - [`ec6bf8f`](https://github.com/mw00/project-maya/commit/ec6bf8f8ddea9a92706ff36c6995aa048490f1db) Windows HIP: VS 2026, rocm-sdk init first, the SDK's HIP runtime beside strata.exe - [`10c0c7d`](https://github.com/mw00/project-maya/commit/10c0c7db832d2d21fb08c94c7a4757619a125308) Merge remote-tracking branch 'origin/main' into claude/eager-carson-bhc1g4 - [`49df00f`](https://github.com/mw00/project-maya/commit/49df00f2649c8cbb85de1a22b4e5768578dee182) Windows HIP on a real Gorgon Halo: AMD's HIP SDK, every launch submitted, the HIP checks pass - [`76cdf6a`](https://github.com/mw00/project-maya/commit/76cdf6af7199183210c5c2c2ae76c0d6fbfc519b) Merge remote-tracking branch 'origin/main' into claude/eager-carson-bhc1g4 - [`3ba9eb7`](https://github.com/mw00/project-maya/commit/3ba9eb7f6c19a3953cf357a327fdd500aa831a2c) Maya-L runs on a Gorgon Halo under Windows: the pool in pieces, submission without flushing every launch - [`e93e42d`](https://github.com/mw00/project-maya/commit/e93e42d30a6a622309c4f315dfdfe41d4c763bcb) Merge remote-tracking branch 'origin/claude/eager-carson-bhc1g4' into claude/eager-carson-bhc1g4 ### 📊 Changes **13 files changed** (+799 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `CHANGELOG.md` (+28 -0) 📝 `README.md` (+12 -7) 📝 `docs/AMD_MAYA.md` (+52 -2) 📝 `include/strata/hip_compat/cuda_runtime.h` (+3 -0) 📝 `maya.py` (+228 -45) 📝 `setup.py` (+85 -9) 📝 `src/core/glm_fast_path.cu` (+70 -3) 📝 `src/core/glm_fast_state.hpp` (+3 -1) 📝 `tests/hip/glm_handoff.cpp` (+5 -2) 📝 `tests/hip/handoff.cpp` (+4 -2) 📝 `tests/hip/prefill_mmq_parity.cpp` (+4 -1) 📝 `tools/test_maya_hip.py` (+304 -0) </details> ### 📄 Description ## Summary Native Windows support for Maya's experimental AMD HIP backend: `START-MAYA.bat --backend hip` now sets Maya up on Windows 10/11 as `./maya.sh --backend hip` does on Linux, for Strix Halo / Gorgon Halo (Ryzen AI Max 300 / 400, Radeon 8050S / 8060S / 8065S, `gfx1151`) and the discrete cards (RX 7900 XT / XTX, RX 9070 / R9700). Before, `check_hip_pc` refused Windows and only the manual `tools\hip\build_maya_windows.bat` (#54) existed. ## Key Changes - **GPU detection (setup.py):** `parse_hipinfo()` reads ROCm's hipInfo (HIP's own order and `gcnArchName`); without it, `parse_display_adapters()` reads Windows' AMD display adapters from the registry (PCI device ID, then name). hipInfo that sees no GPU warns before the compile and the download. - **ROCm (maya.py):** `ROCM_PATH`, else TheRock's `rocm-sdk` (`ROCM_VENV`, Maya's `.venv`, PATH; `rocm-sdk init` runs, shown and with no time limit, before any `rocm-sdk path`), else AMD's HIP SDK (`HIP_PATH`, else the newest in `C:\Program Files\AMD\ROCm`). With none, the setup offers `rocm[libraries,devel,device-<arch>]==7.14.1` from `repo.amd.com/rocm/whl-multi-arch` into `.venv`, and does the same when a chosen GPU's `rocm-sdk-device-<arch>` is missing; `--check` prints the command instead. - **Build:** `compile_engine_hip()` on Windows follows `build_maya_windows.bat`: ROCm's clang for C/C++/HIP, Ninja, vcvars64, forward-slash paths, `STRATA_PORTABLE=ON`, `HIP_DEVICE_LIB_PATH`. Visual Studio Build Tools 2022 or 2026 (`find_vcvars(cuda=False)`; the [16, 18) cap stays CUDA-only), checked before the ROCm download. The SDK's `amdhip64*.dll`, `amd_comgr*.dll` and `rocm_kpack*.dll` are copied next to `build-hip\strata.exe`, because Windows loads System32's (the driver's HIP runtime) before PATH. - **Engine on a Windows APU:** - `F->unified_memory` is not set on Windows. Windows gives the APU's GPU a fixed carve-out (Variable Graphics Memory) that it does not count as RAM, so the APU is sized like a discrete card: the pool from `cudaMemGetInfo` free, the RAM tier from min(free RAM, free commit). Linux is unchanged. - Windows' HIP runtime allocates at most 64 GiB plus the RAM Windows sees in one piece, so a larger pool goes into several allocations, each holding whole layers. This only happens when one allocation fails. - Windows' HIP runtime holds queued launches until the host waits. The service thread therefore submits them with `cudaStreamQuery` after 1 ms without a route, under `_WIN32 && STRATA_USE_HIP` only. - **Config for a Windows APU:** `STRATA_GLM_RESERVE_MB=3072` (the desktop runs on that GPU), and the prompt budget is picked by RAM + GPU memory. - `--report` on Windows lists hipInfo's GPUs. Docs (README, docs/AMD_MAYA.md#windows, CHANGELOG) and installer tests in tools/test_maya_hip.py. Two HIP test fixes in `tests/hip/` (`glm_handoff`'s `skip_from` argument; `prefill_mmq_parity`'s sentinel memset on the null stream). ## Status Run on a Ryzen AI Max+ PRO 495 / Radeon 8065S (Gorgon Halo, 192 GB, 160 GB of it the GPU's), Windows 11, HIP SDK 7.2: - Setup downloads, builds and packs Maya-L, and every expert stays in the GPU pool (134.3 GB). - `--bench` decodes 15.9 tokens/s and reads 345 tokens/s of an 8K-token prompt. - Answers, a 4.7K-token prompt and thinking mode come out right. - All 15 HIP checks of docs/AMD_MAYA.md pass. The TheRock-wheel install path (`rocm-sdk`) was not the one exercised there. https://claude.ai/code/session_01F9nLHFUGB34377u9Mr9cVW 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:24:06 +07:00
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
mw00/project-maya#313
No description provided.