[CPU] Fix rotary_embedding_cpu fake for in-place layouts (#36443)
This commit is contained in:
@@ -281,9 +281,9 @@ def register_fake_ops(tp_size: int):
|
|||||||
|
|
||||||
@register_cpu_compile_fake("rotary_embedding_cpu")
|
@register_cpu_compile_fake("rotary_embedding_cpu")
|
||||||
def _(positions, query, key, head_size, cos_sin_cache, is_neox):
|
def _(positions, query, key, head_size, cos_sin_cache, is_neox):
|
||||||
# TODO: the kernel aliases query/key for 2D and 4D but allocates for 3D,
|
if query.ndim == 3:
|
||||||
# which no schema expresses; an accurate fake needs it to pick one
|
return torch.empty_like(query), torch.empty_like(key)
|
||||||
return torch.empty_like(query), torch.empty_like(key)
|
return query, key
|
||||||
|
|
||||||
@register_cpu_compile_fake("apply_rotary_pos_emb_cpu")
|
@register_cpu_compile_fake("apply_rotary_pos_emb_cpu")
|
||||||
def _(query, key, cos, sin):
|
def _(query, key, cos, sin):
|
||||||
|
|||||||
Reference in New Issue
Block a user