mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #173] DFlash2 bf16 drafter: deterministic 'illegal memory access' at fast_boundary table update on first decode request (Q4_K_M drafter works) #65
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#65
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 @waxinz on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/173
Summary
With a DFlash2 drafter loaded, the bf16 drafter GGUF crashes the engine deterministically on the first decode request, while the Q4_K_M drafter of the same drafter family works. The fault surfaces at the between-tokens expert-table update (
glm_fast_path.cu:4032,glm table update sync), and on the next request atfast_boundary's stream sync (glm boundary compute) — the classic one-request-delayed signature of a CUDA fault that happened during the previous token's work.Repro
Hardware: 7x RTX 3090 (24 GB), driver 610.57.04, CUDA toolkit 12.0 (nvcc V12.0.140), Linux.
Model: experts-only EXL3 4bpw community quant of GLM-5.3-Flash (neko-legends/GLM-5.3-Flash-Uncensored-EXL3, repacked with the packer from PR #170), 1,048,576 max context,
--layer-split autoover 7 GPUs, expert tier cache ~23.5/24 GB per card.Boot is clean in both cases — the drafter loads, calibrates (
glm dflash: the head ... tensor cores), and the server reports healthy. The crash hits the first generation request:systemdrestarts the service, and the identical request crashes it again at the same point. The Q4_K_M drafter on the identical boot (same pack, same context, same env) serves the same request fine and has done so for hours since.Observations
glm dflash:boot line). The failing site is the expert-table update + sync inGlm5Model::fast_boundary(glm_fast_path.cu ~3995-4035:cudaMemcpyAsyncofupd_key_h/upd_val_h+gf::tab_update+cudaStreamSynchronize). Hypothesis: the drafter's 1.6 GB extra residency on that GPU shrinks (or fragments) the expert-pool/table budget, and a table or pool address computed from the smaller remaining budget goes out of range on the first real route batch. The fault may actually occur earlier (during the token's dflash verify or route kernel) and only surface at the sync — we have not run compute-sanitizer yet;STRATA_GLM_DFLASH_DUMP/PROFare available if a maintainer wants a staged trace.STRATA_GLM_NO_MTP=1was set in these runs (dflash2 as the only drafter). We have not yet isolated whether the same crash happens with MTP enabled alongside — noting it in case the interaction matters.Environment
2356cde(v1.1.7 + PR #170 commits; the crash predates our branch — same failure on v1.1.0-era code during earlier testing)STRATA_GLM_KDA_GRAPH=1,STRATA_GLM_NO_MTP=1,STRATA_GLM_SPEC_SAMPLE=1,STRATA_GLM_SPEC_CANCEL=1,STRATA_GLM_DFLASH_CTX=4096(crash also occurs without the last three; first observed on the bare KDA_GRAPH+NO_MTP boot)Why it matters (minor)
The bf16 drafter is the exact-precision variant; Q4_K_M is a fine substitute (acceptance ~48-49% on this uncensored quant is dominated by the drafter being trained on the aligned base's hidden states, per the model card, not by drafter precision). But a deterministic first-request crash is a bad first-run experience for anyone following the model card's serving instructions with the bf16 file, and it costs a boot cycle (~6-8 min) to discover.
Happy to run a compute-sanitizer pass or a
STRATA_GLM_DFLASH_DUMPtrace on request — the repro is cheap (first request after boot).Cross-reference: #39 fixed a family of IMA races (tier/lending/routes) in v1.0.15/16; this report is on v1.1.7-era code with the RAM tier at defaults (not RAM_RESIDENT), so it looks like a different path — likely drafter-footprint-dependent sizing rather than the tier races.
@mw00 commented on GitHub (Oct 16, 2026):
Thanks for the careful report, @waxinz. We cannot reproduce this setup (seven GPUs and an experts-only EXL3 repack from the unmerged #170). Could you check two things: does the bf16 drafter crash with an official pack (Maya-S or turboderp's EXL3), and does it crash with fewer GPUs (
--gpus 0,1,2)? If it does,CUDA_LAUNCH_BLOCKING=1with the engine log around the first request would point at the kernel that faults.@waxinz commented on GitHub (Oct 16, 2026):
Logs first, then the three checks. Runs on one rig: 7x RTX 3090 24 GB, driver 610.57.04, at
7045dd2(mtp-integration = v1.1.12 + the #170 commits;--dflashDFlash2 drafting itself is main-line5cd445d).Log excerpts around the first request (bf16 drafter, neko pack — the report's exact repro, uninstrumented):
Request 1 (a small 64-token generation, the first request after load) →
{"error": {"message": "glm table update sync: an illegal memory access was encountered"}}; request 2 to the same still-running (poisoned) process →{"error": {"message": "glm boundary compute: an illegal memory access was encountered"}}. The engine log has zero IMA prints in this run — the errors surface only at the wrapper's sync labels, matching the report's one-request-delayed signature exactly.With
CUDA_LAUNCH_BLOCKING=1(same boot config) the log instead shows the launch-level cascade:API surface under CLB:
glm dflash: inject: an illegal memory access was encountered. Kernel log at the same moment:1. Official pack — YES, it crashes. Installed turboderp's EXL3 3.05bpw and Maya-S24 through the setup (
--model EXL3-3.05bpw/--model Maya-S24, pack built by the setup, setup-generated config otherwise untouched), added only--dflash <bf16.gguf>(+ the report's env, except where noted), and fired the same first request:glm table update sync, thenglm boundary compute(identical to the report)glm dflash: draft: illegal memory access--gpus 0,1,2)glm table update sync; engine died on request 2 (the engine stopped unexpectedly (exit code None))glm dflash: draft: illegal memory access; engine died on request 2glm dflash: draft: illegal memory accessSo it's not the experts-only repack, not the GPU count, and not the env — the bf16 drafter file alone determines the crash. Prefill always completes; the fault fires on the first decode token(s) and the request dies before producing output.
2. Fewer GPUs — YES, it crashes (official pack). 3-way on the official EXL3 pack loads fine (RAM-tier streaming as designed) and still crashes on the first decode request. One caveat for the record: 3-way on the experts-only repack can't serve at all on a 125 GB RAM host — the pool collapses to 28% VRAM-resident experts and the load thrashed the machine into userland starvation (no OOM kill, no Xid, sshd/journald unresponsive; needed a power cycle). That's a separate infra limitation of the repack, not the drafter bug — flagging it only because we initially tried the fewer-GPU check there.
3. What CLB shows — the same first-fault kernel on both packs. Under CLB the first faulting kernel is
glm_fast mvon the neko pack (boot A) and on turboderp's EXL3 (boot C1b) — the fast-path memory-move step, before the table update. That supports the report's suspicion thatglm table update syncis just where the uninstrumented run notices the fault. Natural-run cascades start atexl3 mv(EXL3 pack) orkv_stream: reset(S24 / 3-way) — timing-dependent, sticky after the first fault.Why the exact setup was hard to reproduce on your side — and where the trigger actually lives. Two things stack up:
--dflashgets. The setup's--draft dflash2path pinsGLM-5.3-Flash-DFlash2-Q4_K_M.gguf(sha256-verified, "pinned to the revision it was measured with and verified") — exactly the file that doesn't crash. Nothing in the setup or docs points anyone at the bf16 file in the same Anbeeld repo (the DFlash2 model card routes SGLang users, not project-maya), so standard runs never pick the trigger up. Our own DFlash2 testing on EXL3 packs would have used the pinned Q4_K_M file too.Net: you should be able to reproduce on any rig you already have — official pack,
--dflashpointed atGLM-5.3-Flash-DFlash2-bf16.gguffrom the same repo the setup already downloads from, first request after boot. It reproduced 2/2 boots per config here, first request every time, on 7-way and 3-way.Footprint at boot matches the report: bf16 drafter
2295 MB on CUDA6; post-load free VRAM ~620-640 MiB/GPU on the neko pack vs ~4 GB (EXL3) and ~9 GB (S24) — so this is not simple VRAM exhaustion, and on the official packs it happens with the tiering working as designed (not the #39 tier-race family). Also consistent with the #170 review note thatKDA_GRAPH=1is a no-op on a 7-GPU split: the env doesn't matter (D3 crashed with no env at all).Full per-boot logs are saved (engine log + the wrapper's request/response pairs for every boot above); happy to attach or paste any of them. Not run yet: compute-sanitizer (the offer from the report stands;
STRATA_GLM_DFLASH_DUMPis present in this build too).@mw00 commented on GitHub (Oct 19, 2026):
Thanks for the thorough follow-up, @waxinz - the runs on the official packs and the Q4_K_M control pinned it down, and it reproduces here on one V100.
The cause: the drafter's matrix-vector products. Quantized weights (Q4_K, Q6_K, Q8_0, ...) are multiplied with an 8-bit copy of the activations, BF16 and F32 weights with the float activations - and every GEMV of the drafter passed only the 8-bit copy. In the bf16 drafter every matrix is BF16, so its first draft read from address 0 (your Xid:
faulted @ 0x0_00000000 ... VIRT_READ). The fault is sticky, so the next synchronisation reported it:glm table update sync, thenglm boundary computeon the next request. It never depended on VRAM, the pack or the number of GPUs, and the Q4_K_M drafter was never affected.The fix (next release, v1.1.17): the drafter's GEMVs now pass the float activations wherever its weights are BF16 or F32 (the quantized ones are unchanged), and the GEMV kernels refuse a job that lacks the input its weight type reads, so a mistake like this becomes an error message instead of a device fault.
Tested on a V100 with a BF16 copy of the Q4_K_M drafter (every quantized matrix converted to BF16 - 2,352,022,432 bytes, the same size as the published bf16 file):
glm_fast mv: an illegal memory access, as under yourCUDA_LAUNCH_BLOCKING=1), and GLM-5.3-Flash with--dflashon it stops after the first token withglm dflash: draft: an illegal memory access was encountered- your C1 / D1 rows.Until v1.1.17 is out, the Q4_K_M drafter (the one the setup installs) is the one to use.
@mw00 commented on GitHub (Oct 20, 2026):
Fixed in v1.1.17. Thanks for the report! Please reopen if it shows up again.