mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #47] [CLOSED] prefill: the borrow estimate misses the NextN cache fill - chunks over ~9K tokens on a split crash #299
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#299
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/47
Author: @sociolog
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:pr3-prefill-borrow📝 Commits (1)
79dd17eprefill: the borrow estimate takes the NextN cache fill's region; a chunk that does not fit the lent tail is refused📊 Changes
1 file changed (+11 additions, -1 deletions)
View changed files
📝
src/core/glm_prefill.cu(+11 -1)📄 Description
The bug
prefill_carvesizes the per-layer region as the max over the mixers, the MoE and - on the half that carries theNextN block - the block's cache fill (
T x (6 n_embd + kv_lora + 2 idx_key)floats). The setup's estimate(
bytes_for), which sizes the pool tail that is lent to the prompt path, leaves the NextN term out. Up to ~9K tokensa chunk the MoE term is larger, so it never showed; above that, on the NextN half, the carve runs past the lent tail.
Repro on v1.0.15 / v1.0.16 (RTX 3090 + 3060, Maya-M):
STRATA_GLM_PREFILL_CHUNK=10240 STRATA_GLM_PREFILL_MB=4096,any prompt over ~10K tokens: the expert staging
cudaMemcpyAsyncreturns "invalid argument" (its destination isoutside the pool), the next check reports
prefill mmq: quantize: invalid argument, then the engine segfaults.Instrumented: CUDA1 carve 2407 MB, lent tail 2307 MB.
The fix
prefill()refuses a carve larger than the lent tail with a message instead of writing past it.Result
20,025-token prompt, 3090 + 3060 split, prompt speed by chunk size (all run now; > 8192 crashed before):
The 2-part default stays 8192 in this patch (two pipelined chunks of ~10K are ~5 % faster on a 20K prompt here; one
chunk loses the pipelining between the halves) - your call whether to raise it.
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.