()
| 134 | |
| 135 | @staticmethod |
| 136 | def memory_usage(): |
| 137 | alloc = "mem_allocated: {:.4f} GB".format(get_accelerator().memory_allocated() / (1024 * 1024 * 1024)) |
| 138 | max_alloc = "max_mem_allocated: {:.4f} GB".format(get_accelerator().max_memory_allocated() / |
| 139 | (1024 * 1024 * 1024)) |
| 140 | cache = "cache_allocated: {:.4f} GB".format(get_accelerator().memory_cached() / (1024 * 1024 * 1024)) |
| 141 | max_cache = "max_cache_allocated: {:.4f} GB".format(get_accelerator().max_memory_cached() / |
| 142 | (1024 * 1024 * 1024)) |
| 143 | return " | {} | {} | {} | {}".format(alloc, max_alloc, cache, max_cache) |
| 144 | |
| 145 | def log(self, names, normalizer=1.0, reset=True, memory_breakdown=False, ranks=None): |
| 146 | """Log a group of timers.""" |
nothing calls this directly
no test coverage detected