[CI] Bump Transformers version to 5.18.0 (#59621)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-10-04 00:42:35 +00:00
committed by GitHub
parent 84bcbc6264
commit 9e0b6fcf77
22 changed files with 104 additions and 201 deletions
@@ -20,7 +20,6 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
VocabParallelEmbedding,
)
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.model_executor.models.longcat_flash import FlashConfig
from vllm.sequence import IntermediateTensors
from .deepseek_v2 import DeepseekV2DecoderLayer
@@ -80,9 +79,9 @@ class LongCatMultiTokenPredictor(nn.Module):
prefix: str = "",
):
super().__init__()
config = FlashConfig(**vllm_config.model_config.hf_config.__dict__)
vllm_config.model_config.hf_config.intermediate_size = config.intermediate_size
self.mtp_start_layer_idx = config.num_hidden_layers * 2
config = vllm_config.model_config.hf_config
# TODO: Use `num_hidden_layers` once Transformers 5.18.0 is the minimum
self.mtp_start_layer_idx = config.num_layers * 2
self.num_mtp_layers = 1
self.layers = torch.nn.ModuleDict(
{
@@ -130,7 +129,7 @@ class LongCatFlashMTP(nn.Module):
# builds a dense MLP. object.__setattr__ bypasses the ngram remote
# config's strict validation (it rejects setting the int field to None).
object.__setattr__(vllm_config.model_config.hf_config, "n_routed_experts", None)
self.config = FlashConfig(**vllm_config.model_config.hf_config.__dict__)
self.config = vllm_config.model_config.hf_config
self.quant_config = (
None
if "mtp" in getattr(self.config, "disable_quant_module", [])
@@ -264,7 +263,7 @@ class LongCatFlashMTP(nn.Module):
weight_loader = getattr(param, "weight_loader", default_weight_loader)
weight_loader(param, loaded_weight)
loaded_params.add(name)
spec_layer_id = self.config.num_hidden_layers * 2
spec_layer_id = self.model.mtp_start_layer_idx
self_attn = self.model.layers[str(spec_layer_id)].mtp_block.self_attn
if (
self.quant_config is not None
@@ -356,5 +355,5 @@ class LongCatFlashMTP(nn.Module):
self, config: PreTrainedConfig, weight_name: str
) -> int | None:
if "model.mtp" in weight_name:
return config.num_hidden_layers * 2
return self.model.mtp_start_layer_idx
return None