[PR #1426] [CLOSED] dflash: experimental standalone DeepSpec DFlash block drafter for Qwen3.8-Flash-Next #3446

Closed
opened 2026-11-07 14:41:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1426
Author: @j-luwierski
Created: 10/7/2026
Status: ❌ Closed

Base: main ← Head: feat/dflash


📝 Commits (10+)

  • d6760a1 dflash: the standalone DFlash artifact contract (GGUF metadata, geometry, CLI)
  • f1bb646 dflash: the target feature taps [3,15,23,35,43] (HC-contracted residuals)
  • a5f3800 dflash: the standalone block forward, wired into the plain decode loop (greedy)
  • dde0544 dflash: a numpy reference forward for the fixture-parity harness
  • cb6a830 dflash: the forward's debug probes behind STRATA_DF_DBG, noise prints removed
  • a989b5b fix(dflash): use the drafter's full-head 256-dim NeoX RoPE
  • 9f86b99 fix(dflash): initialize the batched attention's identity rows for every query
  • 23f0e8f fix(dflash): the host-only dflash_load_test needs the CUDA include path (dflash.hpp -> session.hpp)
  • d5ba449 fix(dflash): one definition of dflash_identity_fill (the anonymous-namespace copy made the call ambiguous)
  • 9899c66 refactor(dflash): split the loader and the device runtime into separate TUs

📊 Changes

116 files changed (+35081 additions, -162 deletions)

View changed files

📝 CMakeLists.txt (+36 -0)
➕ bench/results/2026-10-17-dflash-review/FOLLOWUP.md (+3 -0)
➕ bench/results/2026-10-17-dflash-review/REPORT.md (+243 -0)
➕ bench/results/2026-10-17-dflash-review/auto-cache/math-0-dflash-engine.log (+64 -0)
➕ bench/results/2026-10-17-dflash-review/auto-cache/math-0-mtp-engine.log (+57 -0)
➕ bench/results/2026-10-17-dflash-review/auto-cache/math-0-target-engine.log (+49 -0)
➕ bench/results/2026-10-17-dflash-review/auto-cache/math-results.json (+3227 -0)
➕ bench/results/2026-10-17-dflash-review/auto-fixture-config.json (+49 -0)
➕ bench/results/2026-10-17-dflash-review/before-fallback-probe.json (+50 -0)
➕ bench/results/2026-10-17-dflash-review/before-fallback-sampling.json (+1642 -0)
➕ bench/results/2026-10-17-dflash-review/cache-engine.log (+75 -0)
➕ bench/results/2026-10-17-dflash-review/cache-results.json (+642 -0)
➕ bench/results/2026-10-17-dflash-review/cache-test.log (+9 -0)
➕ bench/results/2026-10-17-dflash-review/confidence-sweep.json (+7466 -0)
➕ bench/results/2026-10-17-dflash-review/conversation-tests.log (+22 -0)
➕ bench/results/2026-10-17-dflash-review/cuda-build.log (+12 -0)
➕ bench/results/2026-10-17-dflash-review/cuda-tests.log (+14 -0)
➕ bench/results/2026-10-17-dflash-review/dflash-confidence-engine.log (+99 -0)
➕ bench/results/2026-10-17-dflash-review/environment.json (+13 -0)
➕ bench/results/2026-10-17-dflash-review/fixture-config.json (+47 -0)

...and 80 more files

📄 Description

Add experimental DFlash decoding, setup integration and hardware calibration

Summary

Adds an experimental standalone DFlash drafter for Qwen3.8-Flash-Next, integrated with Strata's existing target verifier, server and installer.

Setup now offers MTP, DFlash or Off. Selecting DFlash skips MTP download, preparation and loading. Off disables both model drafters while keeping suffix/prompt lookup enabled.

Changes

  • Implement DFlash feature capture, context KV injection and parallel draft generation using the target's embedding and output head.
  • Support original BF16 weights and whole-drafter Q8_0, Q5_0 and Q4_0 quantization through llama.cpp's GGML quantizers. Normalization vectors retain their original BF16 values.
  • Download and verify the pinned checkpoint, prepare and cache GGUF artifacts, and persist the selected mode in the server configuration.
  • Add batched projections, indexed output-head projection, GPU graph reuse and attention over populated KV cells.
  • Grow DFlash KV storage and attention scratch as needed on supported CUDA configurations.
  • Extend hardware calibration to measure draft widths, confidence thresholds and PCIe settings, with repeated comparisons before saving a configuration.
  • Validate artifact metadata, request limits, mask tokens and memory ownership.
  • Add loader, setup, quantization, calibration, KV and numerical-reference tests.

Example installation:

./setup.sh --setup --yes --model IQ3_XXS --drafter dflash --dflash-quant q4

Validation

  • CUDA engine build on Linux.
  • Setup, calibration, quantization and server tests.
  • GPU checks for feature packing, full-head RoPE, owned KV storage and indexed projections.
  • Greedy generation tests and stage comparisons against independent references.

Performance

DFlash does not yet outperform MTP in the latest comparison.

Measured on an RTX 4070 Ti SUPER 16 GB, Ryzen 5900X and 128 GB RAM, using the same IQ3_XXS target, eight serial greedy requests and up to 512 generated tokens per request:

Mode Aggregate decode throughput
MTP 83.6 tok/s
DFlash 73.4–76.0 tok/s

Throughput excludes startup and prefill. These measurements cover short contexts on one machine and do not establish performance across other hardware or workloads. Experimental variants without a confirmed speed benefit were reverted.

Current limitations

  • DFlash drafting supports greedy decoding. Sampled requests fall back to target-only decoding.
  • The initial integration supports one GPU and serial requests.
  • Target-only conversation snapshots are not reused for DFlash; each request prefills the full prompt.
  • --dflash-window is a capacity limit, not a rolling attention window.
  • HIP and SYCL were not validated in this environment.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1426 **Author:** [@j-luwierski](https://github.com/j-luwierski) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/dflash` --- ### 📝 Commits (10+) - [`d6760a1`](https://github.com/Niko1221/Strata/commit/d6760a1e1df2d1aa7227101d78228e45207e7b8a) dflash: the standalone DFlash artifact contract (GGUF metadata, geometry, CLI) - [`f1bb646`](https://github.com/Niko1221/Strata/commit/f1bb646c9b150dd8614571ab7245346b39d4e4f9) dflash: the target feature taps [3,15,23,35,43] (HC-contracted residuals) - [`a5f3800`](https://github.com/Niko1221/Strata/commit/a5f38003b2d74712e7b80390f418367bf6d95fbb) dflash: the standalone block forward, wired into the plain decode loop (greedy) - [`dde0544`](https://github.com/Niko1221/Strata/commit/dde05448c83f416c49f955bc6b7b92502aac5ff3) dflash: a numpy reference forward for the fixture-parity harness - [`cb6a830`](https://github.com/Niko1221/Strata/commit/cb6a8308896776d69b8a8e824a8565699810f129) dflash: the forward's debug probes behind STRATA_DF_DBG, noise prints removed - [`a989b5b`](https://github.com/Niko1221/Strata/commit/a989b5b5a47f00a5b560ad877b3487033dbba940) fix(dflash): use the drafter's full-head 256-dim NeoX RoPE - [`9f86b99`](https://github.com/Niko1221/Strata/commit/9f86b99ebc2a7b8e1e4e24f314472ac741f59503) fix(dflash): initialize the batched attention's identity rows for every query - [`23f0e8f`](https://github.com/Niko1221/Strata/commit/23f0e8f90c58ffd70ca242f132a2491b0f43fc60) fix(dflash): the host-only dflash_load_test needs the CUDA include path (dflash.hpp -> session.hpp) - [`d5ba449`](https://github.com/Niko1221/Strata/commit/d5ba44953c9498b71c9171d1dddb4f4dd9eebf3d) fix(dflash): one definition of dflash_identity_fill (the anonymous-namespace copy made the call ambiguous) - [`9899c66`](https://github.com/Niko1221/Strata/commit/9899c66ebfe83f9c2eea18dc50d909b955b8e466) refactor(dflash): split the loader and the device runtime into separate TUs ### 📊 Changes **116 files changed** (+35081 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+36 -0) ➕ `bench/results/2026-10-17-dflash-review/FOLLOWUP.md` (+3 -0) ➕ `bench/results/2026-10-17-dflash-review/REPORT.md` (+243 -0) ➕ `bench/results/2026-10-17-dflash-review/auto-cache/math-0-dflash-engine.log` (+64 -0) ➕ `bench/results/2026-10-17-dflash-review/auto-cache/math-0-mtp-engine.log` (+57 -0) ➕ `bench/results/2026-10-17-dflash-review/auto-cache/math-0-target-engine.log` (+49 -0) ➕ `bench/results/2026-10-17-dflash-review/auto-cache/math-results.json` (+3227 -0) ➕ `bench/results/2026-10-17-dflash-review/auto-fixture-config.json` (+49 -0) ➕ `bench/results/2026-10-17-dflash-review/before-fallback-probe.json` (+50 -0) ➕ `bench/results/2026-10-17-dflash-review/before-fallback-sampling.json` (+1642 -0) ➕ `bench/results/2026-10-17-dflash-review/cache-engine.log` (+75 -0) ➕ `bench/results/2026-10-17-dflash-review/cache-results.json` (+642 -0) ➕ `bench/results/2026-10-17-dflash-review/cache-test.log` (+9 -0) ➕ `bench/results/2026-10-17-dflash-review/confidence-sweep.json` (+7466 -0) ➕ `bench/results/2026-10-17-dflash-review/conversation-tests.log` (+22 -0) ➕ `bench/results/2026-10-17-dflash-review/cuda-build.log` (+12 -0) ➕ `bench/results/2026-10-17-dflash-review/cuda-tests.log` (+14 -0) ➕ `bench/results/2026-10-17-dflash-review/dflash-confidence-engine.log` (+99 -0) ➕ `bench/results/2026-10-17-dflash-review/environment.json` (+13 -0) ➕ `bench/results/2026-10-17-dflash-review/fixture-config.json` (+47 -0) _...and 80 more files_ </details> ### 📄 Description # Add experimental DFlash decoding, setup integration and hardware calibration ## Summary Adds an experimental standalone DFlash drafter for Qwen3.8-Flash-Next, integrated with Strata's existing target verifier, server and installer. Setup now offers **MTP**, **DFlash** or **Off**. Selecting DFlash skips MTP download, preparation and loading. Off disables both model drafters while keeping suffix/prompt lookup enabled. ## Changes - Implement DFlash feature capture, context KV injection and parallel draft generation using the target's embedding and output head. - Support original BF16 weights and whole-drafter Q8_0, Q5_0 and Q4_0 quantization through llama.cpp's GGML quantizers. Normalization vectors retain their original BF16 values. - Download and verify the pinned checkpoint, prepare and cache GGUF artifacts, and persist the selected mode in the server configuration. - Add batched projections, indexed output-head projection, GPU graph reuse and attention over populated KV cells. - Grow DFlash KV storage and attention scratch as needed on supported CUDA configurations. - Extend hardware calibration to measure draft widths, confidence thresholds and PCIe settings, with repeated comparisons before saving a configuration. - Validate artifact metadata, request limits, mask tokens and memory ownership. - Add loader, setup, quantization, calibration, KV and numerical-reference tests. Example installation: ```sh ./setup.sh --setup --yes --model IQ3_XXS --drafter dflash --dflash-quant q4 ``` ## Validation - CUDA engine build on Linux. - Setup, calibration, quantization and server tests. - GPU checks for feature packing, full-head RoPE, owned KV storage and indexed projections. - Greedy generation tests and stage comparisons against independent references. ## Performance DFlash does **not yet outperform MTP** in the latest comparison. Measured on an RTX 4070 Ti SUPER 16 GB, Ryzen 5900X and 128 GB RAM, using the same IQ3_XXS target, eight serial greedy requests and up to 512 generated tokens per request: | Mode | Aggregate decode throughput | |---|---:| | MTP | 83.6 tok/s | | DFlash | 73.4–76.0 tok/s | Throughput excludes startup and prefill. These measurements cover short contexts on one machine and do not establish performance across other hardware or workloads. Experimental variants without a confirmed speed benefit were reverted. ## Current limitations - DFlash drafting supports greedy decoding. Sampled requests fall back to target-only decoding. - The initial integration supports one GPU and serial requests. - Target-only conversation snapshots are not reused for DFlash; each request prefills the full prompt. - `--dflash-window` is a capacity limit, not a rolling attention window. - HIP and SYCL were not validated in this environment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:32 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3446
No description provided.