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

Signed-off-by: youkaichao <youkaichao@gmail.com>
Co-authored-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
Yongzao
2024-10-24 15:54:57 +08:00
committed by GitHub
parent 4fdc581f9e
commit 8a02cd045a
7 changed files with 13 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ from torch import nn
from transformers import OlmoConfig
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
from vllm.model_executor.layers.activation import SiluAndMul
@@ -221,6 +222,7 @@ class OlmoDecoderLayer(nn.Module):
return hidden_states
@support_torch_compile
class OlmoModel(nn.Module):
def __init__(self,