[torch.compile] Adding torch compile annotations to some models (#9876)

Signed-off-by: youkaichao <youkaichao@gmail.com>
Co-authored-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
Yongzao
2024-11-01 15:25:47 +08:00
committed by GitHub
parent 93a76dd21d
commit 2b5bf20988
7 changed files with 12 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ from torch import nn
from transformers import PretrainedConfig
from vllm.attention import Attention, AttentionMetadata
from vllm.compilation.decorators import support_torch_compile
from vllm.config import CacheConfig
from vllm.distributed import (get_pp_group,
get_tensor_model_parallel_world_size,
@@ -312,6 +313,7 @@ class Qwen2MoeDecoderLayer(nn.Module):
return hidden_states, residual
@support_torch_compile
class Qwen2MoeModel(nn.Module):
def __init__(