Repository navigation
Conversation
wai-bao
force-pushed
the
refactor/decode-width-unification-v2
branch
5 times, most recently
from
November 1, 2026 16:30
de2fd52 to
0b4514f
Compare
wai-bao
force-pushed
the
refactor/decode-width-unification-v2
branch
13 times, most recently
from
November 2, 2026 10:27
b8f50fd to
b5d4a50
Compare
✅ Netlify Deploy Preview readyBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
wai-bao
force-pushed
the
refactor/decode-width-unification-v2
branch
10 times, most recently
from
November 3, 2026 10:18
1a5d531 to
7605f8b
Compare
wai-bao
force-pushed
the
refactor/decode-width-unification-v2
branch
29 times, most recently
from
November 4, 2026 18:58
6b447b9 to
19a13c5
Compare
This branch has not been deployed
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.
Summary
Unifies the four per-site decode row-construction copies (MTP validate, MTP draft-extend, DFlash query, fixed/dflash2 verify) into a single
decode_input_builderwith a declarative plan, and consolidates the shared seq-lens / paged-KV layout knowledge that those copies each reimplemented.spec_input_builder(852 lines) in favor offramework/batch/decode_input_builder.{h,cpp}:RowSpecrows,DecodeLayout(flat / chunked / block-parallel / chunked-decode), plan-driven commit (update_block_table/commit_decode_input/commit_decode_geometry), and a namedexpand_idle_rank_blockentry for idle DP-rank synthetic blocks.kv_cache/layout/seq_lens_layout.h: the backend seq-lens layout policy (NPU per-seq vs cu_seqlens), single source forseq_len_at,append_seq_len(s),append_qo_indptr,seq_lens_capacity— replaces threeget_q_seq_lencopies and per-builderbuild_q_cu_seq_lens_veccopies.kv_cache/layout/paged_kv_layout.h: row-level paged-KV geometry (kv_page_count,kv_last_page_len,append_paged_kv_entries,slot_for_position,compute_slot_mapping) shared by the batch builders, the decode-row builder, the expanded-decode metadata builder, and the DSA metadata builders.update_decode_step_inputcopies (MTP / DFlash) behindExpectedKvPolicyinmtp_runtime_helpers, with the chunked-verify clamp parameters carried inside the policy.CachedDeviceIndices) for draft-query / draft-extend / validate indices,model_typeresolved once per worker instead of re-parsingconfig.jsonper predicate call, per-sequence hoists in draft-prefix bounds, and the per-stepresult.lengths.to(int32)cast removed from the verify commit.Net −276 lines across 53 files.
Testing
decode_input_builder_test(21),task_execution_pipeline_speculative_test(152),mtp_decode_input_test(25),mtp_decode_metadata_test(18),schedule_overlap_test(42),batch_test(134) all pass on NPU.