Tidy memory info printing for OpenCL

这个提交包含在:
Craig Warren
2024-01-29 15:22:38 +00:00
父节点 489b66f397
当前提交 2f856d7d44
共有 2 个文件被更改,包括 9 次插入10 次删除

查看文件

@@ -346,12 +346,12 @@ class ModelBuildRun:
self.write_output_data()
# Print information about memory usage and solving time for a model
# Add a string on GPU memory usage if applicable
mem_str = (
f" host + ~{humanize.naturalsize(solver.memused)} GPU"
if config.sim_config.general["solver"] == "cuda"
else ""
)
# Add a string on device (GPU) memory usage if applicable
mem_str = ""
if config.sim_config.general["solver"] == "cuda":
mem_str = f" host + ~{humanize.naturalsize(solver.memused)} device"
elif config.sim_config.general["solver"] == "opencl":
mem_str = f" host + unknown for device"
logger.info(f"\nMemory used (estimated): " + f"~{humanize.naturalsize(self.p.memory_full_info().uss)}{mem_str}")
logger.info(

查看文件

@@ -1308,7 +1308,7 @@ class OpenCLUpdates:
self.event_marker1.wait()
def calculate_memory_used(self, iteration):
"""Calculates memory used on last iteration.
"""Calculates memory used on last iteration.
Args:
iteration: int for iteration number.
@@ -1316,9 +1316,8 @@ class OpenCLUpdates:
Returns:
Memory (RAM) used on compute device.
"""
# if iteration == self.grid.iterations - 1:
# return self.drv.mem_get_info()[1] - self.drv.mem_get_info()[0]
logger.debug("Look at memory estimate for pyopencl")
# No clear way to determine memory used from PyOpenCL unlike PyCUDA.
pass
def calculate_solve_time(self):
"""Calculates solving time for model."""