mindspore.load_distributed_checkpoint

mindspore.load_distributed_checkpoint(network, checkpoint_filenames, predict_strategy=None, train_strategy_filename=None, strict_load=False, dec_key=None, dec_mode='AES-GCM')[source]

Load checkpoint into net for distributed predication. Used in the case of distributed inference. For details of distributed inference, please check: https://www.mindspore.cn/docs/programming_guide/en/r1.6/distributed_inference.html.

Parameters
  • network (Cell) – Network for distributed predication.

  • checkpoint_filenames (list[str]) – The name of Checkpoint files in order of rank id.

  • predict_strategy (dict) – Strategy of predication process. It means that using one device to predict when setting predict_strategy as None. Default: None.

  • train_strategy_filename (str) – The filename of training strategy protocol buffer file. When train_strategy_filename is None, the training strategy file will be obtained from context.get_auto_parallel_context(“strategy_ckpt_load_file”). Therefore, the training strategy file needs to be specified in at least one of them. Default: None.

  • strict_load (bool) – Whether to strict load the parameter into net. If False, it will load parameter into net when parameter name’s suffix in checkpoint file is the same as the parameter in the network. When the types are inconsistent perform type conversion on the parameters of the same type, such as float32 to float16. Default: False.

  • dec_key (Union[None, bytes]) – Byte type key used for decryption. If the value is None, the decryption is not required. Default: None.

  • dec_mode (str) – This parameter is valid only when dec_key is not set to None. Specifies the decryption mode, currently supports ‘AES-GCM’ and ‘AES-CBC’. Default: ‘AES-GCM’.

Raises
  • TypeError – The type of inputs do not match the requirements.

  • ValueError – Failed to load checkpoint into net.