-
Notifications
You must be signed in to change notification settings - Fork 488
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
"Reverting to `cfg.model.init_device='cpu'`.") | ||
model_cfg.init_device = 'cpu' | ||
if model_cfg.init_device == 'meta': | ||
init_context = init_empty_weights() |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Allow
mixed
initialization for eval.py in LLM-Foundry. Run onr1z1
here:mpt30b-chat-hf-eval-r1z1-hs6a7u