Skip to content
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

Adding different device intialization to eval #466

Merged
merged 2 commits into from
Jul 19, 2023
Merged

Conversation

bcui19
Copy link
Contributor

@bcui19 bcui19 commented Jul 18, 2023

Allow mixed initialization for eval.py in LLM-Foundry. Run on r1z1 here:

mpt30b-chat-hf-eval-r1z1-hs6a7u

scripts/eval/eval.py Outdated Show resolved Hide resolved
@bcui19 bcui19 requested a review from dakinggg July 19, 2023 16:59
Copy link
Collaborator

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@bcui19 bcui19 merged commit bb0ad42 into main Jul 19, 2023
10 checks passed
"Reverting to `cfg.model.init_device='cpu'`.")
model_cfg.init_device = 'cpu'
if model_cfg.init_device == 'meta':
init_context = init_empty_weights()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! I noticed that when running the quick start example here: https://docs.mosaicml.com/projects/mcli/en/latest/guides/first_llm.html the run fails because init_empty_weights is not defined

----------Begin global rank 7 STDERR----------
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /llm-foundry/scripts/train/train.py:328 in <module>                          │
│                                                                              │
│   325 │   │   yaml_cfg = om.load(f)                                          │
│   326 │   cli_cfg = om.from_cli(args_list)                                   │
│   327 │   cfg = om.merge(yaml_cfg, cli_cfg)                                  │
│ ❱ 328 │   main(cfg)                                                          │
│   329                                                                        │
│                                                                              │
│ /llm-foundry/scripts/train/train.py:203 in main                              │
│                                                                              │
│   200 │   │   cfg.pop('fsdp_config')                                         │
│   201 │   │   fsdp_config = None                                             │
│   202 │                                                                      │
│ ❱ 203 │   init_context = process_init_device(cfg.model, fsdp_config)         │
│   204 │                                                                      │
│   205 │   # build tokenizer                                                  │
│   206 │   tokenizer = build_tokenizer(cfg.tokenizer)                         │
│                                                                              │
│ /llm-foundry/llmfoundry/utils/config_utils.py:70 in process_init_device      │
│                                                                              │
│   67 │   │   │   │   "Reverting to `cfg.model.init_device='cpu'`.")          │
│   68 │   │   │   model_cfg.init_device = 'cpu'                               │
│   69 │   │   if model_cfg.init_device == 'meta':                             │
│ ❱ 70 │   │   │   init_context = init_empty_weights()                         │
│   71 │   │   if model_cfg.init_device == 'mixed':                            │
│   72 │   │   │   if fsdp_config is None:                                     │
│   73 │   │   │   │   raise NotImplementedError(                              │
╰──────────────────────────────────────────────────────────────────────────────╯
NameError: name 'init_empty_weights' is not defined

Just wanted to flag it :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dakinggg dakinggg deleted the fix_mixed_init_eval branch October 11, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants