Skip to content

perf(qwen): prepare packed Flash Next DFlash2 verification - #233

Closed
shadownetX wants to merge 1 commit into
NVIDIA:mainfrom
shadownetX:perf/flash-next-packed-verification
Closed

shadownetX wants to merge 1 commit into
NVIDIA:mainfrom
shadownetX:perf/flash-next-packed-verification

Conversation

@shadownetX

Copy link
Copy Markdown
Contributor

Flash Next DFlash2 prepares rectangular target verification, retaining padded rows when requests verify different prefix lengths. This uses the shared packed parallel-draft rounds and method-specific preparation defaults to capture physical target-row capacity independently of verification width.

MTP preparation stays rectangular. Packed exports capture width one and the configured positive draft depth; changing the positive runtime draft limit requires a separate export.

Validation: 433 targeted CPU checks passed; four CUDA checks were skipped. Four broader CLI failures reproduce on unmodified 972e28e. CUDA compilation/replay, native export/serving, and performance remain untested.

Draft for maintainer feedback before GPU validation. No measured performance gain is claimed.

@original-el8 original-el8 added area:kernels GPU kernels and numerical execution. area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request model:qwen3.8-flash-next Affected recipe or documented reproducer: qwen3.8-flash-next. Impact may be broader. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:validation Proposed implementation needs acceptance evidence; no claim that a reported defect is fixed. labels Nov 8, 2026
@original-el8

Copy link
Copy Markdown
Collaborator

Categorized as triage:validation for Qwen3.8 Flash Next DFlash2 preparation. The diff uses shared packed-round machinery and changes method-specific preparation defaults; it does not supply the mixed-prefill or YaRN behavior tracked in #210, #211 and #212, so those proposals are not superseded.

The PR reports 433 targeted CPU checks passing, with CUDA checks skipped and no GPU compilation/replay, exported-package serving or measured performance. Acceptance needs those GPU checks across differing request-prefix lengths, width-one continuation and the configured positive draft depth, including restored draft state. Existing packages retain their captured catalogs; a package using this layout requires export. No performance gain is established yet.

@CaptKitCarson

Copy link
Copy Markdown

GPU data point for this PR: two DGX Spark (GB10) nodes, TP2 over one direct 200G CX-7 link, driver 615.71.09, kernel 7.0.0-1019-nvidia.

Build: main at d2b5c5f3 with this PR and #232 merged, plus two local patches:

  • JMNI-Labs' host-system-reserve patch.
  • A one-line .contiguous() on the DFlash2 TP embedding slice in ignition/recipes/qwen38/dflash.py. Without it, TP2 DFlash2 export fails with BindingMismatch.

Baseline: 972e28e4 with the same two patches.

Both used the same checkpoint (nvidia/Qwen3.8-Flash-Next-FP4-Local) and the same flags:

  • export: --ranks 2 --max-concurrency 32 --speculative-method dflash2 --mtp-draft-tokens 7 --online-mxfp8 --draft-head-quantization nvfp4 --force-moe-decode-a16
  • serve: --mtp-draft-tokens 7 --mtp-adaptive-verification --mtp-adaptive-verification-alpha 0.5 --transfer-streams 1 --memory-limit=-28GiB --embedding-table-storage disk

The export completed on the first try in 68 min, including fresh tuning (59 kernel families vs 55 on the baseline). I benchmarked both packages back to back the same night with no other traffic, using llm_decode_bench at 8k context and 30 s per concurrency. Coding peak is 10 runs at C1.

baseline 972e28e4 d2b5c5f3 + #232 + #233
Coding peak median (min to max) 124.8 (95.8 to 143.8) 150.8 (124.2 to 152.0)
Decode tok/s at C1 / C4 / C16 72.4 / 153.7 / 282.5 72.1 / 149.7 / 275.8
KV tokens at load 3.89M 3.38M
Package fixed mappings per rank 44,724 MiB 46,654 MiB
Graphs / kernels 122 / 7,396 148 / 12,259

Correctness on the new package:

  • Tool-call check: 5/5.
  • Vision: 8/8.
  • Hotel Lights (medium effort, C4, temp 0.6, top-p 0.95, seed 1000): 23/30, with no truncations or timeouts. Our earlier 87cc8c1e MTP export scored 24/30 on the same test.

The package has been serving our production traffic since 2026-11-09 03:50 UTC.

Caveat: the baseline also lacks the 13 main commits between 972e28e4 and d2b5c5f3. So neither the coding-peak gain nor the roughly 1.9 GiB per rank of extra fixed mappings (about 13% of KV) can be attributed to this PR alone. The baseline's coding-peak median on an earlier night was 142.0, so the gain against that run is about 6%. The new package's per-run coding peak was much steadier: 9 of 10 runs fell between 150.0 and 152.0.

@shadownetX

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed testing and feedback, really appreciate it!

@shadownetX

Copy link
Copy Markdown
Contributor Author

Following my latest HyperFlare v0.1.0 benchmark campaign, I have switched my single-GB10 production setup to native MTP with mixed prefill.

I am still interested in packed DFlash2 verification, but I do not currently plan another DFlash2 export for GPU validation.

Given the recent upstream changes and the TP2 results reported above, I would appreciate maintainer feedback on whether this proposal remains relevant before rebasing it.

@original-el8

