mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-07-19 01:39:26 +00:00
fix chunk move device (#1158)
This commit is contained in:
parent
07f9c781f9
commit
4e67b2a890
@ -455,7 +455,7 @@ class ChunkManager:
|
|||||||
chunk (Chunk): the chunk to move to target device
|
chunk (Chunk): the chunk to move to target device
|
||||||
device (torch.device): target device
|
device (torch.device): target device
|
||||||
"""
|
"""
|
||||||
if chunk.data.device == device:
|
if chunk.device_type == device.type:
|
||||||
return
|
return
|
||||||
if chunk.can_move_device and not chunk.is_empty:
|
if chunk.can_move_device and not chunk.is_empty:
|
||||||
self.total_mem[chunk.device_type] -= chunk.mem
|
self.total_mem[chunk.device_type] -= chunk.mem
|
||||||
|
Loading…
Reference in New Issue
Block a user