Replace nn.ConvNd with vLLM's ConvNdLayer for Transformers modeling backend (#31498)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-12-29 16:20:01 +00:00
committed by GitHub
parent b5d2d71d26
commit e37e7349e6
2 changed files with 43 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ from vllm.model_executor.models.transformers.utils import (
get_feature_request_tip,
init_on_device_without_buffers,
log_replacement,
replace_conv_class,
replace_linear_class,
replace_rms_norm_class,
)
@@ -314,6 +315,8 @@ class Base(
new_module = replace_linear_class(
child_module, style, self.quant_config, prefix=qual_name
)
elif isinstance(child_module, (nn.Conv2d, nn.Conv3d)):
new_module = replace_conv_class(child_module)
elif child_module.__class__.__name__.endswith("RMSNorm"):
new_module = replace_rms_norm_class(
child_module, self.text_config.hidden_size