DeepSeek weight sanitization + weights_expected_names
Load-time transforms so mlx-lm safetensors checkpoints become the tensors the MLA/MoE forward path expects.
Spec: doc/plans/engine-inference-core.md § E2
Part of: #105 (E2) · Epic: #56
Depends on: Family split + config fields (knows ranks/dims/expert counts)
Tasks
Tracking note
PR #62 added strict expected-tensor-set validation for qwen3. Non-qwen3 currently returns 0 (no strict set). Each DeepSeek family needs its own list; orphan-triplet sweep and norm-dtype check already apply globally.
DeepSeek weight sanitization +
weights_expected_namesLoad-time transforms so mlx-lm safetensors checkpoints become the tensors the MLA/MoE forward path expects.
Spec:
doc/plans/engine-inference-core.md§ E2Part of: #105 (E2) · Epic: #56
Depends on: Family split + config fields (knows ranks/dims/expert counts)
Tasks
weight_scale_inv)kv_b_proj->embed_q+unembed_outsplit (reshape[n_heads, qk_nope_head_dim + v_head_dim, kv_lora_rank], split, requantize)experts.N.gate/up/down_proj-> stackedswitch_mlp.gate/up/down_proj)wq_b,wk,weights_proj, ...)weights_expected_names()forMODEL_DEEPSEEK_V3/V32/V4(per-layer matmul suffixes, norms, family-specific tensors)Tracking note
PR #62 added strict expected-tensor-set validation for qwen3. Non-qwen3 currently returns 0 (no strict set). Each DeepSeek family needs its own list; orphan-triplet sweep and norm-dtype check already apply globally.