Skip to content

fix: correct AFMoE no-ID prefill contract - #2301

Merged
inureyes merged 6 commits into
mainfrom
fix/issue-2289-afmoe-chunk-contract
Oct 14, 2026
Merged

inureyes merged 6 commits into
mainfrom
fix/issue-2289-afmoe-chunk-contract

Conversation

@inureyes

@inureyes inureyes commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Opt AFMoE out of token-ID chunked prefill because each multi-token no-ID forward starts an independent prompt and replaces the model-owned cache set. Add a loaded six-layer regression covering four rotating sliding-attention caches and two standard full-attention caches. Independent prompts reset every cache; stable sequence-ID chunks advance them continuously.

Integrate main a2698835, including MLX 243bdf09 and mlxcelverse, without source conflicts. The rebuilt CUDA test-fast binary passes all 29 AFMoE tests, including loaded-model lifecycle and snapshot coverage. CUDA Clippy with warnings denied, formatting, and diff checks pass. Earlier shared integration checks passed 123 Python tests and 49 WebUI fixtures; bilingual reports preserve their provenance and record the fresh pin revalidation.

Review found no remaining blocking correctness, security, or performance issue. DirectEngine's stable-ID state behavior remains intact, but the global capability makes every honoring caller use whole-prompt prefill, which may require more transient memory for long prompts. Tests use loaded synthetic weights, not an external checkpoint.

Closes #2289

Disable token-ID chunked prefill because independent multi-token forwards without a sequence ID reset the model-owned sliding and full-attention KV caches. Document the whole-prompt memory tradeoff for all callers, including DirectEngine.

Add a real six-layer loaded-model regression with deterministic nonzero weights that forces evaluation and checks every cache resets for a new no-ID prompt while stable-ID continuation retains all token positions.

Refs #2289
Include the merged Qwen3 Next prefill contract before validating the AFMoE follow-up against the current default branch. The reviewed AFMoE source and regression remain unchanged.
@inureyes inureyes added status:review Under review type:bug Bug fixes, error corrections, or issue resolutions priority:medium Medium priority area:models Model architectures, weights, loading, metadata area:inference Generation, sampling, decoding (incl. speculative, DRY) labels Oct 13, 2026
Merge current main through the mlxcelverse migration and revalidate mixed sliding/full attention state on MLX 243bdf09. All 29 focused CUDA tests pass, including loaded cache lifecycle and snapshots. CUDA Clippy with warnings denied, formatting, and diff checks pass.

Refs #2289
@inureyes
inureyes merged commit cb73c7d into main Oct 14, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:inference Generation, sampling, decoding (incl. speculative, DRY) area:models Model architectures, weights, loading, metadata priority:medium Medium priority status:review Under review type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(afmoe): correct the no-ID chunked prefill contract

1 participant