Skip to content

Commit

Permalink
refactor scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
hage1005 committed Apr 25, 2024
1 parent 97e5f58 commit 617dc90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions logix/logix.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def __init__(
self.type_filter = None
self.name_filter = None

# Deferred Imports to avoid circular imports
from logix.scheduler import LogIXScheduler
self.scheduler = LogIXScheduler(self)

def watch(
self,
model: nn.Module,
Expand Down
7 changes: 4 additions & 3 deletions logix/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ class LogIXScheduler:
def __init__(
self,
logix: LogIX,
lora: str = "none",
hessian: str = "none",
save: str = "none",
):
self.logix = logix

self._epoch = -1
self._lora_epoch = -1
self._logix_state_schedule = []

lora = logix.config.scheduler.lora
hessian = logix.config.scheduler.hessian
save = logix.config.scheduler.save

self.sanity_check(lora, hessian, save)
self.configure_lora_epoch(lora)
self.configure_schedule(lora, hessian, save)
Expand Down

0 comments on commit 617dc90

Please sign in to comment.