Skip to content

Commit fdf5463

Browse files
committed
cleanup
Signed-off-by: imkero <[email protected]>
1 parent 0e7f6e0 commit fdf5463

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/model_executor/test_mrope_positions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-License-Identifier: Apache-2.0
22
from unittest.mock import Mock
33

4-
import numpy as np
54
import pytest
65
import torch
76

@@ -667,14 +666,15 @@ def test_mrope_get_next_input_positions_tensor(mrope_position_delta,
667666
def test_mrope_assign_next_input_positions(mrope_position_delta, out_offset,
668667
context_len, seq_len,
669668
expected_output):
670-
out = np.zeros((3, out_offset + seq_len - context_len), dtype=np.int64)
669+
out = torch.zeros((3, out_offset + seq_len - context_len),
670+
dtype=torch.int64)
671+
out_np = out.numpy()
671672
mrope_assign_next_input_positions(
672-
out=out,
673+
out=out_np,
673674
out_offset=out_offset,
674675
mrope_position_delta=mrope_position_delta,
675676
context_len=context_len,
676677
num_new_tokens=seq_len - context_len,
677678
)
678679

679-
assert torch.equal(torch.from_numpy(out),
680-
torch.tensor(expected_output, dtype=torch.int64))
680+
assert torch.equal(out, torch.tensor(expected_output, dtype=torch.int64))

vllm/v1/worker/gpu_model_runner.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ def __init__(
237237
dtype=torch.int64,
238238
device="cpu",
239239
pin_memory=self.pin_memory)
240-
241-
# NOTE: `mrope_positions_np` shares same
240+
241+
# NOTE: `mrope_positions_np` shares same
242242
# underlying data with `mrope_positions_cpu`.
243-
#
244-
# `mrope_positions_np` is created in favor of
245-
# numba accelerated func `mrope_assign_next_input_positions`
243+
#
244+
# `mrope_positions_np` is created in favor of
245+
# numba accelerated func `mrope_assign_next_input_positions`
246246
# while it can operate numpy array only.
247247
self.mrope_positions_np = self.mrope_positions_cpu.numpy()
248248

0 commit comments

Comments
 (0)