Repository navigation
Conversation
…stalls other streams' rounds Qwen3.5-2B's Metal backend gains prefill_step and cancel_prefill (#3021). prefill.run becomes open (main's restore of a kept prefix) and step (one turn of main's loop), and the whole pass is open plus steps, so both drivers run the same chunk body and replies are unchanged. Each call runs one chunk at exactly the whole pass's cuts (the chunk cap, the next planned start, the next kept mark); Qwen3.5 declares no chunk invariance, so max_rows is ignored and the cuts never move. The GDN and conv state live in the stream's cache, so a step carries only its next row between calls. A cancel keeps the state at the last chunk's end; a stream that leaves mid-pass is forgotten, its paged lane released. Host tests on host-backed caches with a sentinel forward: stepped chunks equal the whole loop's and leave the same state byte for byte, a resumed pass cuts as main does, a cancel keeps the last chunk's end, and another stream decodes between two chunks of a long prompt. The new step joins the macOS host CI list. Rebased onto main 038e4a2: main added a background-yield check inside the loop this PR splits into open/step. It is ported into step() right after the cancel check, keeping the last chunk's end and returning error.Yielded, as cuda_prefill.zig's chunk() does; run() stays open plus the step loop.
Add opt-in Metal DFlash2 drafting for GLM-5.3-Flash behind --drafter with --drafter-bits 4 (quantized at load) or 0 (bf16). Captures the target's five tapped layers into per-stream ring buffers, runs same-buffer GPU accept/follow and shared multi-stream draft passes in the target residency set, falls back to the target's MTP head past the context cap or when MTP outperforms DFlash2, and refuses --drafter beside --speed-up or unsupported --drafter-bits. Register the five new DFlash2 GPU kernels and controls in the Metal kernel contract, document TF_GLM_DRAFT_CONFIDENCE's 0.5 Metal default, and update the optimization ledger. Refs #3152
…and b4d4795 Main's cc17776 left zig/src/families/glm/forward.zig at 600 lines and b4d4795 (#2761) left zig/src/native/metal.zig at 597, so this PR's DFlash2 taps and drafter wiring took them to 603 and 602. Three blank lines after one-line declarations in forward.zig and two in metal.zig go; nothing else changes.
…t, trim comments Count the tap-stage buffer beside drafter model bytes in heldBytes and load accounting, wire the self-referential core module into the GLM scheduling and restore host build steps so macOS/Linux host compile checks succeed, add heldBytes coverage to the DFlash2 host suite, and wrap comments to 120 columns. Refs #3152
8 tasks done
Owner
Author
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.
CI for a landing train: #3090 #3920 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.