This commit is contained in:
Ethan Weber committed 2022-04-29 22:10:36 +00:00
commit 387ad93027
10 files changed
+125 -142

No files matched your search

+5 -5
View File
@@ -22,7 +22,7 @@ def check_stats_enabled(func: Callable) -> Callable:
def wrapper(self, *args, **kwargs):
ret = None
if self.config.logging_configs.enable_stats:
if self.config.logging.enable_stats:
ret = func(self, *args, **kwargs)
return ret
@@ -34,7 +34,7 @@ def check_profiler_enabled(func: Callable) -> Callable:
def wrapper(self, *args, **kwargs):
ret = None
if self.config.logging_configs.enable_stats:
if self.config.logging.enable_stats:
ret = func(self, *args, **kwargs)
return ret
@@ -59,9 +59,9 @@ def check_print_stats_step(func: Callable) -> Callable:
def wrapper(self, *args, **kwargs):
ret = None
if (
self.step % self.config.logging_configs.steps_per_log == 0
or (self.config.steps_per_save and self.step % self.config.steps_per_save == 0)
or self.step % self.config.steps_per_test == 0
self.step % self.config.logging.steps_per_log == 0
or (self.config.graph.steps_per_save and self.step % self.config.graph.steps_per_save == 0)
or self.step % self.config.graph.steps_per_test == 0
):
ret = func(self, *args, **kwargs)
return ret
+1 -1
View File
@@ -37,7 +37,7 @@ class Profiler:
def __init__(self, config: DictConfig, is_main_thread: bool):
self.config = config
if self.config.logging_configs.enable_profiler:
if self.config.logging.enable_profiler:
self.is_main_thread = is_main_thread
self.profiler_dict = {}
+4 -4
View File
@@ -30,15 +30,15 @@ class StatsTracker:
def __init__(self, config: DictConfig, is_main_thread: bool):
self.config = config
if self.config.logging_configs.enable_stats:
if self.config.logging.enable_stats:
self.is_main_thread = is_main_thread
self.max_history = self.config.logging_configs.stats_tracker.max_history
self.max_history = self.config.logging.stats_tracker.max_history
self.step = 0
self.stats_dict = {}
self.past_stats = []
self.new_key = False
self.stats_to_track = set()
for name in self.config.logging_configs.stats_tracker.stats_to_track:
for name in self.config.logging.stats_tracker.stats_to_track:
self.stats_to_track.add(Stats[name])
logging.info("Successfully set up StatsTracker")
else:
@@ -85,7 +85,7 @@ class StatsTracker:
if name == Stats.ITER_TRAIN_TIME and Stats.ETA in self.stats_to_track:
# update ETA if logging iteration train time
remain_iter = self.config.max_num_iterations - step
remain_iter = self.config.graph.max_num_iterations - step
self.stats_dict[Stats.ETA] = remain_iter * self.stats_dict[name]
@check_print_stats_step