Downgraded memory check exceptions to warnings to in case user want to use swap

这个提交包含在:
craig-warren
2024-01-03 13:52:46 +00:00
父节点 7a82e0a926
当前提交 2675e0ff6a

查看文件

@@ -301,12 +301,11 @@ def mem_check_host(mem):
mem: int for memory required (bytes).
"""
if mem > config.sim_config.hostinfo["ram"]:
logger.exception(
f"Memory (RAM) required ~{humanize.naturalsize(mem)} exceeds "
f"{humanize.naturalsize(config.sim_config.hostinfo['ram'], True)} "
"detected!\n"
logger.warning(
f"Memory (RAM) required (~{humanize.naturalsize(mem)}) exceeds "
f"({humanize.naturalsize(config.sim_config.hostinfo['ram'], True)}) "
" physical memory detected!\n"
)
raise ValueError
def mem_check_device_snaps(total_mem, snaps_mem):
@@ -324,12 +323,11 @@ def mem_check_device_snaps(total_mem, snaps_mem):
device_mem = config.get_model_config().device["dev"].global_mem_size
if total_mem - snaps_mem > device_mem:
logger.exception(
f"Memory (RAM) required ~{humanize.naturalsize(total_mem)} exceeds "
f"{humanize.naturalsize(device_mem, True)} "
f"detected on specified {' '.join(config.get_model_config().device['dev'].name.split())} device!\n"
logger.warning(
f"Memory (RAM) required (~{humanize.naturalsize(total_mem)}) exceeds "
f"({humanize.naturalsize(device_mem, True)}) physical memory detected "
f"on specified {' '.join(config.get_model_config().device['dev'].name.split())} device!\n"
)
raise ValueError
# If the required memory without the snapshots will fit on the GPU then
# transfer and store snaphots on host