已合并
fix bug of ckpt #2656
温一盏创建于 2025年5月13日
fix bug of ckpt #2656
已合并
从refs/pull/2656/head合入到2.0.0
共 3 个文件变更+4-4
| @@ -71,6 +71,8 @@ def main(): | |||
| 71 | help='use bitsandbytes nf4 to quantize model.') | 71 | help='use bitsandbytes nf4 to quantize model.') |
| 72 | parser.add_argument('--orm', action="store_true", default=False, | 72 | parser.add_argument('--orm', action="store_true", default=False, |
| 73 | help='Specify the ORM ckpt conversion, convert additional rm_head layer in ORM.') | 73 | help='Specify the ORM ckpt conversion, convert additional rm_head layer in ORM.') |
| 74 | + parser.add_argument('--load-checkpoint-loosely', action='store_true', default=False, | ||
| 75 | + help='Enable loading checkpoint not strictly.') | ||
| 74 | known_args, _ = parser.parse_known_args() | 76 | known_args, _ = parser.parse_known_args() |
| 75 | 77 | ||
| 76 | 78 | ||
| @@ -55,8 +55,6 @@ def add_arguments(parser): | |||
| 55 | group.add_argument("--noop-layers", type=str, default=None, help='Specity the noop layers.') | 55 | group.add_argument("--noop-layers", type=str, default=None, help='Specity the noop layers.') |
| 56 | group.add_argument("--add-output-layer-bias", action="store_true", default=False, | 56 | group.add_argument("--add-output-layer-bias", action="store_true", default=False, |
| 57 | help='Configuration for the output layer bias.') | 57 | help='Configuration for the output layer bias.') |
| 58 | - group.add_argument('--load-checkpoint-loosely', action='store_true', default=False, | ||
| 59 | - help='Enable loading checkpoint not strictly.') | ||
| 60 | 58 | ||
| 61 | 59 | ||
| 62 | def build_metadata(args, margs): | 60 | def build_metadata(args, margs): |
| @@ -900,6 +900,7 @@ class MegatronModel(ModelBase): | |||
| 900 | self.args.add_qkv_bias = self.args_cmd.add_qkv_bias | 900 | self.args.add_qkv_bias = self.args_cmd.add_qkv_bias |
| 901 | self.args.add_dense_bias = self.args_cmd.add_dense_bias | 901 | self.args.add_dense_bias = self.args_cmd.add_dense_bias |
| 902 | self.args.post_norm = self.args_cmd.post_norm | 902 | self.args.post_norm = self.args_cmd.post_norm |
| 903 | + self.args.load_checkpoint_loosely = self.args_cmd.load_checkpoint_loosely | ||
| 903 | self.args.tokenizer_model = getattr(self.args_cmd, 'tokenizer_model', None) | 904 | self.args.tokenizer_model = getattr(self.args_cmd, 'tokenizer_model', None) |
| 904 | self.args.make_vocab_size_divisible_by = getattr(self.args_cmd, 'make_vocab_size_divisible_by', None) | 905 | self.args.make_vocab_size_divisible_by = getattr(self.args_cmd, 'make_vocab_size_divisible_by', None) |
| 905 | if self.args_cmd.params_dtype == 'bf16': | 906 | if self.args_cmd.params_dtype == 'bf16': |
| @@ -1060,8 +1061,7 @@ class MegatronModel(ModelBase): | |||
| 1060 | '--save-interval', '1', | 1061 | '--save-interval', '1', |
| 1061 | '--mock-data', # To pass the "blend data checks" in arguments.py | 1062 | '--mock-data', # To pass the "blend data checks" in arguments.py |
| 1062 | '--load', self.args_cmd.load_dir, | 1063 | '--load', self.args_cmd.load_dir, |
| 1063 | - '--finetune', | 1064 | + '--finetune' |
| 1064 | - '--load-checkpoint-loosely' | ||
| 1065 | ] | 1065 | ] |
| 1066 | 1066 | ||
| 1067 | if hasattr(self.args_cmd, 'add_bias_linear') and not self.args_cmd.add_bias_linear: | 1067 | if hasattr(self.args_cmd, 'add_bias_linear') and not self.args_cmd.add_bias_linear: |