Skip to content

perf(qwen-flash): accelerate prefill and MTP catch-up - #485

Merged
francescobozzo merged 1 commit into
mainfrom
perf/qwen-flash-long-prefill
Oct 9, 2026
Merged

francescobozzo merged 1 commit into
mainfrom
perf/qwen-flash-long-prefill

Conversation

@francescobozzo

Copy link
Copy Markdown
Collaborator

Flash-Next prefill was doing unnecessary activation writes, n-gram uploads and MTP hidden-state copies. This removes that work, improves GDN/expert/projection kernels, and uses the existing selector scratch more efficiently at long context. It also corrects MTP catch-up across the dense/sparse attention boundary. The optimized paths are the default, with no new switches or dependencies.

Production Nix, HTTP pp2048/tg128; previous published results versus the refreshed sweep:

Cached depth AR pp (tok/s) MTP pp (tok/s)
0 1644.68 → 1700.52 1560.11 → 1642.85
32K 1546.81 → 1585.98 1503.08 → 1541.35
128K 1446.10 → 1478.66 1408.06 → 1436.89

MTP pp includes predictor catch-up and takes the higher mixed/repetitive rate. Repetitive MTP reaches 60.39 tok/s for one user and 162.98 summed decode tok/s at C8. README, benchmark tables/charts and quality evidence are updated. Loading and reference-engine measurements retain their original provenance.

Validation:

  • 7,946,240 full-vocabulary logits after 32,640 prompt tokens remain byte-identical to main (KL 0), with independent operator checks.
  • All 24 depth-sweep completions retain output hashes and prompt/cache/draft counts. All 63 C1/2/4/6/8 requests match fresh AR outputs.
  • Real 1024×1024 image encoding, image/text batching, sampled replay, cancellation, and RAM/disk restoration pass. The disk test now checks the actual stable template frontier while retaining strict token equality and zero-prefill RAM retries.
  • Formatting, documentation and benchmark-render checks pass. Rebased onto latest main; Flash-Next source hashes still match the tested build.

The historical C2 repetitive result did not reproduce: 84.52 tok/s in this sweep, 84.46 on current main and 84.40 in a focused repeat. The original sweep result is retained. The existing independent upstream vision-parity gap remains unresolved; these changes do not introduce a new regression. Detailed controls and provenance are in docs/models/qwen3.8-flash-next/artifacts/prefill-long-context.json.

@francescobozzo
francescobozzo merged commit fd747a5 into main Oct 9, 2026
2 checks passed
@francescobozzo
francescobozzo deleted the perf/qwen-flash-long-prefill branch October 9, 2026 00:26
Chiakai-Chang pushed a commit to Chiakai-Chang/gufo that referenced this pull request Oct 10, 2026
…-org#485)

# Conflicts:
#	src/cli/serve/continuation_cache.cpp
#	src/cli/serve/http_server.cpp
#	src/cli/serve/openai_chat.cpp
#	src/models/qwen/chat_template.cpp
#	src/models/qwen38_flash_next/engine.cpp
#	src/models/qwen38_flash_next/kernels/rocm/executor.cpp
#	src/models/qwen38_flash_next/kernels/rocm/executor.hpp
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