support torch.compile for bailing moe (#21664)

This commit is contained in:
Jinzhen Lin 2025-07-27 07:54:32 +08:00 committed by GitHub
parent 6c66f28fa5
commit c657369841
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,7 @@ from torch import nn
from transformers.configuration_utils import PretrainedConfig
from vllm.attention import Attention
from vllm.compilation.decorators import support_torch_compile
from vllm.config import CacheConfig, VllmConfig
from vllm.distributed import (get_pp_group, get_tensor_model_parallel_rank,
get_tensor_model_parallel_world_size,
@ -291,6 +292,7 @@ class BailingMoeBlock(nn.Module):
return hidden_states, residual
@support_torch_compile
class BailingMoeModel(nn.Module):
def __init__(