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
2729087e
Commit
2729087e
authored
Feb 14, 2023
by
Woosuk Kwon
Browse files
Fix a ref count bug in swapping
parent
c128c2ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
cacheflow/master/block_manager.py
cacheflow/master/block_manager.py
+2
-0
No files found.
cacheflow/master/block_manager.py
View file @
2729087e
...
...
@@ -166,6 +166,7 @@ class BlockSpaceManager:
for
cpu_block
in
block_table
:
if
cpu_block
in
mapping
:
gpu_block
=
mapping
[
cpu_block
]
gpu_block
.
ref_count
+=
1
else
:
gpu_block
=
self
.
gpu_allocator
.
allocate
()
mapping
[
cpu_block
]
=
gpu_block
...
...
@@ -196,6 +197,7 @@ class BlockSpaceManager:
for
gpu_block
in
block_table
:
if
gpu_block
in
mapping
:
cpu_block
=
mapping
[
gpu_block
]
cpu_block
.
ref_count
+=
1
else
:
cpu_block
=
self
.
cpu_allocator
.
allocate
()
mapping
[
gpu_block
]
=
cpu_block
...
...
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