Skip to content

Commit

Permalink
[Minor] Remove unused code in attention (vllm-project#2384)
Browse files Browse the repository at this point in the history
  • Loading branch information
WoosukKwon authored Jan 8, 2024
1 parent c884819 commit 28c3f12
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions vllm/model_executor/layers/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,15 @@ def forward(
output = out.view_as(query)
else:
# Decoding run.
if key_cache is not None and value_cache is not None:
output = _paged_attention(
query,
key_cache,
value_cache,
input_metadata,
self.num_kv_heads,
self.scale,
self.alibi_slopes,
)
else:
# This happens during the initial memory profiling run for
# CUDA graphs.
output = torch.zeros_like(query)
output = _paged_attention(
query,
key_cache,
value_cache,
input_metadata,
self.num_kv_heads,
self.scale,
self.alibi_slopes,
)

# Reshape the output tensor.
return output.view(batch_size, seq_len, hidden_size)
Expand Down

0 comments on commit 28c3f12

Please sign in to comment.