Skip to content

Commit

Permalink
add memorysnapshot to callbacks (#810)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel King <[email protected]>
  • Loading branch information
cli99 and dakinggg authored Feb 9, 2024
1 parent 12d1ca7 commit 491fa7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llmfoundry/utils/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import torch
from composer import algorithms
from composer.callbacks import (EarlyStopper, Generate, LRMonitor,
MemoryMonitor, OptimizerMonitor,
MemoryMonitor, MemorySnapshot, OptimizerMonitor,
RuntimeEstimator, SpeedMonitor)
from composer.core import Algorithm, Callback, Evaluator
from composer.datasets.in_context_learning_evaluation import \
Expand Down Expand Up @@ -164,6 +164,8 @@ def build_callback(
return LRMonitor()
elif name == 'memory_monitor':
return MemoryMonitor()
elif name == 'memory_snapshot':
return MemorySnapshot(**kwargs)
elif name == 'speed_monitor':
return SpeedMonitor(window_size=kwargs.get('window_size', 1),
gpu_flops_available=kwargs.get(
Expand Down

0 comments on commit 491fa7a

Please sign in to comment.