Skip to content

PR3: DFlash2 draft backend + length-based speculative switching - #3

Open
Astrangemaninhere wants to merge 4 commits into
masterfrom
pr3/length-based-spec
Open

PR3: DFlash2 draft backend + length-based speculative switching#3
Astrangemaninhere wants to merge 4 commits into
masterfrom
pr3/length-based-spec

Conversation

@Astrangemaninhere

@Astrangemaninhere Astrangemaninhere commented Aug 31, 2026

Copy link
Copy Markdown
Owner

PR3: DFlash2 draft backend + length-based speculative switching

Background

Adds the DFlash2 draft backend (grouped-query attention draft model) and length-based switching between speculative backends.

Changes

  • DFlash2 backend port: draft attention, grouped conv, and length-based switching between MTP / DFlash / DFlash2.
  • Length-based selection: the backend is chosen by sequence length so short contexts use the cheap draft path and long contexts switch to the accurate one.
  • Smoke-test fixes for the DFlash2 path.

Files

  • src/ops/launcher/dflash2_* (grouped conv, selector)
  • src/targets/qwen3_6/impl/runtime/dflash2_impl.h (backend)
  • src/targets/qwen3_6/impl/runtime/speculative_target_impl.h (length-based switching)

Dependency

Depends on PR1/PR2. Merge after PR2.

NInfer Agent added 4 commits August 30, 2026 23:39
Applied to the PR3 branch from the integration fixes (9bf5135, d4f6e0d):

1. CUDA-graph preparation segfaulted with --spec dflash2: the graph
   representative wrote dflash_host_ingress unconditionally, but DFlash2
   keeps separate dflash2_host_* buffers and dflash_host_ingress is null
   when only DFlash2 is active. Select ingress/egress by backend and zero
   DFlash2's pending_features too.
2. --spec auto failed to load because only plan_load resolved it; the
   planner and loaded model saw SpeculativeBackend::Auto and the startup
   features mismatch check rejected the weights. registry now resolves auto
   once up front (resolved_auto_speculative is a public Package static;
   35b gets the same hook, auto -> MTP).
3. auto picks the backend from the artifact weights: DFlash2 artifact
   always DFlash2 (no MTP head), any other artifact defaults to MTP.

Verified: dflash2 CLI/serve generation, dflash2 + auto -> speculative=
dflash2, base + auto -> MTP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant