Skip to content

vllm.model_executor.layers.rotary_embedding.rocm_aiter_rope_ops

is_rocm_rotary_embedding_enabled

is_rocm_rotary_embedding_enabled() -> bool
Source code in vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py
def is_rocm_rotary_embedding_enabled() -> bool:
    return (current_platform.is_rocm() and envs.VLLM_ROCM_USE_AITER)

rocm_aiter_rotary_emb_with_key_forward_hip_fake

rocm_aiter_rotary_emb_with_key_forward_hip_fake(
    positions: Tensor,
    sin: Tensor,
    cos: Tensor,
    query: Tensor,
    key: Tensor,
    offsets: Optional[Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None
Source code in vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py
def rocm_aiter_rotary_emb_with_key_forward_hip_fake(
    positions: torch.Tensor,
    sin: torch.Tensor,
    cos: torch.Tensor,
    query: torch.Tensor,
    key: torch.Tensor,
    offsets: Optional[torch.Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None:
    pass

rocm_aiter_rotary_emb_with_key_forward_hip_impl

rocm_aiter_rotary_emb_with_key_forward_hip_impl(
    positions: Tensor,
    sin: Tensor,
    cos: Tensor,
    query: Tensor,
    key: Tensor,
    offsets: Optional[Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None
Source code in vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py
def rocm_aiter_rotary_emb_with_key_forward_hip_impl(
    positions: torch.Tensor,
    sin: torch.Tensor,
    cos: torch.Tensor,
    query: torch.Tensor,
    key: torch.Tensor,
    offsets: Optional[torch.Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None:
    import aiter as ops
    if offsets is None:
        ops.rope_cached_positions_2c_fwd_inplace(
            query,
            key,
            cos,
            sin,
            positions,
            rotate_style,
            reuse_freqs_front_part=True,
            nope_first=is_nope_first,
        )
    else:
        ops.rope_cached_positions_offsets_2c_fwd_inplace(
            query,
            key,
            cos,
            sin,
            positions,
            offsets,
            rotate_style,
            reuse_freqs_front_part=True,
            nope_first=is_nope_first,
        )

rocm_aiter_rotary_emb_without_key_forward_hip_fake

rocm_aiter_rotary_emb_without_key_forward_hip_fake(
    positions: Tensor,
    sin: Tensor,
    cos: Tensor,
    query: Tensor,
    offsets: Optional[Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None
Source code in vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py
def rocm_aiter_rotary_emb_without_key_forward_hip_fake(
    positions: torch.Tensor,
    sin: torch.Tensor,
    cos: torch.Tensor,
    query: torch.Tensor,
    offsets: Optional[torch.Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None:
    pass

rocm_aiter_rotary_emb_without_key_forward_hip_impl

rocm_aiter_rotary_emb_without_key_forward_hip_impl(
    positions: Tensor,
    sin: Tensor,
    cos: Tensor,
    query: Tensor,
    offsets: Optional[Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None
Source code in vllm/model_executor/layers/rotary_embedding/rocm_aiter_rope_ops.py
def rocm_aiter_rotary_emb_without_key_forward_hip_impl(
    positions: torch.Tensor,
    sin: torch.Tensor,
    cos: torch.Tensor,
    query: torch.Tensor,
    offsets: Optional[torch.Tensor] = None,
    rotate_style: int = 0,
    is_nope_first: bool = False,
) -> None:
    import aiter as ops
    if offsets is None:
        ops.rope_cached_positions_fwd_inplace(
            query,
            cos,
            sin,
            positions,
            rotate_style,
            reuse_freqs_front_part=True,
            nope_first=is_nope_first,
        )
    else:
        ops.rope_cached_positions_offsets_fwd_inplace(
            query,
            cos,
            sin,
            positions,
            offsets,
            rotate_style,
            reuse_freqs_front_part=True,
            nope_first=is_nope_first,
        )