Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
dea9c0dc
"tests/vscode:/vscode.git/clone" did not exist on "187b354a7a1cc547415dbf5b0e2f3c6556caff98"
Unverified
Commit
dea9c0dc
authored
Jul 02, 2024
by
Nicolas Patry
Committed by
GitHub
Jul 02, 2024
Browse files
Fixing rocm. (#2164)
parent
b966bc0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
server/text_generation_server/layers/attention/rocm.py
server/text_generation_server/layers/attention/rocm.py
+3
-3
No files found.
server/text_generation_server/layers/attention/rocm.py
View file @
dea9c0dc
...
...
@@ -2,6 +2,7 @@ import os
import
torch
from
text_generation_server.utils.import_utils
import
SYSTEM
from
text_generation_server.models.globals
import
FLASH_DECODING
from
text_generation_server.layers.attention
import
Seqlen
from
loguru
import
logger
major
,
minor
=
torch
.
cuda
.
get_device_capability
()
...
...
@@ -45,8 +46,7 @@ def paged_attention(
kv_head_mapping
:
torch
.
Tensor
,
softmax_scale
:
float
,
block_tables
:
torch
.
Tensor
,
cu_seqlen_q
:
torch
.
Tensor
,
cu_seqlen_k
:
torch
.
Tensor
,
input_lengths
:
Seqlen
,
max_s
:
int
,
):
# Adapted from: https://github.com/vllm-project/vllm/blob/f8a1e39fae05ca610be8d5a78be9d40f5274e5fc/vllm/model_executor/layers/attention.py
...
...
@@ -70,7 +70,7 @@ def paged_attention(
block_size
=
value_cache
.
shape
[
3
]
num_seqs
,
num_heads
,
head_size
=
query
.
shape
max_num_partitions
=
(
max_s
+
_PARTITION_SIZE
-
1
)
//
_PARTITION_SIZE
input_lengths
=
cu_seqlen_k
input_lengths
=
input_lengths
.
input_lengths
# NOTE(woosuk): We use a simple heuristic to decide whether to use
# PagedAttention V1 or V2. If the number of partitions is 1, we use
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment