0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

lighitningでdeepspeedを用いる方法は下記を参考にしてください.

Deepspeedのcheckpointのロード

deepspeedのチェックポイントはディレクトリになっており, 単純にload_from_checkpointではロードできません.

なので,convert_zero_checkpoint_to_fp32_state_dict関数でptファイルへと変換してからロードしましょう.

from lightning.pytorch.utilities.deepspeed import convert_zero_checkpoint_to_fp32_state_dict

ckpt_dir_path = "/hoge/epochX_stepY.ckpt"
dist_path =  ckpt_dir_path + "/state_dict.pt"
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_path, dist_path)

MyLighiningModel.load_from_checkpoint(dist_path)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?