mindspore.merge_pipeline_strategys

mindspore.merge_pipeline_strategys(src_strategy_dirs, dst_strategy_file)[source]

Merge parallel strategy between all pipeline stages in pipeline parallel mode. For more details about converting distributed Checkpoint, please refer to Model Transformation.

Note

Strategy file of each pipeline stage should be included in src_strategy_dirs.

Parameters
  • src_strategy_dirs (str) – The directory of strategy files including all pipeline stage which is saved by ‘mindspore.set_auto_parallel_context(strategy_ckpt_save_file)’.

  • dst_strategy_file (str) – The file merged strategy to save.

Raises

NotADirectoryErrorsrc_strategy_dirs is not a directory.

Examples

>>> import mindspore as ms
>>> # src_strategy_dir/stra0.ckpt, src_strategy_dir/stra1.ckpt ... src_strategy_dir/stra127.ckpt
>>> ms.merge_pipeline_strategys("./src_strategy_dir", "./dst_strategy.ckpt")