Skip to content

speculative: merge a draft tree's duplicate sibling candidates (tree verify 500s on every C1 request) - #368

Merged
AzeezIsh merged 1 commit into
mainfrom
fix/draft-tree-dedup-siblings
Nov 14, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
fix/draft-tree-dedup-siblings

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Summary

On main, every C1 request with ATLAS_DFLASH_TREE=<rows> (#333's exact tree verify) fails on its first verify step. The client gets HTTP 500 engine error: decode_verify_dflash_tree: draft tree: rows 1 and 2 are siblings with one token. The serve log only says Done: 1 tokens (error), with no ERROR line.

Cause: the DFlash2 selector can list one token twice for a draft position. best_first pushes one heap candidate per entry, so two sibling rows can carry the same token, and DraftTree::validate then rejects the tree. Duplicates now merge into one child carrying their summed mass. Ordering is unchanged otherwise.

Results (one GB10, Qwen3.8-27B NVFP4, the #333 exact profile at 8 seqs + ATLAS_DFLASH_TREE=16)

main eca124b5 this PR
C1 request HTTP 500 on the first verify step 320 tokens, 0 errors
greedy_eq vs serial decode, C1 / C1 + 4.4K prefix / C8 n/a (500) 8/8 / 8/8 / 8/8 identical
same with ATLAS_ATTN_SHARED_SCAN=1, vs the switch-on serial n/a (500) 8/8 / 8/8 / 8/8 identical

Open, not fixed here: with the error gone, tree-verify requests accept no drafts on this setup: p1=0.000 mean_na=0.000 tok_step=1.000, 10.7 tok/s, the serial rate. The chain verify on the same serve accepts ~3 per step. #333 measured tree verify at +4%. It's exact but not yet faster here, so it stays off in the recipe. Receipts: nq-137-tree-fix and nq-136 on sparky.

Separately: ATLAS_DFLASH_TREE=16 at --max-num-seqs 64 (the recipe's width) is killed at load with NV_ERR_NO_MEMORY. It sizes 15 SSM verify snapshots for all 65 slots, although tree verify runs only at C1.

Test plan

  • New duplicate_candidates_merge_into_one_child fails on main and passes here; draft_tree 9/9; fmt; clippy
  • GB10 greedy exactness as above, with the tree engaged (ATLAS_DFLASH_TREE: exact tree verify at C1, up to 16 rows)

Generated with Devin

The DFlash2 selector can list one token twice for a draft position; best_first
pushed one heap candidate per entry, so two sibling rows could carry the same
token and DraftTree::validate rejected the tree. Every C1 request under
ATLAS_DFLASH_TREE then failed on its first verify step (HTTP 500, "draft tree:
rows 1 and 2 are siblings with one token", no ERROR line). Duplicates now merge
into one child carrying their summed mass.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh
AzeezIsh merged commit b3732cd into main Nov 14, 2026
23 of 26 checks passed
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