mirror of
https://github.com/deepseek-ai/DeepInfer.git
synced 2026-10-31 00:36:20 +08:00
The fp4 expert GEMMs dequantize the whole weight to bf16 in HBM on every call (device profile: the MoE graph reads 756 MB a layer), and a rank computes all 6 of its experts while a 6-row step routes to about one. fp4_linear_2core_gated takes a per-expert flag (any row routed to it) and runs the dequant and GEMM in an nl.fori_loop bounded by it, so an unrouted expert costs a zero fill. Decode sizes only (<= 16 rows); prompt chunks route to every expert anyway. bench70 (vllm-sonnet 512, TP=64, nextn=5): TPOT 258.9 -> 248.4 ms, step 738 -> 711 ms, tokens per step identical. Tiny cp=2 nextn=5 on device: 9/9 golden tokens, drafts unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| blockquant.py | ||
| compress_pool.py | ||
| hc_attn_out.py | ||
| hc_collapse.py | ||
| hc_expand.py | ||
| hc_mixes.py | ||
| index_score.py | ||
| rmsnorm.py | ||
| sparse_attn.py | ||
| swiglu.py | ||