refactor(lora): drop the unused timer fields and accumulate deactivate time

The restore field had no writer and add() had no caller. Deactivate
assigned its elapsed time where activate accumulates, so a generation
that unloaded more than once reported only the last pass; both are
zeroed together when the generation ends.
This commit is contained in:
CalamitousFelicitousness
2026-08-30 04:41:36 +01:00
parent 44a4a8e2a5
commit 7f430aae4e
2 changed files with 1 additions and 6 deletions
-5
View File
@@ -5,7 +5,6 @@ class Timer:
calc: float = 0
apply: float = 0
move: float = 0
restore: float = 0
activate: float = 0
deactivate: float = 0
@@ -26,13 +25,9 @@ class Timer:
self.calc = 0
self.apply = 0
self.move = 0
self.restore = 0
if complete:
self.activate = 0
self.deactivate = 0
def add(self, name, t):
self.__dict__[name] += t
def __str__(self):
return f'{self.__class__.__name__}({self.summary})'
+1 -1
View File
@@ -330,7 +330,7 @@ def network_deactivate(include=None, exclude=None):
module.network_current_names = ()
if task is not None:
pbar.update(task, advance=1, description=f'networks={len(l.previously_loaded_networks)} modules={active_components} layers={total} unapply={len(applied_layers)}')
l.timer.deactivate = time.time() - t0
l.timer.deactivate += time.time() - t0
if refused > 0:
log.error(f'Network unload: type=LoRA networks={[n.name for n in l.previously_loaded_networks]} unapply={len(applied_layers)} refused={refused} network partially removed')
if l.debug and len(l.previously_loaded_networks) > 0: