feat: support local paths for MTP config gathering and weight loading#49
Open
marzukia wants to merge 1 commit into
Open
feat: support local paths for MTP config gathering and weight loading#49marzukia wants to merge 1 commit into
marzukia wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two code paths assumed HF repo IDs and failed silently for local directories:
vllm_mlx/cli.py_gather_kv_cache_dtype_inputs— usedhuggingface_hub.try_to_load_from_cachewhich returns None for local paths. Now checksos.path.isdirfirst and reads config.json directly.vllm_mlx/spec_decode/mtp/qwen3_5_inject.py_load_mtp_weights_from_repo— usedsnapshot_downloadwhich raises for local paths. Now checksos.path.isdirfirst 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
--speculative-config {"method":"mtp","num_speculative_tokens":2}