[NPU] Support Qwen3.8-Flash-Next graph mode and MTP - #37570
Draft
fishAndShrimp wants to merge 11 commits into
Draft
fishAndShrimp wants to merge 11 commits into
fishAndShrimp wants to merge 11 commits into
Conversation
- Route NPU QSA through Torch operators and shared indexer orchestration - Preserve fixed tensor shapes for graph capture and replay - Carry the live request-to-token mapping in graph metadata - Adapt NPU KV cache layouts and zero masked values before attention - Add coverage for dispatch, padding, slot mapping, and graph replay
Decompose depthwise convolution into slice, multiply and sum operations for NPU decode and target verify, avoiding the uncapturable aclop Conv2D. Adapt the convolution implementation from the qwen3d8fn branch of fishAndShrimp/sglang.
fishAndShrimp
force-pushed
the
pr-36601
branch
from
September 14, 2026 16:24
24adaec to
64b0532
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Enable Qwen3.8-Flash-Next inference on NPU with Qwen Sparse Attention (QSA), graph replay, and NEXTN/MTP speculative decoding. The implementation is now based on mainline, which includes the generic model support merged in #37500.
This PR remains a draft while NPU QSA performance optimization, resolution of conflicts with the latest
main, and final validation are in progress.Modifications
Accuracy Tests
Environment
64b0532544b9f784a5731b1c894d25347acc950b, attributed from the Git history and run timeline; the evaluation output does not embed a Git SHAResults
Evaluation completed on September 14, 2026, with
temperature=0.9,seed=3407,n=1, thinking enabled, and a maximum of 260,000 output tokens. All 198 unique questions have successful evaluation records. The interrupted run was resumed from 197 cached results to complete the remaining question; this is one completed evaluation, not multiple independent runs.The results above validate the current implementation. Earlier accuracy results from the previous branch are omitted because they were produced with a different upstream baseline and NPU speculative verification behavior.
Server command
Show environment and launch command
The paths below assume the installed NPU toolkit environment. Ports, device offset, and model/dataset paths are placeholders for reproduction. Existing environment variable names, toolkit paths, and backend option values retain their required spelling.
GPQA Diamond command
Show evaluation command
The following starts a fresh evaluation. The reported run used EvalScope's
--use-cacheoption when resuming its incomplete output directory.Speed Tests and Profiling
The QSA implementation currently uses Torch fallbacks. In local TP8 tests with eight concurrent requests and 512 output tokens per request, server steady-state decode throughput was approximately 48–50 tokens/s with non-greedy sampling. This is a workload-specific observation, not a general performance guarantee or the end-to-end throughput of the full GPQA evaluation.
The earlier branch forced NPU speculative target verification to use greedy decoding even for requests with nonzero temperature. The current upstream baseline supports non-greedy MTP sampling (#32495), so the previous branch's higher decode throughput is not a comparison under equivalent sampling semantics. Profiling identified full-vocabulary top-k/top-p probability filtering as a major source of the additional verification cost. Performance work should preserve the requested sampling semantics.
Checklist
mainand rerun relevant validation.