From bd192d2991dd8895117e87ed892bc058f84b4cf1 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 2 Dec 2024 16:27:22 -0500 Subject: [PATCH] remove tracemalloc Signed-off-by: Vladimir Mandic --- launch.py | 3 --- modules/cmd_args.py | 1 - modules/processing.py | 8 -------- 3 files changed, 12 deletions(-) diff --git a/launch.py b/launch.py index 5c8a6051a..e00da58c7 100755 --- a/launch.py +++ b/launch.py @@ -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') diff --git a/modules/cmd_args.py b/modules/cmd_args.py index cb4e5fc16..752ad02c0 100644 --- a/modules/cmd_args.py +++ b/modules/cmd_args.py @@ -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") diff --git a/modules/processing.py b/modules/processing.py index 095eba54c..57512850a 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -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