[PR #4911] [CLOSED] [Engine] dsv41: pack the Lucebox DSpark drafter (deepseek41-dflash-draft) #5248

Closed
opened 2026-11-07 16:33:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4911
Author: @dingyiyuan
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: pr-lucebox-drafter


📝 Commits (1)

  • eef1436 tools/dsv41: pack the Lucebox DSpark drafter (deepseek41-dflash-draft)

📊 Changes

1 file changed (+35 additions, -4 deletions)

View changed files

📝 tools/dsv41/pack_gguf.py (+35 -4)

📄 Description

Problem and result

pack_gguf.py --dspark-gguf refuses Lucebox's DeepSeek-V4.1-Flash-DSpark GGUF, which is a valid DSpark drafter. Five differences from the unsloth dflash set each stop the pack, and a sixth one only shows up after the pack loads:

unsloth dflash Lucebox deepseek41-dflash-draft
architecture check dflash deepseek41-dflash-draft (rejected)
geometry keys dflash.block_size, … <arch>.dflash.block_size, …
block count dflash.block_count <arch>.block_count
head tensors fc.weight, enc.output_norm.weight, conf_proj.weight, markov_w1/w2.weight dflash.fc.weight, dflash.hidden_norm.weight, dflash.dspark.confidence.weight, dflash.dspark.markov.w1/w2
noise token only --dspark-noise-token also carried as <arch>.dflash.mask_token_id
markov_head.embed dtype BF16 F16

Before: SystemExit: ... not a DSpark (dflash) GGUF, and after working around that, the engine rejected the pack with mtp.2.markov_head: not the BF16 embed and F16 / BF16 head expected.

After: the pack builds and the engine loads it (DSpark drafter from ...: 3 blocks, dspark_block_size 5, 1242 mtp tensors) and drafts.

none

Approach

  • accept both architectures and read the geometry keys from <arch>.dflash.<k>, falling back to <arch>.<k>; block_count from <arch>.block_count
  • take the noise token from <arch>.dflash.mask_token_id when --dspark-noise-token is not passed
  • map the dflash.* head names onto the checkpoint's mtp.N.* names (fc → main_proj, hidden_norm → main_norm, markov.w1/w2 → markov_head.embed/head, confidence.weight → confidence_head.proj); dflash.dspark.confidence.bias has no engine-side counterpart and is skipped by name
  • convert markov_head.embed from F16 to BF16 into a <drafter>.mkembed_bf16.bin side file at pack time and point the tensor at it: F16 and BF16 are the same width, so this is a value-preserving conversion, not a re-quantisation

Nothing changes for the dflash path: every new key is tried first and the old spelling is the fallback.

Validation

Passed:

python tools/dsv41/pack_gguf.py \
  --model <DeepSeek-V4.1-Flash IQ2_XXS GGUF> \
  --engram <engram-q6k-stub.gguf> \
  --dspark-gguf DeepSeek-V4.1-Flash-DSpark-draft-Q2K-Q4K.gguf \
  --out <pack dir>

Revision: the same change carried on a local branch of b70-sycl-dsv41-perf (this PR's commit is the change re-applied to main; the two differ only in that base).

Environment: Ubuntu, Intel Arc Pro B70 32 GB, oneAPI/SYCL engine built JIT with SYCL_PROGRAM_COMPILE_OPTIONS=-O3; base model DeepSeek-V4.1-Flash IQ2_XXS (40 layers, 15360 routed experts), drafter Lucebox Q2K-Q4K (4.92 GB).

Observed: the packer printed DSpark drafter from DeepSeek-V4.1-Flash-DSpark-draft-Q2K-Q4K.gguf: 3 blocks; the pack's --pack-info reports dspark_block_size 5, markov_rank 256, noise 128799, n_routed_experts 128, 1242 mtp tensors; the engine loads it and runs with --dspark on: acceptance 100% (315/315), 5.84 tokens a round, draft ~7 ms/round.

Failed:

none observed

Not run:

  • re-running the packer on this branch. The change is a re-application to main; the base commit differs from the branch the pack was built on, and building it again needs the 164 GB base model and about half an hour of packing.
  • the dflash (unsloth) path after the change. It keeps its original key spellings and takes the same code path as before, but I did not re-pack an unsloth drafter to confirm the fallback.

Limits

  • Only the tensor names and dtypes of the Lucebox set are handled; if it gains tensors the engine has no slot for, the pack still fails by name (DSpark GGUF tensors the pack does not map), which is the intended behaviour.
  • This makes the pack correct, not the feature profitable: on the same machine the drafter is cheap (7 ms/round) but the verification window costs ~285 ms, because a 6-token window routes to ~36 experts per layer instead of 6. Measured acceptance is 100%, so the loss is entirely on the verify side, and DSpark is a net loss here (-13%). That is a separate question from this change and is written up with the measurements rather than claimed here.

🔄 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/4911 **Author:** [@dingyiyuan](https://github.com/dingyiyuan) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr-lucebox-drafter` --- ### 📝 Commits (1) - [`eef1436`](https://github.com/Niko1221/Strata/commit/eef1436fb5fb02238803b7de0fa4abce8db05004) tools/dsv41: pack the Lucebox DSpark drafter (deepseek41-dflash-draft) ### 📊 Changes **1 file changed** (+35 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tools/dsv41/pack_gguf.py` (+35 -4) </details> ### 📄 Description ## Problem and result `pack_gguf.py --dspark-gguf` refuses Lucebox's DeepSeek-V4.1-Flash-DSpark GGUF, which is a valid DSpark drafter. Five differences from the unsloth `dflash` set each stop the pack, and a sixth one only shows up after the pack loads: | | unsloth `dflash` | Lucebox `deepseek41-dflash-draft` | |---|---|---| | architecture check | `dflash` | `deepseek41-dflash-draft` (rejected) | | geometry keys | `dflash.block_size`, … | `<arch>.dflash.block_size`, … | | block count | `dflash.block_count` | `<arch>.block_count` | | head tensors | `fc.weight`, `enc.output_norm.weight`, `conf_proj.weight`, `markov_w1/w2.weight` | `dflash.fc.weight`, `dflash.hidden_norm.weight`, `dflash.dspark.confidence.weight`, `dflash.dspark.markov.w1/w2` | | noise token | only `--dspark-noise-token` | also carried as `<arch>.dflash.mask_token_id` | | `markov_head.embed` dtype | BF16 | **F16** | Before: `SystemExit: ... not a DSpark (dflash) GGUF`, and after working around that, the engine rejected the pack with `mtp.2.markov_head: not the BF16 embed and F16 / BF16 head expected`. After: the pack builds and the engine loads it (`DSpark drafter from ...: 3 blocks`, `dspark_block_size 5`, 1242 mtp tensors) and drafts. ## Related discussion none ## Approach - accept both architectures and read the geometry keys from `<arch>.dflash.<k>`, falling back to `<arch>.<k>`; `block_count` from `<arch>.block_count` - take the noise token from `<arch>.dflash.mask_token_id` when `--dspark-noise-token` is not passed - map the `dflash.*` head names onto the checkpoint's `mtp.N.*` names (`fc` → `main_proj`, `hidden_norm` → `main_norm`, `markov.w1/w2` → `markov_head.embed/head`, `confidence.weight` → `confidence_head.proj`); `dflash.dspark.confidence.bias` has no engine-side counterpart and is skipped by name - convert `markov_head.embed` from F16 to BF16 into a `<drafter>.mkembed_bf16.bin` side file at pack time and point the tensor at it: F16 and BF16 are the same width, so this is a value-preserving conversion, not a re-quantisation Nothing changes for the `dflash` path: every new key is tried first and the old spelling is the fallback. ## Validation **Passed:** ``` python tools/dsv41/pack_gguf.py \ --model <DeepSeek-V4.1-Flash IQ2_XXS GGUF> \ --engram <engram-q6k-stub.gguf> \ --dspark-gguf DeepSeek-V4.1-Flash-DSpark-draft-Q2K-Q4K.gguf \ --out <pack dir> ``` Revision: the same change carried on a local branch of `b70-sycl-dsv41-perf` (this PR's commit is the change re-applied to `main`; the two differ only in that base). Environment: Ubuntu, Intel Arc Pro B70 32 GB, oneAPI/SYCL engine built JIT with `SYCL_PROGRAM_COMPILE_OPTIONS=-O3`; base model DeepSeek-V4.1-Flash IQ2_XXS (40 layers, 15360 routed experts), drafter Lucebox `Q2K-Q4K` (4.92 GB). Observed: the packer printed `DSpark drafter from DeepSeek-V4.1-Flash-DSpark-draft-Q2K-Q4K.gguf: 3 blocks`; the pack's `--pack-info` reports `dspark_block_size 5`, `markov_rank 256`, `noise 128799`, `n_routed_experts 128`, 1242 mtp tensors; the engine loads it and runs with `--dspark on`: **acceptance 100% (315/315), 5.84 tokens a round, draft ~7 ms/round**. **Failed:** none observed **Not run:** - re-running the packer on *this* branch. The change is a re-application to `main`; the base commit differs from the branch the pack was built on, and building it again needs the 164 GB base model and about half an hour of packing. - the `dflash` (unsloth) path after the change. It keeps its original key spellings and takes the same code path as before, but I did not re-pack an unsloth drafter to confirm the fallback. ## Limits - Only the tensor names and dtypes of the Lucebox set are handled; if it gains tensors the engine has no slot for, the pack still fails by name (`DSpark GGUF tensors the pack does not map`), which is the intended behaviour. - This makes the pack correct, not the feature profitable: on the same machine the drafter is cheap (7 ms/round) but the verification window costs ~285 ms, because a 6-token window routes to ~36 experts per layer instead of 6. Measured acceptance is 100%, so the loss is entirely on the verify side, and DSpark is a net loss here (-13%). That is a separate question from this change and is written up with the measurements rather than claimed here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:33:47 +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#5248
No description provided.