mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #600] [CLOSED] DS4: optional shape-preserving whole-chunk prompt skip #620
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#620
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/600
Author: @LostVector
Created: 10/28/2026
Status: ❌ Closed
Base:
main← Head:upstream/ds4-whole-chunk-skip📝 Commits (1)
86ca987DS4: add optional whole-chunk prompt skipping📊 Changes
5 files changed (+77 additions, -4 deletions)
View changed files
📝
CMakeLists.txt(+2 -0)📝
docs/SETTINGS.md(+8 -0)📝
src/ds4/ds4_model.cu(+13 -4)➕
src/ds4/ds4_prompt_skip.hpp(+12 -0)➕
tests/ds4_prompt_skip_test.cpp(+42 -0)📄 Description
In earlier matrix-prefill tests, whole-chunk skipping preserved all 195 checked full-vocabulary states while reducing prompt latency by 17.6% at 8K and 38.4% at 32K versus running every layer on every token. Upstream now already skips that unnecessary work. This draft adds only the remaining option: keep the original chunk shapes by skipping complete chunks and retaining the entire chunk at the cut.
For example, an 8,192-token prompt with a 4,096-row chunk cap normally has two chunks. A cut after 5,524 rows makes only 2,668 rows of the second chunk run through the later layers. With this option, the cut moves back to 4,096: the entire second chunk runs through them. More rows are computed, but its original shape is retained. On several GPU groups, the original chunk schedule is kept rather than being rebuilt around the cut.
Enable
MAYA_DS4_YOCO_WHOLE_CHUNKS=1(default off; STRATA/native aliases supported). It applies only to existing mode 1 skip eligibility. Mode 0, the shorter mode 2 replay, unsupported placements, chunk-cap settings and expert policies are unchanged. The boundary uses the actual balanced chunk width: 10,000 tokens at cap 4,096 form widths 3,334/3,334/3,332, so rounding to the configured cap itself would be wrong. The option adds no allocations.This is a shape-preservation choice, not a claim of faster execution than upstream's default skip. Keeping an extra partial chunk can cost performance or eliminate the skip on short prompts. Shape preservation also does not by itself guarantee bit-exact model output: expert grouping and other runtime choices can still change arithmetic.
Current-base checks (
249f9a8):maya-ds4production build and help smoke, HIP API mapping check.Historical evidence is intentionally scoped: the earlier controlled matrix-prefill run used frozen expert residency and warm caches, an older stack, and two R9700s plus a 9070 XT. All195 snapshots matched; all three synthetic retrieval answers were correct. Timing retained all 24 scheduled samples: 8K means 19.462→16.036s (four paired blocks), 32K 71.307→43.911s (two paired blocks). These within-session blocks do not establish cross-load precision, broad quality, decode gains or improvement over current upstream. A later 4K-chunk checkpoint also matched 195 states; changing the overall chunk cap from 2K to 4K itself was not bit exact.
This ports the remaining option from fork #32, with historical matrix measurements recorded in fdded54 and 4K numerical checks in fork #37.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.