mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #127] DFlash2 on v1.1.0 with Maya-M on a RAM-bound desktop (RTX 3090 + RTX 3060): ten setups, one and two cards #41
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#41
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?
Originally created by @sociolog on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/127
Short version: on this machine the MTP block stays the better drafter. DFlash2 is correct (drafts are accepted 64-93% of
the time) but its verify window costs more than it saves: 2 cards 11.95-14.27 tok/s against 23.97 for the MTP block, and
1 card 14.57-14.74 against 19.01 for plain decode. Switching the window's RAM-tier experts from "all on the CPU" to the
calibrated CPU / PCIe plan (
STRATA_GLM_WIN_ALLCPU=0) recovers about 19% on two cards, but not the gap. Posting this asdata for the 1-2 GPU tuning you mentioned; happy to measure anything you want varied.
The machine and the model
STRATA_GLM_SPLIT=28,RAM_RESIDENT=1(RAM tier 47.8 + 38.6 GB pinned, ~86 GiB),KV_INT8=1,CPU_PLAN=012234567,MTP_KEEP=2, prefetch N=1 at fetch / 4 blocks / rank 2,PREFILL_MB=3072,TRUNK_KEEP_MAP=8888888888888888888888855555554444444444444448(#103: keep 8 on layers 0-22, 5 on 23-29, 4 on 30-44, 8 on the last)GLM-5.3-Flash-DFlash2-Q4_K_M.gguf, sha256 checked (f4158ffb...), passed as--dflashin the config's argsMethod
One fresh start per row; then two warm API runs through the real server: a fresh 21K-token prompt (prefill), then 2,500
tokens decoded at 21K depth. Sampling is the installed one (T 1.0, top_p 0.95; so acceptance is of sampled tokens). Same
engine build, same config copy; only the drafting and the cards differ between rows. The SSD is never read (storage reads
are 0.00-0.17 GB in the first run, 0.00-0.03 GB after). Noise between two runs of one setup is about +-0.3 tok/s.
Results
Two cards (3090 + 3060, split 28/17)
--spec 2STRATA_GLM_WIN_ALLCPU=0--spec 2,STRATA_GLM_WIN_ALLCPU=0One card (the 3090 alone,
STRATA_GLM_SPLIT=0; no MTP block on one GPU, so the baseline is plain decode)--spec 2STRATA_GLM_WIN_ALLCPU=0For reference, a third card (the RTX 4000, 4 layers, MTP block,
RAM_HEADROOM_GB=16, auto split 0-29 / 30-40 / 41-44):24.32 tok/s in the first run (the second run's decode line was not parsed by our harness; the engine's own per-token
counter reads about 24.3), prefill 692 and 646 tok/s, 71.6% of 6,157 positions accepted. Not DFlash2, just context for what
more VRAM buys on this box (+1.4% decode, about -12% prefill).
What the logs show
below plain decode. On two cards the accepted share is about that of the MTP block, and decode is half.
glm dflash: a batched window's layer on both parts' CPU poolsandthe documented default (every RAM-tier expert of a window to the CPU) fit the numbers: about 86 GiB of the experts are
RAM-resident here, a window of N tokens touches close to N different experts per layer, and the lane reads them from
DDR4. The MTP block's one-draft check re-reads far fewer. The calibrated plan (
WIN_ALLCPU=0) lifts two cards from11.95 to 14.16 (+19%), which supports this reading; it does not close the gap to 23.97.
--spec 2(the token and one draft) is within noise of the default window in allthree pairs; the two-card default already checks few drafts.
2-card DFlash2 setups was lower (686-735 against 759 for the MTP block's second run); we did not investigate whether
that is run-to-run spread or the drafter's state. The 1-card pairs are within 2%.
Not tried (so the table is not the last word)
STRATA_GLM_WIN_CPU,_WIN_STAGGER,_WIN_LANES,--spec-min-p/STRATA_GLM_DFLASH_MIN, DFlash2 on three cards (thepipelined window, which is the case the release's +44% was measured on), and long-context or code-heavy prompts (all of
the above used one 21K document prompt, T 1.0). The first two-card number with the MTP block (23.97) is v1.1.0 on our
installed settings, so it can be reproduced by anyone with Maya-M.
Reproduce (stock v1.1.0, nothing else needed)
The variants differ from the installed Maya-M config only in these keys (
maya-maya-m.json,"args"/"gpu"/"env"):"args": append"--dflash", "/path/GLM-5.3-Flash-DFlash2-Q4_K_M.gguf"(the file./maya.sh --setup --draft dflash2downloads)"--spec", "2"in"args""STRATA_GLM_WIN_ALLCPU": "0"in"env""gpu": only the first card,"STRATA_GLM_SPLIT": "0"in"env", andSTRATA_GLM_MTP_KEEPremoved--dflashargumentsMeasuring: start the server from the config, send one fresh prompt of about 21,000 tokens (prefill rate = prompt tokens over
the time to the first token), then, at that depth, request 2,500 more tokens and read the decode rate from the response or
from the engine log's
glm stat: decode ... (N tok/s)lines; the drafts line isglm spec: N of M drafts accepted.The one thing that is ours is the small client that does this (a 21K prompt, then 2,500 tokens, two runs, over the
OpenAI-compatible streaming API); it is attached below, python3 only, no packages.
speed_21k_api.py - the 21K client (python3 only)
Run it against the running server, once per start (the first request is a warm-up and is discarded):
It needs a text file
prompt_src.txtnext to it: the corpus it repeats three times (with section markers and a nonceopening line, so no prompt cache can help) to make the ~21K-token prompt. Ours is the
README.mdof ggml-org/llama.cpp(a copy from late August 2026, 26,000 bytes, about 7K tokens); any document of about that size works, but then the numbers
are not strictly comparable with ours.
--no-appendskips the log row it would otherwise append under~/Local-AI/Logs.Prepared with the help of Claude, an AI assistant by Anthropic.
bench-dflash2-2026-10-12.zip
@mw00 commented on GitHub (Oct 12, 2026):
Thank you - ten setups on one and two cards is exactly the data we needed. It matches what we measured on Tesla V100s:
where most experts come from RAM, the verify window's extra routes cost more than the drafts save, and the MTP block
stays faster. v1.1.1 says so in the setup's drafting question and in the docs ("measure yours with
--bench"); the MTPblock stays the default.
@mw00 commented on GitHub (Oct 12, 2026):
Following up on this in v1.1.3: DFlash2 is now checked on each PC. When the setup drafts with it - and once, at the first start after the update, for a config that already does - a speed calibration loads the model twice (without and with
--dflash), reads a long document, writes about 1,500 sampled tokens of answers after a warm-up on each, and keeps DFlash2 only when its sustained decode is more than 5% faster than the MTP block's (one GPU: than no drafting). On a PC like yours it would keep the MTP block by itself../maya.sh --speed-calibrationmeasures again;--draft dflash2 --no-speed-calibrationkeeps DFlash2 without it.Your ten setups were the data that made the case for it - thank you.
@mw00 commented on GitHub (Oct 12, 2026):
Closing, as v1.1.3's speed calibration (above) takes care of this on every PC.
@q8atnight commented on GitHub (Oct 14, 2026):
One more box for this thread's conclusion, from Maya's own speed calibration (v1.1.6,
maya.speed_calibration(), copy config, 1,536 written tokens per drafter, the DFlash2 drafter fetched at the sha pinned inmaya.py):Maya kept mtp ("not faster on this PC"). Rig: 2x RTX 3090 24 GB NVLink (PCIe 4.0 x8 per card), Ryzen 9 3950X, 121 GB RAM, Maya-M with experts RAM-resident, 262K context, int8 KV, split 23. Same result as the issue: DFlash2 is correct but its verify window costs more than it saves on a RAM-resident desktop.