[PR #117] [CLOSED] glm: read the absorbed MLA weights once per verify window (on #96) #349

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

📋 Pull Request Information

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

Base: gorgon-halo-maya-s ← Head: perf/pr96-mla-rows


📝 Commits (1)

  • 0fe19d6 glm: read the absorbed MLA weights once per verify window

📊 Changes

6 files changed (+245 additions, -7 deletions)

View changed files

📝 CMakeLists.txt (+7 -0)
📝 include/strata/kernels/glm_fast.hpp (+9 -0)
📝 src/core/glm_fast_state.hpp (+1 -1)
📝 src/core/glm_mtp.cu (+16 -3)
📝 src/kernels/cuda/glm_fast.cu (+103 -3)
➕ src/kernels/glm_mla_rows_test.cpp (+109 -0)

📄 Description

Follow-up to #96. Based on its branch (gorgon-halo-maya-s at 3486f6d), so the diff is only this change.

The verify window now reads attn_k_b and attn_v_b once for all of its rows. Each row keeps the one-token dot expression and reduction order. Selection and attention still run per row.

On Strix Halo (gfx1151), the prototype of this change (d119b72) took a T=2 verify round from 78.13 to 75.61 ms (−2.52 ms). Logits and hidden states were byte-identical (1.6K prompt, FIXED=1, 139 rounds). This PR contains only the MLA part of that prototype. The fused union MoE stays out.

Tests

  • New glm_mla_rows_test, registered twice (default attention and STRATA_GLM_MLA_ATTN1=1), 48 cases each. It compares the k_b/v_b projections and complete per-row mla() output byte for byte, over T=1..8, FP16/INT8 latent caches, padded strides, masked selections, zero queries and partial chunks.
  • HIP, ROCm 7.2.1, gfx1100 + gfx1201: build passes. glm_mla_rows_test, glm_mla_rows_attn1_test, glm_layer_parity and glm_model_test pass on an R9700 and a 7900 XT.
  • CUDA was not compiled here (no nvcc). The new code sits in the shared CUDA/HIP files, so it needs a build on your side.

🔄 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/117 **Author:** [@boxwrench](https://github.com/boxwrench) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `gorgon-halo-maya-s` ← **Head:** `perf/pr96-mla-rows` --- ### 📝 Commits (1) - [`0fe19d6`](https://github.com/mw00/project-maya/commit/0fe19d6c09640da2c9bf756c16e0e8b092541f5d) glm: read the absorbed MLA weights once per verify window ### 📊 Changes **6 files changed** (+245 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+7 -0) 📝 `include/strata/kernels/glm_fast.hpp` (+9 -0) 📝 `src/core/glm_fast_state.hpp` (+1 -1) 📝 `src/core/glm_mtp.cu` (+16 -3) 📝 `src/kernels/cuda/glm_fast.cu` (+103 -3) ➕ `src/kernels/glm_mla_rows_test.cpp` (+109 -0) </details> ### 📄 Description Follow-up to #96. Based on its branch (`gorgon-halo-maya-s` at 3486f6d), so the diff is only this change. The verify window now reads `attn_k_b` and `attn_v_b` once for all of its rows. Each row keeps the one-token dot expression and reduction order. Selection and attention still run per row. On Strix Halo (gfx1151), the prototype of this change (d119b72) took a T=2 verify round from 78.13 to 75.61 ms (−2.52 ms). Logits and hidden states were byte-identical (1.6K prompt, `FIXED=1`, 139 rounds). This PR contains only the MLA part of that prototype. The fused union MoE stays out. **Tests** - New `glm_mla_rows_test`, registered twice (default attention and `STRATA_GLM_MLA_ATTN1=1`), 48 cases each. It compares the k_b/v_b projections and complete per-row `mla()` output byte for byte, over T=1..8, FP16/INT8 latent caches, padded strides, masked selections, zero queries and partial chunks. - HIP, ROCm 7.2.1, gfx1100 + gfx1201: build passes. `glm_mla_rows_test`, `glm_mla_rows_attn1_test`, `glm_layer_parity` and `glm_model_test` pass on an R9700 and a 7900 XT. - CUDA was not compiled here (no nvcc). The new code sits in the shared CUDA/HIP files, so it needs a build on your side. --- <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:31 +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#349
No description provided.