Repository navigation
pr-set: pin #385 and #386 (Inkling 2 relative-bias memory) - #392
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins #385 and #386 right after #390. Together they stop Inkling 2 from building the dense relative-position bias for the whole cache on every ubatch, which is what makes a long-context load run out of memory.
On the current set, a looped Inkling 2 Q4_K_XL GGUF with
-c 1048576 -np 4 -kvu -ub 512 -fa ontries to allocate a 101,563 MiB compute buffer and the load fails (cudaMalloc failed: out of memory). The bias is gathered as F32 for every cached token x ubatch row x head, about 99 KiB per context token. With both pins the same load reserves 9,421 MiB and starts.8825dc242dGGML_OP_FLASH_ATTN_EXT_BANDED, plus per-query sinks, split-KV decode and a tensor-core prefill kernel), dense fallback through #385523e46559b#386 did not merge on top of the current set: its stacked base still had #385 from before the comment trim, so the trimmed lines in
inkling2.cppconflicted with #386's rewrite of the same block. The branch now merges #385 at8825dc242d(theinkling2.cppresolution keeps #386's side; the tree differs from the old head only by #385's trimmed comment inllama-graph.h) and #378 ate65c374cbe(clean). #386 is now based onbase/upstream-8bf88ba93, the same upstream commit #378 uses, so its PR diff isdiff(merge-base, pin). That diff includes the #378 and #385 code it builds on, at their pinned SHAs. Upstream has neither the banded op nor the chunking.Evidence
sim --tags window, b12569 to b12590 (10 tags): every tag ok. model : chunk the Inkling 2 relative-bias attention over query rows #385 merges additively, model : banded flash attention for the Inkling 2 relative bias #386 cleanly, all 30 pins pass the pin contract, merge checks clean.verify --cudaon b12569 (aged) and b12590 (newest): CPU gate, full CUDA build and test-chat all ok. test-backend-ops: MUL_MAT 2829/2829, MUL_MAT_ID 1177/1177, PAD 37/37, GET_ROWS 361/361. Features 17/17 on CPU and GPU, includinginklingFLASH_ATTN_EXT_BANDED 53/53 andinkling2arch rows.test-llama-archs -a inkling2: 4/4.audit --pr-set: 30/30 pins clean, feature-checks coverage ok.Inkling-2-Small UD-IQ1_S, wikitext-2
-c 512 --chunks 20,--cpu-moe -fa on, this set vs current master on the same b12569 tree:-b 2048(4 sequences)-b 512(1 sequence)-b 512vs master-b 2048The banded delta is the same size as the batch-layout noise of the existing kernels.
Looped Inkling 2 Q4_K_XL, same trees:
-c 512 --chunks 20:-b 2048PPL 7.662897 on both, KLD 0.-b 512banded KLD 0.002594, top 97.745%; layout noise 0.002372 / 97.804%.-c 65536 --chunks 1:-fa off(chunked dense) PPL 6.121145 on both, KLD 0.-fa on(banded) KLD 0.002081, top 98.105%.-fa off, 6,513 vs 787 MiB with-fa on.-np 4 -kvu -ub 512 -fa on:--spec-type draft-dspark), 4 greedy prompts x 256 tokens: output text identical, 643/1120 drafted tokens accepted on both. Target compute buffers are the same as without the draft.Order
#386 needs #378 and #385 in the tree. Both come before it in this list.
Not covered
ROCm, Vulkan, macOS, Windows and ARM legs (nightly only). Tags after b12590. Real-weight long-context quality past 64K. No throughput A/B: the GPUs were shared.