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: Enabling Graph-Accounting Convergence.

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, whose key is parameter name, and value is a list or a tuple that the first four elements are [dev_matrix, tensor_map, param_split_shape, field]. If None, it means that the predication process just uses single device. Default: None.

  • train_strategy_filename (str) – Train strategy proto file name. 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.