业务用户非{MindIO-install-user}、HwHiAiUser、hwMindX用户,由用户根据实际情况决定。
cd deepspeed安装目录/runtime
vim engine.py
import torch_mindio
替换后:
optim_checkpoint = torch_mindio.load(optim_load_path, map_location='cpu')
替换后:
torch_mindio.save(state, save_path)
with open(self._get_optimizer_ckpt_name(save_dir, tag, expp_rank), 'wb') as fd: torch.save(optimizer_state, fd) fd.flush()
替换后:
torch_mindio.save(optimizer_state, self._get_optimizer_ckpt_name(save_dir, tag, expp_rank))
expert_state_dict = torch.load(DeepSpeedEngine._get_expert_ckpt_name( checkpoint_path, -1, # -1 means ignore layer_id global_expert_id, tag, mpu), map_location=torch.device('cpu'))
替换后:
expert_state_dict = torch_mindio.load(DeepSpeedEngine._get_expert_ckpt_name( checkpoint_path, -1, # -1 means ignore layer_id global_expert_id, tag, mpu), map_location='cpu')