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
66233af7
Unverified
Commit
66233af7
authored
Mar 04, 2025
by
Zhanwen Chen
Committed by
GitHub
Mar 03, 2025
Browse files
Use math.prod instead of np.prod for trivial ops (#14142)
parent
bf13d409
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
vllm/worker/cache_engine.py
vllm/worker/cache_engine.py
+2
-2
No files found.
vllm/worker/cache_engine.py
View file @
66233af7
# SPDX-License-Identifier: Apache-2.0
"""CacheEngine class for managing the KV cache."""
from
math
import
prod
from
typing
import
List
import
numpy
as
np
import
torch
from
vllm
import
envs
...
...
@@ -90,7 +90,7 @@ class CacheEngine:
# NOTE this assumption currently only holds for MLA so we only apply
# this optimization when `use_mla` is true
entry_shape
=
kv_cache_shape
[
2
:]
entry_size
=
np
.
prod
(
entry_shape
)
entry_size
=
prod
(
entry_shape
)
alloc_entry_size
=
align_to_256bytes
(
entry_size
,
self
.
dtype
)
alloc_shape
=
(
*
kv_cache_shape
[:
2
],
alloc_entry_size
)
else
:
...
...
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