original-el8 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Updated mergeability check: head 8da334e merges cleanly into main 5fd4070; the earlier conflicts are resolved. The reported GB10 TP1 campaign completes all requests but shows consistent warm C2 regression and costs 1.10 GiB of loaded memory / 5.6% of KV capacity. Keeping this in draft/validation is appropriate; those results do not support default enablement. They qualify the stated v0.1.0 backport, not a new main export. No GPU run was repeated during this update.

@shadownetX
shadownetX force-pushed the perf/flash-next-packed-verification branch from f96fb13 to 3dd086b Compare November 13, 2026 18:53
Flash Next DFlash2's rectangular catalog pads target verification to the same width for each request even when logical prefixes differ. The shared parallel draft machinery supports independent physical target and logical sampling capacities, so reuse that contract rather than introducing a new graph operation.

Declare method-specific preparation defaults, enumerate packed DFlash2 round shapes, and pass the physical row capacity to the shared DFlash2 preparation and graph signature. Preserve rectangular MTP, upstream MTP-only graph selection and functional forwards, and the shared tensor-parallel embedding path. Extend the capacity, planning, and target-state tests, adapting the metadata test to the functional target interface. Existing cores retain their captured catalogs; a different positive draft depth requires export.

The packed catalog is intended to reduce target padding while retaining per-request proposal depth. No performance gain is established.

The prior revision had 433 targeted CPU checks passing and four CUDA checks skipped; TP2 observations used additional changes and cannot isolate this contribution. The rebased revision still requires CPU execution, CUDA compilation/replay and serving qualification.

Design-Signed-Off-By: ChatGPT (GPT-6); design-review=ed22
Signed-off-by: Codex <codex@openai.com>
Signed-off-by: vonP <thomas@picollin.fr>
Signed-off-by: ChatGPT <support@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: ChatGPT <support@openai.com>
@shadownetX
shadownetX force-pushed the perf/flash-next-packed-verification branch from 3dd086b to 8da334e Compare November 13, 2026 19:51
@shadownetX

Copy link
Copy Markdown
Contributor Author

Thanks for pointing out the merge conflicts.

The branch has been rebased onto c67cb2ad as a single commit (8da334ec). GitHub now confirms that the conflicts are resolved.

CPU validation of the previous rebase (3dd086bb on 97cfeb00):

Both runs exhibited the same three planning failures with identical errors. No additional CPU failures were observed.

Validation of the latest rebase remains pending. The PR remains draft, and no new GPU validation or performance gain is claimed.

@shadownetX

Copy link
Copy Markdown
Contributor Author

GB10 TP1 — Validation results

After spending most of the night exporting and benchmarking this change on my DGX Spark, I have to admit I'm disappointed. I expected packed verification to improve concurrent DFlash2 workloads, but the results are mixed.

Configuration: HyperFlare v0.1.0 with the exporter patch backported, Qwen3.8 Flash Next FP4 Local, TP1, DFlash2 7 drafts, MXFP8, adaptive alpha 0.5. Three repetitions across 8K/32K/64K contexts, COLD/WARM.

Both configurations completed 270/270 requests, with WARM cache reuse between 99.19% and 99.91%.

Performance

Per-request decode throughput, using geometric means of context-level median cohort averages:

Concurrency COLD change WARM change WARM aggregate change Faster WARM runs
1 +1.5% +2.3% +2.5% 5/9
2 −4.3% −8.2% −5.6% 0/9
4 −3.9% −5.9% −8.0% 3/9
8 +4.7% −6.1% −0.5% 4/9

The two-request WARM regression is particularly consistent, with all nine cohorts slower. Conversely, eight-request COLD workloads improved in eight of nine cohorts, reaching +12.1% at 64K.

Across the full benchmark, measured verification request rounds increased by 13.5%, while accepted drafts per round decreased from 1.86 to 1.78.

Memory and execution

Metric Baseline Packed
Loaded memory 76.80 GiB 77.90 GiB
KV capacity 1,597,440 1,507,328
Snapshot slots 137 129
Loaded kernels 7,290 14,147

The packed core costs an additional 1.10 GiB and reduces KV capacity by 5.6%.

Inspection confirmed 68 speculative graphs. Runtime counters recorded 54,743 width-eight speculative executions across all four batch sizes, although the counters do not distinguish individual packed physical capacities.

Conclusion

The implementation works, but I cannot justify enabling it by default on GB10 TP1 based on these measurements.

These are descriptive results from one A/B campaign on v0.1.0, with sampled outputs and slightly different memory conditions, rather than a definitive assessment on current main.

I'm leaving this PR in draft. I wish the results were better, but hopefully the data will help identify where packed verification can actually deliver a benefit.

@yatesdr

yatesdr commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Closing. Your GB10 TP1 measurements from 2026-11-15 settle it: packed verification was faster for eight cold concurrent requests (8 of 9 cohorts, up to +12.1% at 64K) but slower for two warm concurrent requests (-8.2%, all nine cohorts), and it costs 1.10 GiB of loaded memory and 5.6% of KV capacity on every deployment. That does not justify enabling it by default, and AGENTS.md does not allow carrying it as a configuration switch without a concrete requirement. Thanks for measuring it this thoroughly. If a version shows no regression at low concurrency, please reopen with that data.

@yatesdr yatesdr closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:kernels GPU kernels and numerical execution. area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request model:qwen3.8-flash-next Affected recipe or documented reproducer: qwen3.8-flash-next. Impact may be broader. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:validation Proposed implementation needs acceptance evidence; no claim that a reported defect is fixed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants