Expand description
2026-09-25: The tensor contract of one GLM-5.3 DSA block: the 14 self_attn tensors
dsa_tensor_specs lists, their dtype and unsharded shape, and a verifier.
Owner: model-arch (GLM-5.3 DSA). Invariants:
verify_dsa_blockreturnsOkonly when every spec tensor is present with the spec’s dtype, shape and BF16 byte length, and the source holds no otherself_attn.*tensor.
It uses the tensor types of crate::glm5next_kda::binding. Shapes are computed from
Glm5NextDsaConfig.
§What the table catches
indexer.k_normis a LayerNorm with a bias, and the bias is a spec entry, so a checkpoint without it fails the bind.index_kpool_compress_apeis[index_kpool, index_head_dim], indexed by pool slot.q_b_projhasqk_head_dimrows per head andkv_b_projhasqk_nope_head_dim + v_head_dim(256 and 512 on GLM-5.3). Both are[heads * w, lora], so only the shape check tells a swapped width apart.- NoPE:
kv_a_proj_with_mqahaskv_cache_dim()rows, which iskv_lora_rank(512), not 512 + a rope section.
Structs§
- DsaBind
Report - 2026-09-25: What a successful bind saw.
- DsaSpec
- 2026-09-25: One expected tensor: layer-relative name, dtype, and full (unsharded) shape.
Functions§
- dsa_
tensor_ specs - 2026-09-25: Every
self_attntensor a DSA block has, and the only ones it may have.full_headsis the unsharded head count: shapes are checked against the full tensors, whichbuild::build_dsa_weightsshards afterwards. - verify_
dsa_ block - 2026-09-25: Verify one DSA block against the spec table.