Commit 2729087e authored by Woosuk Kwon's avatar Woosuk Kwon
Browse files

Fix a ref count bug in swapping

parent c128c2ed
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment