vllm_adapter
ModelOpt/AnyModel -> vLLM/AnyModel config adapter.
ModelOpt/AnyModel checkpoints describe per-layer overrides via a dense
block_configs list with nested attention / ffn sub-sections.
AnyModel in vLLM now consumes the HuggingFace heterogeneity schema: a sparse
per_layer_config dict mapping layer_idx -> {flat HF keys + optional
"skip" list}.
This module rewrites the Puzzletron schema in-place so vLLM only
ever sees per_layer_config. It is invoked from
AnyModelConfig.verify_and_update_model_config before the arch
convertor or layer-patching runs.
Functions
In-place: convert legacy |
- convert_block_configs_to_per_layer_config(hf_config)
In-place: convert legacy
block_configsonhf_configtoper_layer_configon its text config.Returns
Trueif a conversion happened,Falseif there was nothing to convert. Ifper_layer_configis already set, the legacy field is dropped and a warning emitted (the new schema wins).- Parameters:
hf_config (Any)
- Return type:
bool