Dense layer

xnx_n [B, T, 7168], RR [T, 32], MM [T, T]to xn+1x_{n+1} [B, T, 7168]

Parameters597,442,816 × 3 layers

597,442,816 parameters per dense layer, across its learned components

ComponentParameters
Attention RMSNorm7,168
Sparse latent attention201,066,752
MLP RMSNorm7,168
SwiGLU MLP396,361,728
Per-instance total597,442,816

One of 3 independent dense layers.

Weights · one layer, by sublayer

Dense layer · FP8571.1 MiB
Attention · FP8193.1 MiB
MLP · FP8378 MiB
Two RMSNorms · float3256 KiB

Attention 33.7% and the MLP 66.3% of the layer’s parameters; the two RMSNorms hold 14,336.

config_671B_v3.2.json 4, 8, 17, 21model.py 826–829, 844–851, 876, 183–187, 284, 317–318, 449
Sources

In codeBlock(layer_id, args)

Open pinned code ↗

Direct evidence

A layer applies attention-norm, MLA, ffn-norm and the FFN; the first n_dense_layers layers use the dense MLP, the rest MoE. Residual additions happen inside the next normalization.

model.py 826–851 ↗ · deepseek-ai/DeepSeek-V3.2 @ a7e62ac04ecb

Excerpt
        self.attn = MLA(args)
        self.ffn = MLP(args.dim, args.inter_dim) if layer_id < args.n_dense_layers else MoE(args)
        self.attn_norm = RMSNorm(args.dim)
        self.ffn_norm = RMSNorm(args.dim)

… lines 830–843 omitted …

        if residual is None:
            x, residual = self.attn_norm(x), x
        else:
            x, residual = self.attn_norm(x, residual)
        x = self.attn(x, start_pos, freqs_cis, mask)
        x, residual = self.ffn_norm(x, residual)
        x = self.ffn(x)
        return x, residual