mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2026-01-29 21:49:54 +00:00
[zero] cuda margin space for OS (#418)
This commit is contained in:
10
colossalai/utils/commons/memory.py
Normal file
10
colossalai/utils/commons/memory.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import imp
|
||||
import torch
|
||||
from colossalai.utils import get_current_device
|
||||
|
||||
|
||||
def col_cuda_memory_capacity():
|
||||
"""
|
||||
Get cuda memory capacity of the current cuda.
|
||||
"""
|
||||
return torch.cuda.get_device_properties(get_current_device()).total_memory
|
||||
Reference in New Issue
Block a user