Skip to content

feat: support local paths for MTP config gathering and weight loading#49

Open
marzukia wants to merge 1 commit into
mainfrom
feat/local-path-mtp-support
Open

feat: support local paths for MTP config gathering and weight loading#49
marzukia wants to merge 1 commit into
mainfrom
feat/local-path-mtp-support

Conversation

@marzukia

Copy link
Copy Markdown
Owner

What

Two code paths assumed HF repo IDs and failed silently for local directories:

  1. vllm_mlx/cli.py _gather_kv_cache_dtype_inputs — used huggingface_hub.try_to_load_from_cache which returns None for local paths. Now checks os.path.isdir first and reads config.json directly.

  2. vllm_mlx/spec_decode/mtp/qwen3_5_inject.py _load_mtp_weights_from_repo — used snapshot_download which raises for local paths. Now checks os.path.isdir first and reads safetensors directly.

Why

When serving a local model with --speculative-config {"method":"mtp"}, the MTP eligibility gate and weight loader both failed because they could not read config.json or load MTP weights from a local directory path. This blocked MTP speculative decoding for any locally-quantized or custom model.

Tested

  • Qwen3.6-27B-RYS-XL-MTP-8bit (72-layer RYS model with embedded MTP weights)
  • marzuki-helium (M3 Mac Studio 96GB)
  • MTP speculative decoding enabled: --speculative-config {"method":"mtp","num_speculative_tokens":2}

Two code paths assumed HF repo IDs and failed silently for local
directories:

1. _gather_kv_cache_dtype_inputs (cli.py) — used
   huggingface_hub.try_to_load_from_cache which returns None for
   local paths. Now checks os.path.isdir first and reads config.json
   directly.

2. _load_mtp_weights_from_repo (qwen3_5_inject.py) — used
   snapshot_download which raises for local paths. Now checks
   os.path.isdir first and reads safetensors directly.

Both changes are backward-compatible: HF repo IDs still work via the
original code paths. Local paths are only used when the model is a
directory on disk.

Tested with Qwen3.6-27B-RYS-XL-MTP-8bit (72-layer RYS model with
embedded MTP weights) on marzuki-helium (M3 Mac Studio 96GB).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant