vllm.model_executor.layers.rotary_embedding.base
¶
Rotary Positional Embeddings Base Class.
Classes:
-
RotaryEmbedding– -
RotaryEmbeddingBase–Original rotary positional embedding.
RotaryEmbedding
¶
Bases: RotaryEmbeddingBase
Methods:
-
forward_native–A PyTorch-native implementation of forward().
-
forward_static–A PyTorch-native implementation of forward().
RotaryEmbeddingBase
¶
Bases: CustomOp
Original rotary positional embedding.
Attributes:
-
rope_is_inplace(bool) –Whether the custom-op forward rotates query/key in place, also under
rope_is_inplace = True
class-attribute
instance-attribute
¶
Whether the custom-op forward rotates query/key in place, also under torch.compile (forward_native is out-of-place for every subclass).
_compute_cos_sin_cache()
¶
Compute the cos and sin cache.
_compute_inv_freq(base)
¶
Compute the inverse frequency.