feat: 支持 DeepSeek V4 Flash 推理 - #24
Draft
kuma-loong wants to merge 35 commits into
Draft
Conversation
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.
Important
本 PR 依赖 #23,请先合并 #23。本分支基于 #23 的最新提交
187c69b开发;在 #23 合并前,本 PR 的 Files changed 会同时包含其提交。变更内容
TP=1、DP=EP,attention 按 DP owner 分片,MoE 在重叠 EP group 中执行 all-gather、local expert 和 reduce-scatter。架构对齐
实现遵循 #23 引入的新架构:
ModelSpec声明模型类、cache manager、并行模式和 tiny-random 策略;models/checkpoint.py集中校验模型结构和 FP8/MXFP4 格式;RuntimeLayout统一描述 CSA/HCA 的 43 层 cache 布局;ParallelTopology.DPA_EP负责 world size、rank mapping 和通信 group;(model_type, parallel_mode)注册;model_runner.py只保留运行期 owner 分片、shape 补齐、logits 重排和 CUDA Graph 约束。首版支持边界
TP=1且DP=EP。验证
140 passed, 1 skipped1357 passed, 138 skipped, 205 subtests passedDeepseekV4ForCausalLM、DeepseekV4CacheManager、DPA_EP、43 层 cache,以及正式 FP8/MXFP4 量化配置DP=EP=2双 H100 推理:48/48 shard 加载完成,CUDA Graph capture/replay 成功,生成 token[294, 201]35.43 s,decode P5052.31 ms/19.12 tok/s,每 rank 常驻约76.78 GiBgit diff --check codex/qwen36-moe-sparse-methods..HEAD正式 GPU 数据采集于架构 rebase 之前;rebase 收尾时物理 GPU 4–7 均被其他任务占用,遵循设备隔离要求未抢占重跑。rebase 后已完成专项测试、全仓 CPU 测试和真实 checkpoint 配置链验证,文档中已明确区分两组证据。