Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
863d315c
Unverified
Commit
863d315c
authored
Mar 11, 2025
by
iefgnoix
Committed by
GitHub
Mar 11, 2025
Browse files
[V1][TPU] Pad the block_table.shape[1] so the ragged paged attention can handle correctly (#14597)
parent
d374f04a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
vllm/v1/worker/tpu_model_runner.py
vllm/v1/worker/tpu_model_runner.py
+5
-2
No files found.
vllm/v1/worker/tpu_model_runner.py
View file @
863d315c
...
...
@@ -23,7 +23,8 @@ from vllm.multimodal.utils import group_mm_inputs_by_modality
from
vllm.sampling_params
import
SamplingType
from
vllm.sequence
import
IntermediateTensors
from
vllm.utils
import
LayerBlockType
,
cdiv
,
is_pin_memory_available
from
vllm.v1.attention.backends.pallas
import
(
PallasAttentionBackend
,
from
vllm.v1.attention.backends.pallas
import
(
NUM_KV_PAGES_PER_BLOCK
,
PallasAttentionBackend
,
PallasMetadata
)
from
vllm.v1.core.encoder_cache_manager
import
compute_encoder_budget
from
vllm.v1.kv_cache_interface
import
(
FullAttentionSpec
,
KVCacheConfig
,
...
...
@@ -138,8 +139,10 @@ class TPUModelRunner:
device
=
"cpu"
)
self
.
slot_mapping_np
=
self
.
slot_mapping_cpu
.
numpy
()
padded_max_num_blocks_per_req
=
_get_padded_number
(
self
.
max_num_blocks_per_req
,
NUM_KV_PAGES_PER_BLOCK
)
self
.
block_table_cpu
=
torch
.
zeros
(
(
self
.
max_num_tokens
,
self
.
max_num_blocks_per_req
),
(
self
.
max_num_tokens
,
padded_
max_num_blocks_per_req
),
dtype
=
self
.
input_batch
.
block_table
.
get_cpu_tensor
().
dtype
,
device
=
"cpu"
)
...
...
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