-
Notifications
You must be signed in to change notification settings - Fork 369
support transfer llama hf weight to megatron weight #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
8993968
83cb7eb
4c3b28a
d6bb32a
6c46b17
86dcc48
fbb2ef9
41d3fa5
f39eaaf
ac1be7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -584,9 +584,11 @@ def __init__(self, config, layer_number, | |
| local_attn = FlashSelfAttention(causal=True, attention_dropout=config.attention_dropout) | ||
| else: | ||
| local_attn = CoreAttention(self.layer_number, config, self.attn_mask_type) | ||
|
|
||
| self.enable_ds_sequence_parallel = parallel_state.get_sequence_parallel_world_size() > 1 \ | ||
| or args.force_ds_sequence_parallel | ||
| if hasattr(args, 'ckpt_transfer') and args.ckpt_transfer: | ||
|
||
| self.enable_ds_sequence_parallel = False | ||
| else: | ||
| self.enable_ds_sequence_parallel = parallel_state.get_sequence_parallel_world_size() > 1 \ | ||
| or args.force_ds_sequence_parallel | ||
| if self.enable_ds_sequence_parallel: | ||
| assert dist_attn_supported, 'Distributed attention is not supported in this DeepSpeed version' | ||
| assert args.num_attention_heads % parallel_state.get_sequence_parallel_world_size() == 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,14 +28,23 @@ | |
| from torch import nn | ||
| import torch.nn.functional as F | ||
|
|
||
| def model_provider(pre_process=True, post_process=True): | ||
|
|
||
| def model_provider(pre_process=True, post_process=True, ckpt_transfer_model=False): | ||
| """Build the model.""" | ||
|
|
||
| print_rank_0('building GPT model ...') | ||
| see_memory_usage(f"Before Building Model", force=True) | ||
|
|
||
| args = get_args() | ||
| config = core_transformer_config_from_args(args) | ||
|
|
||
| if ckpt_transfer_model: | ||
| return GPTModel(config=config, | ||
| num_tokentypes=0, | ||
| parallel_output=True, | ||
| pre_process=pre_process, | ||
| post_process=post_process) | ||
|
|
||
| with deepspeed.zero.Init(sequence_data_parallel_group=mpu.get_sequence_data_parallel_group(), | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there must be some better solution to init model without init distibute group. please help me .. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The distributed initialization only occurs for
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The problem is |
||
| remote_device=None if args.remote_device == 'none' else args.remote_device, | ||
| config_dict_or_path=args.deepspeed_config, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.