remove tracemalloc

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-12-02 16:27:22 -05:00
parent 52ea181389
commit bd192d2991
3 changed files with 0 additions and 12 deletions
-3
View File
@@ -192,9 +192,6 @@ def main():
global args # pylint: disable=global-statement
installer.ensure_base_requirements()
init_args() # setup argparser and default folders
if args.malloc:
import tracemalloc
tracemalloc.start()
installer.args = args
installer.setup_logging()
installer.log.info('Starting SD.Next')
-1
View File
@@ -26,7 +26,6 @@ def main_args():
group_diag.add_argument("--no-hashing", default=os.environ.get("SD_NOHASHING", False), action='store_true', help="Disable hashing of checkpoints, default: %(default)s")
group_diag.add_argument("--no-metadata", default=os.environ.get("SD_NOMETADATA", False), action='store_true', help="Disable reading of metadata from models, default: %(default)s")
group_diag.add_argument("--profile", default=os.environ.get("SD_PROFILE", False), action='store_true', help="Run profiler, default: %(default)s")
group_diag.add_argument("--malloc", default=os.environ.get("SD_PROFILE", False), action='store_true', help="Trace memory ops, default: %(default)s")
group_diag.add_argument("--disable-queue", default=os.environ.get("SD_DISABLEQUEUE", False), action='store_true', help="Disable queues, default: %(default)s")
group_diag.add_argument('--debug', default=os.environ.get("SD_DEBUG", False), action='store_true', help = "Run installer with debug logging, default: %(default)s")
-8
View File
@@ -475,13 +475,5 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if not p.disable_extra_networks:
shared.log.info(f'Processed: images={len(output_images)} its={(p.steps * len(output_images)) / (t1 - t0):.2f} time={t1-t0:.2f} timers={timer.process.dct(min_time=0.02)} memory={memstats.memory_stats()}')
if shared.cmd_opts.malloc:
import tracemalloc
snapshot = tracemalloc.take_snapshot()
stats = snapshot.statistics('lineno')
shared.log.debug('Profile malloc:')
for stat in stats[:20]:
frame = stat.traceback[0]
shared.log.debug(f' file="{frame.filename}":{frame.lineno} size={stat.size}')
devices.torch_gc(force=True)
return processed