昇腾社区首页
中文
注册

mindx_elastic.restore_module.RestoreStrategyGenerator

功能说明

在故障场景下,对于混合并行模型,生成用于恢复模型网络的信息。

gen_fault_tolerance_strategy(directory_path)

返回用于恢复模型网络的信息,该值是两个str类型数据。

参数:

directory_path(str)- 指定checkpoint文件目录。

表1 返回值

返回值

类型

说明

RESTORE_RANKS返回值1

str

用于恢复网络模型所需的rank ID列表。

RESTORE_RANKS_MAP返回值2

str

rank ID映射关系表。

使用样例如下:

from mindx_elastic.restore_module.gen_restore_ranks import RestoreStrategyGenerator
restore_strategy_generator = RestoreStrategyGenerator()
restore_quranks, restorye_dict = restore_strategy_generator.gen_fault_tolerance_strategy(directory_path=None)