Skip to content

Commit c5c149c

Browse files
committed
address review item and linting
1 parent 6d12ceb commit c5c149c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/qualcomm/oss_scripts/llama/model/static_llama.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
def apply_rotary_emb_single(
2020
x: torch.Tensor, freqs_cos: torch.Tensor, freqs_sin: torch.Tensor
2121
) -> torch.Tensor:
22-
# Change to RoPE of huggingface version
22+
# The implementation of RoPE in HuggingFace processes query and key with two half instead of interleaved way.
23+
# The main difference is stride in StrideSlice op. For interleaved way, stride is two which is not friendly for HTP backend.
24+
# Ref: https://github.com/huggingface/transformers/issues/25199
2325
x_r, x_i = x[..., : x.shape[-1] // 2], x[..., x.shape[-1] // 2 :]
24-
# brodcast for batch_prefill mode input x
26+
# broadcast for batch_prefill mode input x
2527
if x.dim() == 4:
2628
freqs_cos = freqs_cos[None, None, :, :]
2729
freqs_sin = freqs_sin[None, None, :, :]

0 commit comments

Comments
 (0)