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

Changing llama_v2_70b to correct config class #2588

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JasonMts
Copy link
Contributor

@JasonMts JasonMts commented Feb 7, 2025

The model llama_v2_70b fails to install with ValueError: Unrecognized configuration class because it has been listed as the wrong config class. It should be listed as a Causal Language Model instead.

@atalman
Copy link
Contributor

atalman commented Mar 10, 2025

Hi @JasonMts could you please include link to a failure and to fixed workflow ?

@JasonMts
Copy link
Contributor Author

Hi @atalman

With torch 2.6.0:

Error message log before fix:

python benchmark/install.py llama_v2_70b --canary -v

checking packages numpy, torch, torchvision, torchaudio are installed, generating constaints...OK
running setup for /home/user/benchmark/torchbenchmark/canary_models/llama_v2_70b...Traceback (most recent call last):
  File "/home/user/benchmark/torchbenchmark/canary_models/llama_v2_70b/install.py", line 7, in <module>
    cache_model(model_name)
  File "/home/user/benchmark/torchbenchmark/util/framework/huggingface/patch_hf.py", line 15, in cache_model
    download_model(name)
  File "/home/user/benchmark/torchbenchmark/util/framework/huggingface/basic_configs.py", line 310, in download_model
    model = model_cls.from_config(config, **kwargs)
  File "/home/user/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 440, in from_config
    raise ValueError(
ValueError: Unrecognized configuration class <class 'transformers.models.llama.configuration_llama.LlamaConfig'> for this kind of AutoModel: AutoModelForMaskedLM.
Model type should be one of AlbertConfig, BartConfig, BertConfig, BigBirdConfig, CamembertConfig, ConvBertConfig, Data2VecTextConfig, DebertaConfig, DebertaV2Config, DistilBertConfig, ElectraConfig, ErnieConfig, EsmConfig, FlaubertConfig, FNetConfig, FunnelConfig, IBertConfig, LayoutLMConfig, LongformerConfig, LukeConfig, MBartConfig, MegaConfig, MegatronBertConfig, MobileBertConfig, MPNetConfig, MraConfig, MvpConfig, NezhaConfig, NystromformerConfig, PerceiverConfig, QDQBertConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, SqueezeBertConfig, TapasConfig, Wav2Vec2Config, XLMConfig, XLMRobertaConfig, XLMRobertaXLConfig, XmodConfig, YosoConfig.
FAIL
Error for /home/user/benchmark/torchbenchmark/canary_models/llama_v2_70b:

None

Traceback (most recent call last):
  File "/home/user/benchmark/install.py", line 127, in <module>
    raise RuntimeError("Failed to complete setup")
RuntimeError: Failed to complete setup

After fix, model installs but does not fit into a runner with 120 GB memory so can’t show success.

python benchmark/install.py llama_v2_70b --canary -v

checking packages numpy, torch, torchvision, torchaudio are installed, generating constaints...OK
running setup for /home/user/benchmark/torchbenchmark/canary_models/llama_v2_70b...FAIL
Error for /home/user/benchmark/torchbenchmark/canary_models/llama_v2_70b:

None

Traceback (most recent call last):
  File "/home/user/benchmark/install.py", line 127, in <module>
    raise RuntimeError("Failed to complete setup")
RuntimeError: Failed to complete setup

Memory usage with htop:

image

@facebook-github-bot
Copy link
Contributor

@atalman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@JasonMts JasonMts force-pushed the fix_unrecognized_config_class branch from 8040ae3 to 4d9efc5 Compare March 24, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants