[1/2] Add rope kernel in sgl-kernel (#14334)

This commit is contained in:
Qiaolin Yu
2025-12-04 00:45:44 -08:00
committed by GitHub
parent e3ab23c1a6
commit cb8df87fc1
8 changed files with 294 additions and 13 deletions

View File

@@ -353,6 +353,19 @@ def apply_rope_with_cos_sin_cache_inplace(
)
def rotary_embedding(
positions: torch.Tensor,
query: torch.Tensor,
key: torch.Tensor,
head_size: int,
cos_sin_cache: torch.Tensor,
is_neox: bool = True,
):
torch.ops.sgl_kernel.rotary_embedding.default(
positions, query, key, head_size, cos_sin_cache, is_neox
)
def downcast_fp8(
k: torch.Tensor,
v: torch.Tensor,