mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #46] [CLOSED] GLM fast path: STRATA_GLM_LAT8=1 keeps the DSA latent cache in INT8 (opt-in) #300
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#300
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/46
Author: @sociolog
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:pr2-lat8📝 Commits (5)
67da11dGLM fast path: the indexer key/gate rows in a ring (8196 positions) instead of max_ctx rows1d59720score mode: STRATA_GLM_SCORE_PREFILL=1 reads the unscored context through the prompt path97e24baREADME: the Tuning table's row for this change's setting7456d00GLM fast path: STRATA_GLM_LAT8=1 keeps the DSA latent cache in INT85b6e714README: the Tuning table's row for STRATA_GLM_LAT8📊 Changes
10 files changed (+314 additions, -109 deletions)
View changed files
📝
README.md(+2 -0)📝
include/strata/core/glm_model.hpp(+12 -0)📝
include/strata/kernels/glm_batch.hpp(+5 -3)📝
include/strata/kernels/glm_fast.hpp(+3 -1)📝
src/core/glm_fast_path.cu(+94 -30)📝
src/core/glm_model.cu(+32 -5)📝
src/core/glm_prefill.cu(+42 -24)📝
src/kernels/cuda/glm_batch.cu(+64 -25)📝
src/kernels/cuda/glm_fast.cu(+44 -20)📝
src/program/generate.cpp(+16 -1)📄 Description
Stacked on #45 (the indexer ring): this branch contains PR1's 3 commits plus 2 of its own - the
last 2 commits are this PR. Opt-in; default unchanged.
What
With
STRATA_GLM_LAT8=1a latent row becomeskv_loraint8 codes followed by one FP16 scale per 32 values(
kv_lora * 17 / 16bytes: 544 at kv_lora 512 instead of FP16's 1024). Scale = absmax / 127 of the 32 values,rounded to FP16 before the codes are taken from it.
dsa_prepkernels (decode and prompt), one scale a warp (kv_lora % 32 == 0checked at load).mla_kernel/mla_attn_kernel/mla_split_kernelthroughlat_ld(); the prompt's F32 / tensor-core / register /mma.sync kernels through
lat_ld4()/lat_ld8()(the 4- and 8-value loads they already do).mla_attnthere (notbuilt or run on HIP here; NVIDIA path unchanged when the setting is off).
Why
131072 context, RTX 3090 + 3060 split, with PR1: state/KV 1.13 -> 0.72 GB (3090) and 0.79 -> 0.50 GB (3060), expert
slots 80 -> 82 and 48 -> 50 a layer.
--bench(RAM_RESIDENT=1, CPU plan pinned, two runs each): 19.2 / 19.2 ->19.5 / 19.5 tok/s. Prefill unchanged (313 / 587).
Quality (score mode, pool and CPU plan pinned, so only the cache differs)
For scale: the CPU-lane vs GPU arithmetic of the same expert moves KL by ~0.02 whenever the tiers differ. A
16-value-group variant measured only marginally better (KL 0.0249), so the 32-value layout stays.
Checks run on this branch (run on v1.0.16; the branch is rebased onto v1.0.20 - upstream's engine changes since are one INFO line and one comment; the server tests re-run on v1.0.20: 124 OK): builds (sm_75, sm_86);
glm_dsa_parity,glm_ffn_parity,glm_hc_parity,glm_kda_parity,glm_layer_parity--selftest: all PASS;python -m unittest serve.test_server serve.test_tools serve.test_mcp serve.test_detok: 102 tests OK (3 skipped); the--benchrequest sequence (3 answers, 2K and 8K prompts) on the real model: runs clean.The code, the measurements and this description were produced with the help of Claude, an AI assistant by Anthropic.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.