Simple GPU memory report.
(name)
| 120 | |
| 121 | |
| 122 | def report_memory(name): |
| 123 | """Simple GPU memory report.""" |
| 124 | |
| 125 | mega_bytes = 1024.0 * 1024.0 |
| 126 | string = name + ' memory (MB)' |
| 127 | string += ' | allocated: {}'.format(torch.cuda.memory_allocated() / |
| 128 | mega_bytes) |
| 129 | string += ' | max allocated: {}'.format(torch.cuda.max_memory_allocated() / |
| 130 | mega_bytes) |
| 131 | string += ' | cached: {}'.format(torch.cuda.memory_cached() / mega_bytes) |
| 132 | string += ' | max cached: {}'.format(torch.cuda.memory_reserved() / |
| 133 | mega_bytes) |
| 134 | log_dist(string) |
| 135 | |
| 136 | |
| 137 | def get_checkpoint_name(checkpoints_path, iteration): |
nothing calls this directly
no test coverage detected