Files
ColossalAI/colossalai/utils/commons/memory.py
2022-03-17 13:16:22 +08:00

10 lines
240 B
Python

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