[PR #17] [MERGED] Strix Halo (gfx1151): unified-memory expert sizing and installer support #282

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

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/17
Author: @boxwrench
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @mw00

Base: main ← Head: amd/strix-unified-memory


📝 Commits (4)

  • c12c69d Support Strix Halo with OS-based unified-memory expert sizing
  • cfd2250 Build and register glm_memory_test; keep its asserts in Release
  • 628cc8b HIP setup: find a versioned ROCm install (/opt/rocm-X.Y.Z) when /opt/rocm is absent
  • 9b45693 Test that --gpus with an APU (unified memory) is rejected

📊 Changes

11 files changed (+268 additions, -25 deletions)

View changed files

📝 CMakeLists.txt (+3 -0)
📝 README.md (+4 -4)
📝 docs/AMD_MAYA.md (+36 -7)
📝 include/strata/hip_compat/cuda_runtime.h (+1 -0)
📝 maya.py (+33 -8)
📝 src/core/glm_fast_path.cu (+52 -6)
📝 src/core/glm_fast_state.hpp (+2 -0)
➕ src/core/glm_memory.hpp (+29 -0)
📝 src/core/glm_prefill.cu (+3 -0)
➕ tests/glm_memory_test.cpp (+43 -0)
📝 tools/test_maya_hip.py (+62 -0)

📄 Description

Strix Halo (Ryzen AI Max+ 395, Radeon 8060S, gfx1151) out of the box: the unified-memory follow-up from #6. Until now gfx1151 compiled but setup refused it, and a working config needed hand-set pool and RAM sizes.

What changes

  • Engine, integrated HIP GPUs only (cudaDevAttrIntegrated, HIP builds): the runtime's "VRAM" on an APU is the GTT/carve-out size, not free memory, and pinned host RAM comes out of the same physical memory as the GPU pool. So the expert pool is sized from /proc/meminfo MemAvailable after the dense weights, KV and scratch are allocated: min(expert bytes, MemAvailable - headroom (16 GB, STRATA_GLM_RAM_HEADROOM_GB) - reserve). When every expert fits, each layer gets exactly one slot per expert and the pinned RAM tier is kept to its staging floor; the prompt's disk landing ring is kept small. Explicit STRATA_GLM_POOL_GB / STRATA_GLM_RAM_GB still win. Discrete GPUs and CUDA take the original code path (src/core/glm_memory.hpp holds the policy; glm_memory_test checks it on the host).
  • Installer: gfx1151 is accepted; for an APU it writes a 1 GB reserve, sub-batch 1024, a 6 GB prompt budget with >= 96 GB RAM, and the gfx1151 hipBLASLt table, and leaves pool/RAM sizing to the engine. It also finds a versioned ROCm install (/opt/rocm-7.2.2) when there is no /opt/rocm link.
  • Docs: a Strix Halo section in docs/AMD_MAYA.md; README mentions it.

Checked on a 128 GB Strix Halo (ROCm 7.2.2, Maya-S, 8K context)

  • Startup: unified memory: MemAvailable 109.69 GB, headroom 16.00 GB + 1024 MB reserve, experts need 80.17 GB, pool budget 80.17 GB; expert pool 80.17 GB, 288-288 slots/layer (12096 total); RAM tier is staging only (0.22 GB pinned, was 1.39 GB with hand-set sizes); warm-up 12,096 experts in 17 s.
  • Three ~3.4K-token prompts with ~400-token answers: 213-217 tok/s prompts, 16.4-16.6 tok/s answers, 99.9% pool hits, no errors - the same as the previous hand-tuned config (~212 / ~16.8).
  • With STRATA_GLM_POOL_GB=32 STRATA_GLM_RAM_GB=4 the caps are honoured (31.7 GB pool, 4 GB RAM tier).
  • tools/test_maya_hip.py (9 tests), tools/test_hip_archs.py, glm_memory_test, and a gfx1100/gfx1201/gfx1151 build pass. maya.py --backend hip --check on the Strix box finds the APU and ROCm.

Not tested: CUDA (no toolchain here; the new code is HIP-only); discrete AMD cards run the unchanged path.


🔄 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/17 **Author:** [@boxwrench](https://github.com/boxwrench) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `amd/strix-unified-memory` --- ### 📝 Commits (4) - [`c12c69d`](https://github.com/mw00/project-maya/commit/c12c69de764c834057831c091092e28039d9cf70) Support Strix Halo with OS-based unified-memory expert sizing - [`cfd2250`](https://github.com/mw00/project-maya/commit/cfd2250b8c086d2bac6d42403d3644a12c937f1d) Build and register glm_memory_test; keep its asserts in Release - [`628cc8b`](https://github.com/mw00/project-maya/commit/628cc8bd1c997e1bfed845c2660ebda8a802cb3b) HIP setup: find a versioned ROCm install (/opt/rocm-X.Y.Z) when /opt/rocm is absent - [`9b45693`](https://github.com/mw00/project-maya/commit/9b45693b92cd329e3ef52bb4df85aa1b2bfb22b1) Test that --gpus with an APU (unified memory) is rejected ### 📊 Changes **11 files changed** (+268 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+3 -0) 📝 `README.md` (+4 -4) 📝 `docs/AMD_MAYA.md` (+36 -7) 📝 `include/strata/hip_compat/cuda_runtime.h` (+1 -0) 📝 `maya.py` (+33 -8) 📝 `src/core/glm_fast_path.cu` (+52 -6) 📝 `src/core/glm_fast_state.hpp` (+2 -0) ➕ `src/core/glm_memory.hpp` (+29 -0) 📝 `src/core/glm_prefill.cu` (+3 -0) ➕ `tests/glm_memory_test.cpp` (+43 -0) 📝 `tools/test_maya_hip.py` (+62 -0) </details> ### 📄 Description Strix Halo (Ryzen AI Max+ 395, Radeon 8060S, gfx1151) out of the box: the unified-memory follow-up from #6. Until now gfx1151 compiled but setup refused it, and a working config needed hand-set pool and RAM sizes. ### What changes - **Engine, integrated HIP GPUs only** (`cudaDevAttrIntegrated`, HIP builds): the runtime's "VRAM" on an APU is the GTT/carve-out size, not free memory, and pinned host RAM comes out of the same physical memory as the GPU pool. So the expert pool is sized from `/proc/meminfo` MemAvailable after the dense weights, KV and scratch are allocated: `min(expert bytes, MemAvailable - headroom (16 GB, STRATA_GLM_RAM_HEADROOM_GB) - reserve)`. When every expert fits, each layer gets exactly one slot per expert and the pinned RAM tier is kept to its staging floor; the prompt's disk landing ring is kept small. Explicit `STRATA_GLM_POOL_GB` / `STRATA_GLM_RAM_GB` still win. Discrete GPUs and CUDA take the original code path (`src/core/glm_memory.hpp` holds the policy; `glm_memory_test` checks it on the host). - **Installer:** gfx1151 is accepted; for an APU it writes a 1 GB reserve, sub-batch 1024, a 6 GB prompt budget with >= 96 GB RAM, and the gfx1151 hipBLASLt table, and leaves pool/RAM sizing to the engine. It also finds a versioned ROCm install (`/opt/rocm-7.2.2`) when there is no `/opt/rocm` link. - **Docs:** a Strix Halo section in `docs/AMD_MAYA.md`; README mentions it. ### Checked on a 128 GB Strix Halo (ROCm 7.2.2, Maya-S, 8K context) - Startup: `unified memory: MemAvailable 109.69 GB, headroom 16.00 GB + 1024 MB reserve, experts need 80.17 GB, pool budget 80.17 GB`; `expert pool 80.17 GB, 288-288 slots/layer (12096 total)`; `RAM tier is staging only` (0.22 GB pinned, was 1.39 GB with hand-set sizes); warm-up 12,096 experts in 17 s. - Three ~3.4K-token prompts with ~400-token answers: 213-217 tok/s prompts, 16.4-16.6 tok/s answers, 99.9% pool hits, no errors - the same as the previous hand-tuned config (~212 / ~16.8). - With `STRATA_GLM_POOL_GB=32 STRATA_GLM_RAM_GB=4` the caps are honoured (31.7 GB pool, 4 GB RAM tier). - `tools/test_maya_hip.py` (9 tests), `tools/test_hip_archs.py`, `glm_memory_test`, and a gfx1100/gfx1201/gfx1151 build pass. `maya.py --backend hip --check` on the Strix box finds the APU and ROCm. **Not tested:** CUDA (no toolchain here; the new code is HIP-only); discrete AMD cards run the unchanged path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:23:45 +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#282
No description provided.