Repository navigation
serve: the prompt path's loan has room for a short request that keeps 0.1.39's ring (#2090) - #2131
ischencheng wants to merge 1 commit into
Conversation
… 0.1.39's ring (Niko1221#2090) With --prefill auto the serve scan sizes the loan for the chosen chunk with the byte-budget ring, but a request whose chunk is at most 0.1.39's pick reads with 0.1.39's ring. On a pack with bigger blobs than Q2_0's that ring has more slots, so such a request can need more of the cache than the loan holds; its relayout failed ("lending the prompt path its slots failed: ... do not fit") and the engine exited. The loan now covers both. A request still lends only the slots its own chunk needs, so one that fitted before lends the same slots. L4 24 GB, IQ3_XXS, --prefill auto, --expert-cache 905-915 / 1088-1100 / 1284-1290 (auto 2816 / 3840 / 4864, a 227-slot ring): a fresh 2048- / 3072- / 4096-token prompt stopped the engine on 8 of 8 starts before, 0 after.
|
For triage: the failure this PR targets (#2090, "lending the prompt path its slots failed" on one GPU) was fixed in main another way in v0.1.43.1 by 4468e0e and af6affb (the loan starts where the request's chunk needs it, and a chunk that cannot be lent is halved), and the #2090 reporter confirmed it on v0.1.43.1 (RTX 4070 Ti, 6 cold starts with 0 engine exits, against 2 of 9 on 0.1.43). This branch still applies to main 296b59d, so whether its |
|
Thanks for the table, this is a real crash. It is a fix and not a speed change, so it is outside this round; we would take it as a bug fix. |
|
@Niko1221 thanks. Your af6affb in 0.1.43.1 already covers this: the loan starts where the request's chunk needs it, so these configs no longer exit, and the reporter confirmed it. On top of that this branch only makes the lent region 35-36 slots bigger up front in the configs from my table, so I don't think it adds anything. Fine to close it. |
|
Thanks for the pull request. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to review properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes:
The rules are in CONTRIBUTING.md. |
Fixes #2090.
With
--prefill autothe serve scan sizes the prompt path's loan for the chunk it picked, with the byte-budget ring. A request whose chunk is at most 0.1.39's pick (smallinset_ring_budget(..., small)) reads with 0.1.39's ring instead. On a pack with bigger blobs than Q2_0's that ring has more slots (384 against 227 on IQ3_XXS), so the short request can need more of the cache than the loan holds.lendclamps it to the loan's first slot,relayoutruns out of room, and the engine exits with "lending the prompt path its slots failed". That is why it only showed with--prefill autoand only at some cache sizes in the report.The loan now has room for both:
max(part_slots(chunk), part_slots(small)). The same helper is used where the loan is sized again (the step-down after a failed init, andrelendunder--vram-elastic).lendis unchanged, so each request still lends only the slots its own chunk needs. A request that fitted before lends the same slots. Where 0.1.39's chunk needs no more slots than the chosen one, the loan does not change at all.Measured on Modal, one L4 24 GB (sm_89, Linux), the official IQ3_XXS pack, upstream main 7695859,
--prefill auto --max-context 131072 --kv int8. I set--expert-cache Nby hand to land on the cache sizes where this happens. Each start gets four fresh prompts whose first part rounds up to a 2048 / 3072 / 4096 / 6144-token chunk.--expert-cacheTwo more runs of some of the failing rows gave the same result (main 5 of 5 starts, this PR 0 of 5). Main's error is the one in the report, with 13 GB of VRAM free:
Replies (temperature 0, thinking off, 64 tokens) to the 2048 / 3072 / 4096 prompts are the same on main and this PR at every cache size where main answered them. The 6144 one changes between starts of main itself on this setup (3 different replies in 4 starts at
--expert-cache 900); this PR's reply was one of main's.src/program/generate.cppalso builds for HIP: compiled it in a ROCm 7.0 build for gfx1201 (that one file, no GPU), with the same 98 warnings as main.Not tested: Windows, the reporter's IQ3_S pack and 4070 Ti, a HIP run, layer splits,
--vram-elastic.sycl/src/program/generate.cpphas the same scan and is not changed here. The resident RAM mode sizes its RAM copy's lend region fromplan_lend, which still counts the chosen chunk only, so there a short request's extra slots are read from the model file during that prompt.