feat(models): add native Qwen3.8 Flash Next - #3434
Open
S1ro1 wants to merge 27 commits into
Open
Conversation
S1ro1
force-pushed
the
feat/qwen3-8-flash-next
branch
from
August 31, 2026 03:10
3ef1f62 to
adbd3c3
Compare
S1ro1
marked this pull request as ready for review
August 31, 2026 03:12
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit adbd3c3. Configure here.
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.

Summary
prime-kernelswith GQA, sentinel padding, context parallelism, compile, and selective activation checkpointing support.dp_shard_cpat runtime. Lookups exchange token IDs and embeddings over a dedicated NCCL group; weights are never communicated during forward or backward.This PR is stacked on #3429. It depends on PrimeIntellect-ai/prime-kernels#8 and pins the implementation from vllm-project/vllm#53896.
Runtime contract
model.impl = "custom"selects the Prime model forqwen4_expandqwen4_exp_textconfigurations.gate_proj,up_proj, anddown_projruntime layout with a sigmoid shared-expert output gate.ple_embedding.ngram_embedding.weight. DCP loads the correct local DTensor shard; there is no sharding-aware checkpoint format or loader.Validation
uv lock --check, andgit diff --checkpassed.CUDA_HOMEremoved..prime-v1checkpoint loaded through DCP into the head-sharded DTensor parameter without checkpoint-specific loading logic.i3_math, SignSGD, compile, selective activation checkpointing, eight-way expert parallelism, NIXL updates, and the real checkpoint.Mean:
0.001777435. Minimum:0.001496617. Maximum:0.002259263. Final:0.001593116; there is no rising trend.Stack maintained with GitHub Stacks CLI • Give Feedback 💬
Note
High Risk
Large new model stack plus vLLM git pin, distributed embedding offload, and NIXL/inference weight-loading changes affect training–inference parity and multi-node RL updates.
Overview
Adds a Prime-owned Qwen3.8 Flash Next (
qwen4_exp) trainer: hyper-connection residual streams, Gated DeltaNet / indexed sparse attention (prime_kernels.indexed_attention), position-learning enhancement with hashed N-gram tables, and shared sigmoid-output-gated MoE (also refactors Qwen3.5 MoE to the same building blocks). Checkpoint conversion merges sharded PLE N-gram weights into one runtime table.Distributed training for huge PLE tables: new
HeadShardedEmbeddingshards rows ondp_shard_cp, stays outside FSDP sharding, and optionalngram_embedding_cpu_offloadkeeps weights in pinned CPU with prefetch; optimizer CPU offload, grad clipping, and Gloo setup are extended for mixed GPU/CPU-sharded parameters.Inference / RL weight path: pins vLLM on x86_64 to git
c855760with precompiled cu130 wheels; updates API server hooks tovllm.entrypoints.launchers.*; replaces the custom fp32 lm_head monkey-patch with nativehf_overrides["head_dtype"]="float32"; adds a vLLM patch for Qwen4 PLE checkpoint shard loading. NIXL lazy weights now tracetorch.catviaConcatenatedLazyWeightfor concatenated checkpoint sources.Docs/skills note
indexed_attention, Python-only kernels, andUV_NO_SYNCfor concurrent SLURMuv runfrom one worktree.Reviewed by Cursor Bugbot for commit 410151b. Bugbot is set up for automated code reviews on this repo. Configure here.