[PR #455] [CLOSED] GLM experts: IQ2_S gate/up on the tuned RDNA kernel (opt-in, MAYA_GLM_GU22_TUNED=1), and a record of which kernels ran #535

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

📋 Pull Request Information

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

Base: main ← Head: pr/glm-gu22-tuned-v1126


📝 Commits (3)

  • 92565a9 GLM experts: IQ2_S gate/up on the tuned RDNA kernel, opt-in (MAYA_GLM_GU22_TUNED=1)
  • ccbaadf GLM experts: the engine logs which kernel IQ2_S gate/up ran, once per GPU and call path (Codex's review)
  • 08b006c GLM experts: the engine logs which dense GEMV kernels each GPU's decode runs, once per GPU

📊 Changes

2 files changed (+51 additions, -7 deletions)

View changed files

📝 docs/SETTINGS.md (+2 -1)
📝 src/kernels/cuda/glm_fast.cu (+49 -6)

📄 Description

What. Maya-M's routed experts are IQ2_S. Their gate/up runs on the original kernel while IQ2_XXS already has a
tuned RDNA one (packed sign expansion, the grid in LDS). MAYA_GLM_GU22_TUNED=1 (gfx1100 / gfx1151, 4096 x 2048
experts) sends IQ2_S gate/up to that kernel too, on the token path and the window's multi-token launch, for the GPUs'
own experts and an expert helper's alike. Off by default.

The engine now logs once per GPU and call path which gate/up kernel ran (glm experts: CUDA<n> IQ2_S gate/up on the tuned RDNA kernel (token path)), and once per GPU which dense GEMV kernels its decode runs (glm mv: CUDA<n> dense GEMVs on the RDNA3 kernel / original kernels), so a setting that did not take is visible in the log.

Changes. src/kernels/cuda/glm_fast.cu, docs/SETTINGS.md.

Verified (Maya-M, RX 7900 XTX gfx1100 + Radeon 8060S gfx1151):

  • The expert bench (hip_expert_kernel_bench --sweep --exact --fixture 22,18): bit-identical to the original kernel
    on both devices; 1.34-1.43x faster on the RX 7900 XTX (device memory) and 1.12x on the 8060S reading pinned host
    memory, at 4-8 experts a call.
  • Decode logits: tuned against original, five pairs (single token, the split, the T = 2 window), byte-identical.
  • End to end the gain is small on its own: two loads an arm at the 114K prompt, 49.8 vs 49.2 tok/s (+1.1 %, within
    what we call noise); in our configuration it is one of several settings that together reach 55.8 tok/s.

Test setup. As in the helper PR. On v1.1.26 we built this PR together with A, C and D (pr/glm-union-v1126
30f93cf): every load's log carried the tuned IQ2_S gate/up kernel lines, and the gate and the public points passed as
in PR A. The tuned-against-original logits pairs above were not repeated on v1.1.26.

🤖 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/455 **Author:** [@pepuscz](https://github.com/pepuscz) **Created:** 10/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/glm-gu22-tuned-v1126` --- ### 📝 Commits (3) - [`92565a9`](https://github.com/mw00/project-maya/commit/92565a9b0854c4cfda39cd1d354197fe7ff2704c) GLM experts: IQ2_S gate/up on the tuned RDNA kernel, opt-in (MAYA_GLM_GU22_TUNED=1) - [`ccbaadf`](https://github.com/mw00/project-maya/commit/ccbaadf5bbf4ddcc8be4c171d50ff475b795e2ff) GLM experts: the engine logs which kernel IQ2_S gate/up ran, once per GPU and call path (Codex's review) - [`08b006c`](https://github.com/mw00/project-maya/commit/08b006c1c2f7f2dbea0317c750228ac1be77fedb) GLM experts: the engine logs which dense GEMV kernels each GPU's decode runs, once per GPU ### 📊 Changes **2 files changed** (+51 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/SETTINGS.md` (+2 -1) 📝 `src/kernels/cuda/glm_fast.cu` (+49 -6) </details> ### 📄 Description **What.** Maya-M's routed experts are IQ2_S. Their gate/up runs on the original kernel while IQ2_XXS already has a tuned RDNA one (packed sign expansion, the grid in LDS). `MAYA_GLM_GU22_TUNED=1` (gfx1100 / gfx1151, 4096 x 2048 experts) sends IQ2_S gate/up to that kernel too, on the token path and the window's multi-token launch, for the GPUs' own experts and an expert helper's alike. Off by default. The engine now logs once per GPU and call path which gate/up kernel ran (`glm experts: CUDA<n> IQ2_S gate/up on the tuned RDNA kernel (token path)`), and once per GPU which dense GEMV kernels its decode runs (`glm mv: CUDA<n> dense GEMVs on the RDNA3 kernel / original kernels`), so a setting that did not take is visible in the log. **Changes.** `src/kernels/cuda/glm_fast.cu`, `docs/SETTINGS.md`. **Verified** (Maya-M, RX 7900 XTX gfx1100 + Radeon 8060S gfx1151): - The expert bench (`hip_expert_kernel_bench --sweep --exact --fixture 22,18`): bit-identical to the original kernel on both devices; 1.34-1.43x faster on the RX 7900 XTX (device memory) and 1.12x on the 8060S reading pinned host memory, at 4-8 experts a call. - Decode logits: tuned against original, five pairs (single token, the split, the T = 2 window), byte-identical. - End to end the gain is small on its own: two loads an arm at the 114K prompt, 49.8 vs 49.2 tok/s (+1.1 %, within what we call noise); in our configuration it is one of several settings that together reach 55.8 tok/s. **Test setup.** As in the helper PR. On v1.1.26 we built this PR together with A, C and D (`pr/glm-union-v1126` 30f93cf): every load's log carried the tuned IQ2_S gate/up kernel lines, and the gate and the public points passed as in PR A. The tuned-against-original logits pairs above were not repeated on v1.1.26. 🤖 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:26:32 +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#535
No description provided.