Skip to content

Commit 1565b07

Browse files
justinchubyCopilot
andcommitted
Fix lint: formatting in RoPE and golden test
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchu@microsoft.com>
1 parent 8537a2a commit 1565b07

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/mobius/components/_rotary_embedding.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ def _cast_embeddings(
150150
return cos, sin
151151

152152
def forward(self, op: builder.OpBuilder, position_ids: ir.Value):
153-
cos, sin = get_rotary_pos_emb(
154-
op, position_ids, self.cos_cache, self.sin_cache
155-
)
153+
cos, sin = get_rotary_pos_emb(op, position_ids, self.cos_cache, self.sin_cache)
156154
return self._cast_embeddings(op, cos, sin)
157155

158156

@@ -306,9 +304,7 @@ def forward(self, op: builder.OpBuilder, position_ids: ir.Value):
306304
)
307305
offset = op.Mul(use_long, self.original_max_position_embeddings)
308306
position_ids = op.Add(position_ids, offset)
309-
cos, sin = get_rotary_pos_emb(
310-
op, position_ids, self.cos_cache, self.sin_cache
311-
)
307+
cos, sin = get_rotary_pos_emb(op, position_ids, self.cos_cache, self.sin_cache)
312308
return self._cast_embeddings(op, cos, sin)
313309

314310

@@ -394,9 +390,7 @@ def find_correction_dim(num_rotations):
394390
self._llama4_original_max_pos = float(original_max_pos)
395391

396392
def forward(self, op: builder.OpBuilder, position_ids: ir.Value):
397-
cos, sin = get_rotary_pos_emb(
398-
op, position_ids, self.cos_cache, self.sin_cache
399-
)
393+
cos, sin = get_rotary_pos_emb(op, position_ids, self.cos_cache, self.sin_cache)
400394
cos, sin = self._cast_embeddings(op, cos, sin)
401395
if self._llama4_beta is None:
402396
return cos, sin

tests/e2e_golden_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ def _use_temp_hf_cache(tmp_path):
155155
"text-generation/helium-1-2b": "Helium decode loop diverges from HF after first token",
156156
"text-generation/nanochat-d20": "NanoChat decode loop diverges from HF after first token",
157157
"text-generation/ernie4_5-0_3b": "ERNIE 4.5 decode loop diverges from HF after first token",
158-
159158
# MLA compressed KV cache dimensions not yet handled by OnnxGenerator
160159
"text-generation/youtu-2b": "Youtu MLA KV cache dims differ from standard attention (v_head_dim != head_dim)",
161160
}

0 commit comments

Comments
 (0)