Skip to content

Commit

Permalink
from_numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
comaniac committed Aug 5, 2024
1 parent 90ecb1d commit 4cdfa2e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vllm/attention/backends/flash_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def build(self, seq_lens: List[int], query_lens: List[int],
for i, block_table in enumerate(self.block_tables):
if block_table:
input_block_tables[i, :len(block_table)] = block_table
block_tables = torch.tensor(input_block_tables).to(
block_tables = torch.from_numpy(input_block_tables).to(
device=device, non_blocking=True)
else:
block_tables = make_tensor_with_pad(
Expand Down
2 changes: 1 addition & 1 deletion vllm/attention/backends/flashinfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def build(self, seq_lens: List[int], query_lens: List[int],
for i, block_table in enumerate(self.block_tables):
if block_table:
input_block_tables[i, :len(block_table)] = block_table
block_tables = torch.tensor(input_block_tables).to(
block_tables = torch.from_numpy(input_block_tables).to(
device, non_blocking=True)

last_paged_kv_indptr = self.paged_kv_indptr[-1]
Expand Down
2 changes: 1 addition & 1 deletion vllm/attention/backends/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def build(self, seq_lens: List[int], query_lens: List[int],
for i, block_table in enumerate(self.block_tables):
if block_table:
input_block_tables[i, :len(block_table)] = block_table
block_tables = torch.tensor(input_block_tables).to(
block_tables = torch.from_numpy(input_block_tables).to(
device, non_blocking=True)
else:
block_tables = make_tensor_with_pad(
Expand Down

0 comments on commit 4cdfa2e

Please sign in to comment.