cloudyu commited on
Commit
1ba9c13
·
verified ·
1 Parent(s): c7e88d7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +38 -1
README.md CHANGED
@@ -24,6 +24,43 @@ The original `num_experts_per_tok=6` is **not a power of 2**. In practice, this
24
 
25
  Setting top_k to 4 (a power of 2) gives the GPU's SIMT architecture a natural alignment for expert dispatch and attention masking, while activating **33% fewer parameters per token** with **no accuracy degradation** — and in many reasoning-heavy tasks, a measurable accuracy improvement.
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ## Evaluation Results
28
 
29
  ### MMLU-Pro (chat mode, max_tokens=20)
@@ -81,7 +118,7 @@ Set `num_experts_per_tok=4` in `config.json`:
81
  |----------|-------|
82
  | Architecture | DeepSeekV4ForCausalLM (MoE) |
83
  | Total Parameters | 284B |
84
- | Activated Parameters | ~13B (top_k=4) |
85
  | Expert Precision | FP4 (MXFP4) |
86
  | Other Parameters | FP8 |
87
  | Context Length | 1,048,576 tokens |
 
24
 
25
  Setting top_k to 4 (a power of 2) gives the GPU's SIMT architecture a natural alignment for expert dispatch and attention masking, while activating **33% fewer parameters per token** with **no accuracy degradation** — and in many reasoning-heavy tasks, a measurable accuracy improvement.
26
 
27
+ ## Key Changes from the Original
28
+
29
+ | Configuration | Original (top_k=6) | This Model (top_k=4) |
30
+ |---------------|-------------------|---------------------|
31
+ | `num_experts_per_tok` | 6 | **4** |
32
+ | Activated params per token | ~13B | **~11B** |
33
+ | Total params | 284B | 284B |
34
+ | Routing method | noaux_tc | noaux_tc |
35
+ | All other weights | identical | identical |
36
+
37
+ ## Performance Analysis
38
+
39
+ ### Activated Parameters
40
+
41
+ The DeepSeek-V4-Flash architecture has 284B total parameters, of which ~13B are activated per token at `top_k=6`. By switching to `top_k=4`, activated parameters drop to **~11B** — a **15% reduction** — because each token routes to only 4 out of 256 routed experts instead of 6, while shared experts and attention parameters remain unchanged.
42
+
43
+ ### Inference Speed
44
+
45
+ | Benchmark | top_k=4 | top_k=6 | Speedup |
46
+ |-----------|---------|---------|---------|
47
+ | MMLU-Pro (12,032 questions) | 73.0 s | 89.0 s | **+18.0%** |
48
+ | HumanEval (164 problems) | 55.8 s | 64.1 s | **+14.9%** |
49
+ | Per-token generation | ~0.34 s | ~0.39 s | **+12.8%** |
50
+
51
+ The speedup comes from: (a) fewer expert feed-forward computations, (b) better GPU warp utilization with power-of-2 routing, and (c) reduced softmax and gather/scatter overhead in the router.
52
+
53
+ ### Accuracy Impact
54
+
55
+ | Benchmark | top_k=4 | top_k=6 | Δ |
56
+ |-----------|---------|---------|---|
57
+ | MMLU-Pro | **42.30%** | 39.27% | **+3.03%** |
58
+ | HumanEval | 94.51% | **95.73%** | −1.22% |
59
+
60
+ On **MMLU-Pro**, top_k=4 significantly outperforms top_k=6 (+3.03%), suggesting that routing to fewer, more confidently selected experts improves factual retrieval. On **HumanEval**, top_k=6 retains a narrow edge (+1.22%), indicating code generation benefits from broader expert diversity.
61
+
62
+ **Overall**: top_k=4 delivers superior throughput with competitive or better accuracy on knowledge-heavy tasks, making it the recommended default.
63
+
64
  ## Evaluation Results
65
 
66
  ### MMLU-Pro (chat mode, max_tokens=20)
 
118
  |----------|-------|
119
  | Architecture | DeepSeekV4ForCausalLM (MoE) |
120
  | Total Parameters | 284B |
121
+ | Activated Parameters | ~11B (top_k=4) |
122
  | Expert Precision | FP4 (MXFP4) |
123
  | Other Parameters | FP8 |
124
  | Context Length | 1,048,576 tokens |