Skip to content

Commit e2d9b0a

Browse files
committed
don't break in CPU-only mode, don't overflow program memory
1 parent 06f07a9 commit e2d9b0a

File tree

1 file changed

+10
-2
lines changed
  • applications/llama_3.2_1b/src/block

1 file changed

+10
-2
lines changed

applications/llama_3.2_1b/src/block/gqa.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,21 @@ def apply_rope_and_transpose(aie_op, tensor, num_heads_dim, angle_slice):
286286
return result
287287

288288
keys = apply_rope_and_transpose(
289-
self.aie_rope_prefill_k if is_prefill else self.aie_rope_decode_k,
289+
(
290+
(self.aie_rope_prefill_k if is_prefill else self.aie_rope_decode_k)
291+
if self.cfg["use_aie_rope"]
292+
else None
293+
),
290294
keys,
291295
self.num_kv_groups,
292296
angle_slice,
293297
)
294298
queries = apply_rope_and_transpose(
295-
self.aie_rope_prefill_q if is_prefill else self.aie_rope_decode_q,
299+
(
300+
(self.aie_rope_prefill_q if is_prefill else self.aie_rope_decode_q)
301+
if self.cfg["use_aie_rope"]
302+
else None
303+
),
296304
queries,
297305
self.num_heads,
298306
angle_slice,

0 commit comments

Comments
 (0)