Routed expert

Gate projection

×

Map 7,168 input features to 2,048 gate features.

g=xffnW1{\htmlData{light=g gate}{g}}={\htmlData{light=x}{x_{\mathrm{ffn}}}}W_{1}
in
xffnx_{\mathrm{ffn}} [B batch, T positions, 7168 d]
out
gg [B batch, T positions, 2048 expert d_ff]
Parameters14,680,064 × 23,040 experts

14,680,064 parameters per instance.

ComponentCalculationParameters
Weight matrix7,168 × 2,04814,680,064

This projection has no bias parameter.

The reference module holds the weight output by input, [out, in].

One in each of 23,040 experts: 384 in each of 60 MoE layers.

Sources

In codeself.gate_proj(x)

Open pinned code ↗

Direct evidence

Each routed expert is its own SwiGLU MLP of moe_intermediate_size hidden features.

modeling_deepseek.py 503–523 ↗ · moonshotai/Kimi-K2.6 @ 7eb5002f6aad

Excerpt
        if hasattr(config, "ep_size") and config.ep_size > 1:
            assert config.ep_size == dist.get_world_size()
            self.ep_size = config.ep_size
            self.experts_per_rank = config.n_routed_experts // config.ep_size
            self.ep_rank = dist.get_rank()
            self.experts = nn.ModuleList([
                (DeepseekV3MLP(config,
                               intermediate_size=config.moe_intermediate_size)
                 if i >= self.ep_rank * self.experts_per_rank
                 and i < (self.ep_rank + 1) * self.experts_per_rank else None)
                for i in range(config.n_routed_experts)
            ])
        else:
            self.ep_size = 1
            self.experts_per_rank = config.n_routed_experts
            self.ep_rank = 0
            self.experts = nn.ModuleList([
                DeepseekV3MLP(config,
                              intermediate_size=config.moe_intermediate_size)
                for i in range(config.n_routed_experts)
            ])

The checkpoint stores the routed experts’ linear weights as 4-bit integers (compressed-tensors, pack-quantized), symmetric, with one scale per group of 32 weights; attention, the shared experts, the dense MLP, the output head, the vision tower and the projector are left out of quantization.

config.json 95–129 ↗ · moonshotai/Kimi-K2.6 @ 7eb5002f6aad

Excerpt
    "quantization_config": {
      "config_groups": {
        "group_0": {
          "input_activations": null,
          "output_activations": null,
          "targets": [
            "Linear"
          ],
          "weights": {
            "actorder": null,
            "block_structure": null,
            "dynamic": false,
            "group_size": 32,
            "num_bits": 4,
            "observer": "minmax",
            "observer_kwargs": {},
            "strategy": "group",
            "symmetric": true,
            "type": "int"
          }
        }
      },
      "format": "pack-quantized",
      "ignore": [
        "re:.*self_attn.*",
        "re:.*shared_experts.*",
        "re:.*mlp\\.(gate|up|gate_up|down)_proj.*",
        "re:.*lm_head.*",
        "re:vision_tower.*",
        "re:mm_projector.*"
      ],
      "kv_cache_scheme": null,
      "quant_method": "compressed-tensors",
      "quantization_status": "compressed"
    },