mindformers.core.ProfileMonitor

View Source On Gitee
class mindformers.core.ProfileMonitor(start_step=1, stop_step=10, output_path=None, start_profile=True, profile_communication=False, profile_memory=True, config=None, **kwargs)[source]

Profile analysis in training.

Parameters
  • start_step (int) – The step to start profiling. Default: 1.

  • stop_step (int) – The step to stop profiling. Default: 10.

  • output_path (str) – The result of profiling will be saved in this path. Default: None.

  • start_profile (str) – Whether to enable profiling. Default: True.

  • profile_communication (str) – Whether to collect communication performance data during multi-device training. Default: False.

  • profile_memory (str) – Whether to collect Tensor memory data. Default: True.

  • config (dict) – Configuration items, used to profile relevant configuration information, such as parallel configuration. Default: None.

Examples

>>> from mindformers.core import ProfileMonitor
>>> monitor = ProfileMonitor(output_path='./profile_dir')