feat(models): add Qwen3.8 Flash Next support - #226
Open
mrcolo wants to merge 3 commits into
Open
Conversation
Implement native Qwen4-Exp execution with PLE, dense QSA, hyper-connections, and block-FP8 expert offload. Extend expert-copy row handling and preserve in-flight PLE history so the official checkpoint serves correctly with overlap decoding on one GPU. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add NVFP4 expert loading and graph-safe PLE inputs while keeping top-k=10 on the fused router. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 28, 2026
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.
feat(models): add Qwen3.8 Flash Next support
Summary
Adds native single-GPU offload serving for the official
Qwen/Qwen3.8-Flash-Next-FP8checkpoint (Qwen4ExpForConditionalGeneration). The implementation covers Qwen4-Exp execution, host-resident PLE and routed experts, checkpoint loading, overlap-safe decoding, and OpenAI-compatible parser selection.What's included
FREETOKEN_QWEN4_PLE_PRELOAD=1copies PLE shards into host RAM to avoid mmap page-fault latency on hosts with sufficient memory.qwen3_codertool-call parser selection.Context support
The checkpoint natively advertises 262,144 tokens. This integration intentionally caps total sequence length at 2,048 tokens because sparse QSA beyond that point is not implemented. Within the first 2,048 tokens, dense causal attention is exactly equivalent to the checkpoint's QSA selection budget.
Run command
Resource profile
Validation
FREETOKEN_ALLOW_CUDA_MISMATCH=1 uv run pytest -q tests/models/test_qwen4_exp.py tests/models/test_qwen4_exp_raw_config.py tests/kernels/test_pinned_tensor.py tests/server/test_parser_auto_selection.py tests/engine/test_attention_backend_matrix.py— 87 passed, 8 CUDA-only tests skipped on the local host.A6000_OK, exercising overlap decode beyond the first token.Scope
No Dockerfiles, deployment manifests, credentials, or cluster-specific packaging are included.