config declares num_nextn_predict_layers=1 but MTP draft tensors were dropped (disables speculative decoding)

#4
by WillMitchell - opened

While benchmarking this quant on a 512GB M3 Ultra we found an inconsistency worth flagging:

  • config.json declares "num_nextn_predict_layers": 1 (the GLM-5.2 MTP draft layer)
  • but model.safetensors.index.json contains zero tensors for that layer (no model.layers.78.*, no nextn/mtp/eh_proj/shared_head keys)

So the MTP block was dropped during conversion while the config still advertises it. Consequences:

  1. Runtimes that implement GLM-5.2 Lightning MTP / native speculative decoding (e.g. oMLX 0.5.0) cannot use it with this quant, silently, since the config says the layer exists.
  2. Loaders that trust the config may probe for weights that are not there.

For context, we surveyed all 29 GLM-5.2 MLX conversions on the Hub: 25 drop the MTP tensors the same way (this repo, GLM-5.2-4bit, GLM-5.2-mxfp4, the pipenetwork and inferencerlabs conversions); only 4 keep them (Jundot/GLM-5.2-oQ4e-mtp, the avlp12 Alis-MLX-Dynamic series). The MTP layer is a full transformer block (~791 tensors incl. 256 experts), so keeping it costs real size, dropping it is a legitimate choice, but then the config should say so.

Suggested fix, either:

  • set "num_nextn_predict_layers": 0 in config.json (as Jundot/GLM-5.2-oQ4 does explicitly for its non-MTP variant), or
  • re-convert including the MTP block for those who want speculative decoding.

Otherwise this quant measured very well for us: correctness parity with unsloth UD-Q4_K_M GGUF across a 29-sample agentic eval suite (every completed sample passed), and ~845 tok/s prefill on oMLX 0.5.0 with the native DSA kernels. Happy to share more data if useful.

MLX Community org

@WillMitchell Hi Will. Thank you for this valuable information and the feedback.

I've set "num_nextn_predict_layers": 0 in config.json for now. This is the quickest way to fix the problem.

The best is for me to re-convert and include the MTP block to allow for speculative decoding.

Happy to share more data if useful.

Always keen to learn, so please share more! 😊

@pcuenq Hi Pedro. Good feedback here for improving our MLX quants for GLM-5.2 and PR #1410

Sign up or log in to comment