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
norm
vllm
Commits
7f985166
Commit
7f985166
authored
Feb 23, 2023
by
Woosuk Kwon
Browse files
Consider pempty tensor
parent
86f9eb6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
cacheflow/models/input_metadata.py
cacheflow/models/input_metadata.py
+4
-1
No files found.
cacheflow/models/input_metadata.py
View file @
7f985166
...
...
@@ -23,6 +23,9 @@ class InputMetadata:
self
.
num_prompts
=
len
(
prompt_lens
)
self
.
num_generation_tokens
=
context_lens
.
shape
[
0
]
self
.
max_num_blocks_per_seq
=
block_tables
.
shape
[
1
]
if
block_tables
.
numel
()
>
0
:
self
.
max_num_blocks_per_seq
=
block_tables
.
shape
[
1
]
else
:
self
.
max_num_blocks_per_seq
=
0
assert
self
.
num_generation_tokens
==
block_tables
.
shape
[
0
]
assert
self
.
num_prompts
+
self
.
num_generation_tokens
==
len
(
seq_ids
)
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