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

This commit is contained in:
Yongzao
2024-10-24 01:07:48 +08:00
committed by GitHub
parent fd0e2cfdb2
commit 9013e24f7b
6 changed files with 12 additions and 0 deletions

View File

@@ -26,6 +26,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, LoRAConfig
from vllm.distributed import (get_pp_group, get_tensor_model_parallel_rank,
get_tensor_model_parallel_world_size)
@@ -250,6 +251,7 @@ class BaiChuanDecoderLayer(nn.Module):
return hidden_states, residual
@support_torch_compile
class BaiChuanModel(nn.Module):
def __init__(self,