MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / setup

Method setup

lit_gpt/speed_monitor.py:370–379  ·  view source on GitHub ↗
(self, trainer: Trainer, pl_module: LightningModule, stage: str)

Source from the content-addressed store, hash-verified

368 self.total_lengths: int = 0
369
370 def setup(self, trainer: Trainer, pl_module: LightningModule, stage: str) -> None:
371 if self.speed_monitor is not None:
372 return # already setup
373 # TODO: this will not work properly if a precision plugin is passed to Trainer
374 flops_available = get_flops_available(
375 trainer.strategy.root_device, trainer._accelerator_connector._precision_flag
376 )
377 self.speed_monitor = SpeedMonitorBase(
378 flops_available, trainer.logger.log_metrics, **self.speed_monitor_kwargs
379 )
380
381 @trainer_rank_zero_only
382 def on_train_start(self, trainer: Trainer, pl_module: LightningModule) -> None:

Callers

nothing calls this directly

Calls 2

get_flops_availableFunction · 0.85
SpeedMonitorBaseClass · 0.85

Tested by

no test coverage detected