mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#559
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/486
Author: @merbanan
Created: 10/25/2026
Status: 🔄 Open
Base:
main← Head:pr/route-fast📝 Commits (2)
aecbbc9GLM decode route: the top k by rank, every thread at once - a micro-optimization (MAYA_GLM_ROUTE_RANK, on by default; =0: topk_warp)8340e0eGLM decode route: the route kernel's reads and writes reordered - a micro-optimization (MAYA_GLM_ROUTE_FAST, on by default; MAYA_GLM_ROUTE_PROF measures it)📊 Changes
5 files changed (+262 additions, -26 deletions)
View changed files
📝
docs/SETTINGS.md(+3 -0)📝
include/strata/kernels/glm_fast.hpp(+2 -0)📝
src/core/glm_fast_path.cu(+5 -0)📝
src/core/glm_model.cu(+1 -0)📝
src/kernels/cuda/glm_fast.cu(+251 -26)📄 Description
Stacked on #451. The first commit is #451's; this PR is the second one.
A micro-optimization of the decode's route kernel, like #451. It changes the order the kernel reads and writes in, without changing what it computes:
x) goes out at the kernel's start, not after the plan.to_cpu. That is the same set thread 0's greedy loop picked.The same plan and request.
MAYA_GLM_ROUTE_FASTis on by default;=0gives the old order (A/B). It applies with at most 8 experts per token.MAYA_GLM_ROUTE_PROF=1(measurement, off by default) prints the kernel's phases and thread 0's plan phases in cycles at exit. It's how the numbers below were measured.Both settings have rows in
docs/SETTINGS.md.tools/check_hip_compat.pypasses.Exactness
The deterministic run has the CPU lane off and a fixed RAM tier. With
MAYA_GLM_ROUTE_FASTon and off, the tokens are identical at 2K and 8K: 1a056479 / d765e0a5.Speed
Measured on a Tesla V100-PCIE-32GB at 250 W with a Ryzen 9 7950X and turboderp's EXL3 2.05bpw.
The route kernel (
MAYA_GLM_ROUTE_PROF, default settings, 2K prompt + 256 tokens, cycles per route at ~1.38 GHz):=0Decode, deterministic (CPU lane off,
MAYA_GLM_RAM_GB=50, 512 tokens, alternating rounds, ms per token):=03 rounds on upstream main v1.1.27 + #451; every round with the change was faster at 8K and 27K.
That is small, as #451's was. The route is serial work at every MoE layer of every token, and the CPU lane's request reaches the host sooner, so the gain is larger with the lane on. In the served configuration it measured about +1-3 % over 3 rounds, inside that setting's ±2 % run-to-run spread.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.