[PR #628] AMD: the DFlash2 drafter on one Ryzen AI Max APU (Strix / Gorgon Halo) #633

Open
opened 2026-10-29 21:27:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/628
Author: @mrsirg97-rgb
Created: 10/28/2026
Status: 🔄 Open

Base: main ← Head: amd-dflash2-halo


📝 Commits (1)

  • bf14828 AMD: the DFlash2 drafter on one Ryzen AI Max APU (Strix / Gorgon Halo)

📊 Changes

6 files changed (+80 additions, -22 deletions)

View changed files

📝 CMakeLists.txt (+11 -4)
📝 docs/MODELS.md (+4 -3)
📝 docs/SETTINGS.md (+22 -4)
📝 docs/SETUP.md (+2 -2)
📝 maya.py (+15 -9)
📝 tools/test_maya_models.py (+26 -0)

📄 Description

The DFlash2 drafter on one AMD Ryzen AI Max APU (Strix / Gorgon Halo, gfx1151).

The engine already compiled glm_dflash.cu for HIP. Two things kept AMD off it: the setup (choose_draft returned MTP for every HIP setup), and glm_dflash_test being built for CUDA alone.

Changes

  • CMakeLists.txt: glm_dflash_test also builds on HIP, linking strata_prefill after strata_engine the way the engines do (#355). NVIDIA's test targets are unchanged.
  • maya.py choose_draft:
    • One Ryzen AI Max APU (hip_unified_memory) gets the drafting question, as NVIDIA sm_80+ does. MTP stays the default, and the speed calibration keeps DFlash2 only where it is faster.
    • On that APU, the MTP option's text now says it drafts on the one GPU (MAYA_GLM_MTP_DECODE), not "one GPU decodes without drafting".
    • Other AMD GPUs, and an APU beside a discrete card, keep MTP without asking; I couldn't measure them.
    • --draft help text updated.
  • tools/test_maya_models.py:
    • Discrete AMD and APU + discrete setups keep MTP.
    • One APU is asked, with MTP as the default.
    • The MTP text matches the platform.
    • The new tests fail on main and pass here.
  • Docs (MODELS.md, SETUP.md, SETTINGS.md): DFlash2 on one Ryzen AI Max APU, plus the measurements below.

Measured on: Radeon 8060S (Ryzen AI MAX+ 395, 128 GB, 108 GB of it GTT, ROCm 7.15, Linux 7.2), running unsloth's GLM-5.3-Flash UD-IQ2_XXS with every expert in the GPU pool, 512K context, v1.1.35.

./maya.sh --bench, greedy, three runs each with the drafters alternating:

code explanation HTML mean
MTP block (one-GPU MAYA_GLM_MTP_DECODE) 27.6 25.3 29.3 27.4 (26.8 / 27.7 / 27.7)
DFlash2 30.5 26.5 32.5 29.8 (+9%) (29.8 ×3)
  • Prefill: unchanged, 153–162 tok/s at 2K / 8K with either drafter.
  • Speed calibration (sampled, after 8K tokens): MTP 21.9 tok/s, DFlash2 23.0 tok/s (+5%). Drafts accepted: 87% for MTP, 91% for DFlash2. The calibration kept DFlash2, but +5% is right at its 5% bar, so on this PC it could keep either from run to run.
  • glm_dflash_test: PASS. 0 of 7 picks differ, hidden cosine ≥ 0.9947, one draft takes 35.7 ms.
  • Same tokens:
    • With MAYA_GLM_NO_PREFILL=1, decoding with and without DFlash2 ("strata_tune": {"spec": 1}) gives the same text on three 384-token prompts, twice each.
    • With the prompt path on, two reads of one prompt can already diverge on this APU, with or without a drafter, because the prompt path borrows the pool's slots. Compare with it off.
  • Checks:
    • tools/check_hip_compat.py passes.
    • unittest discover -s tools passes except test_setup_qwen.Dashboard.test_the_web_apps_names, which fails the same way on main here: navigator isn't defined in Node 20.
  • Not measured:
    • NVIDIA: its path is unchanged.
    • gfx1100 / gfx1201, Windows, and APUs other than the 8060S.
    • Sampled decode beyond the calibration.

🔄 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/628 **Author:** [@mrsirg97-rgb](https://github.com/mrsirg97-rgb) **Created:** 10/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `amd-dflash2-halo` --- ### 📝 Commits (1) - [`bf14828`](https://github.com/mw00/project-maya/commit/bf1482801d0ef2cb64bc06fe7a88eb8026e68db1) AMD: the DFlash2 drafter on one Ryzen AI Max APU (Strix / Gorgon Halo) ### 📊 Changes **6 files changed** (+80 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+11 -4) 📝 `docs/MODELS.md` (+4 -3) 📝 `docs/SETTINGS.md` (+22 -4) 📝 `docs/SETUP.md` (+2 -2) 📝 `maya.py` (+15 -9) 📝 `tools/test_maya_models.py` (+26 -0) </details> ### 📄 Description The DFlash2 drafter on one AMD Ryzen AI Max APU (Strix / Gorgon Halo, gfx1151). The engine already compiled `glm_dflash.cu` for HIP. Two things kept AMD off it: the setup (`choose_draft` returned MTP for every HIP setup), and `glm_dflash_test` being built for CUDA alone. **Changes** - `CMakeLists.txt`: `glm_dflash_test` also builds on HIP, linking `strata_prefill` after `strata_engine` the way the engines do (#355). NVIDIA's test targets are unchanged. - `maya.py` `choose_draft`: - One Ryzen AI Max APU (`hip_unified_memory`) gets the drafting question, as NVIDIA sm_80+ does. MTP stays the default, and the speed calibration keeps DFlash2 only where it is faster. - On that APU, the MTP option's text now says it drafts on the one GPU (`MAYA_GLM_MTP_DECODE`), not "one GPU decodes without drafting". - Other AMD GPUs, and an APU beside a discrete card, keep MTP without asking; I couldn't measure them. - `--draft` help text updated. - `tools/test_maya_models.py`: - Discrete AMD and APU + discrete setups keep MTP. - One APU is asked, with MTP as the default. - The MTP text matches the platform. - The new tests fail on `main` and pass here. - Docs (`MODELS.md`, `SETUP.md`, `SETTINGS.md`): DFlash2 on one Ryzen AI Max APU, plus the measurements below. **Measured on:** Radeon 8060S (Ryzen AI MAX+ 395, 128 GB, 108 GB of it GTT, ROCm 7.15, Linux 7.2), running unsloth's GLM-5.3-Flash UD-IQ2_XXS with every expert in the GPU pool, 512K context, v1.1.35. `./maya.sh --bench`, greedy, three runs each with the drafters alternating: | | code | explanation | HTML | mean | | --- | --- | --- | --- | --- | | MTP block (one-GPU `MAYA_GLM_MTP_DECODE`) | 27.6 | 25.3 | 29.3 | 27.4 (26.8 / 27.7 / 27.7) | | DFlash2 | 30.5 | 26.5 | 32.5 | **29.8 (+9%)** (29.8 ×3) | - **Prefill:** unchanged, 153–162 tok/s at 2K / 8K with either drafter. - **Speed calibration** (sampled, after 8K tokens): MTP 21.9 tok/s, DFlash2 23.0 tok/s (+5%). Drafts accepted: 87% for MTP, 91% for DFlash2. The calibration kept DFlash2, but +5% is right at its 5% bar, so on this PC it could keep either from run to run. - **`glm_dflash_test`:** PASS. 0 of 7 picks differ, hidden cosine ≥ 0.9947, one draft takes 35.7 ms. - **Same tokens:** - With `MAYA_GLM_NO_PREFILL=1`, decoding with and without DFlash2 (`"strata_tune": {"spec": 1}`) gives the same text on three 384-token prompts, twice each. - With the prompt path on, two reads of one prompt can already diverge on this APU, with or without a drafter, because the prompt path borrows the pool's slots. Compare with it off. - **Checks:** - `tools/check_hip_compat.py` passes. - `unittest discover -s tools` passes except `test_setup_qwen.Dashboard.test_the_web_apps_names`, which fails the same way on `main` here: `navigator` isn't defined in Node 20. - **Not measured:** - NVIDIA: its path is unchanged. - gfx1100 / gfx1201, Windows, and APUs other than the 8060S. - Sampled decode beyond the calibration. --- <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
mw00/project-maya#633
No description provided.