Skip to content

Commit b752a77

Browse files
Qualcomm AI Engine Direct - Rope Fix (#14346)
### Summary Rope fix ### Test plan CI Passes cc: @haowhsu-quic Co-authored-by: winskuo-quic <[email protected]>
1 parent e0dda90 commit b752a77

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ def __init__(self, layer_idx: int, config: ModelArgs, output_new_cache_only=Fals
7575
self.enable_masked_softmax = getattr(config, "enable_masked_softmax", False)
7676
self.use_qk_norm = config.use_qk_norm
7777
self.qk_norm_before_rope = config.qk_norm_before_rope
78+
# If None, assume each layer uses rope
7879
self.use_rope = (
79-
config.no_rope_layer_interval
80-
and (layer_idx + 1) % config.no_rope_layer_interval
80+
config.no_rope_layer_interval is None
81+
or (layer_idx + 1) % config.no_rope_layer_interval
8182
)
8283

8384
if self.use_qk_norm:

0 commit comments

Comments
 (0)