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

Mistral-7B-Instruct-v0.2 fails for transformers 4.39 #34

Open
hkvision opened this issue Apr 9, 2024 · 5 comments
Open

Mistral-7B-Instruct-v0.2 fails for transformers 4.39 #34

hkvision opened this issue Apr 9, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@hkvision
Copy link
Collaborator

hkvision commented Apr 9, 2024

Error for 4.39.3

Traceback (most recent call last):
  File "/home/arda/kai/webui/text-generation-webui/modules/callbacks.py", line 61, in gentask
    ret = self.mfunc(callback=_callback, *args, **self.kwargs)
  File "/home/arda/kai/webui/text-generation-webui/modules/text_generation.py", line 375, in generate_with_callback
    shared.model.generate(**kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/transformers/generation/utils.py", line 1575, in generate
    result = self._sample(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/transformers/generation/utils.py", line 2697, in _sample
    outputs = self(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/transformers/models/mistral/modeling_mistral.py", line 1157, in forward
    outputs = self.model(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/ipex_llm/transformers/models/mistral.py", line 148, in mistral_model_forward_4_36
    return MistralModel.forward(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/transformers/models/mistral/modeling_mistral.py", line 1042, in forward
    layer_outputs = decoder_layer(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/transformers/models/mistral/modeling_mistral.py", line 757, in forward
    hidden_states, self_attn_weights, present_key_value = self.self_attn(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/ipex_llm/transformers/models/mistral.py", line 528, in mistral_attention_forward_4_36
    return forward_function(
  File "/opt/anaconda3/envs/text-webui-upstream/lib/python3.9/site-packages/ipex_llm/transformers/models/mistral.py", line 806, in mistral_attention_forward_4_36_original
    past_key_value.seen_tokens += key_states.shape[-2]
AttributeError: can't set attribute

Can siucceed for 4.38.2

@jason-dai @shane-huang Seems the upstream is continuously upgrading transformers and our implementation may fail for most models...

@hkvision hkvision added the enhancement New feature or request label Apr 9, 2024
@hkvision
Copy link
Collaborator Author

hkvision commented Apr 9, 2024

image
QWen can run, the initial output is good, but seems output something not related after it should finish...

@hkvision
Copy link
Collaborator Author

hkvision commented Apr 9, 2024

Baichuan2-7b error
image

@hkvision
Copy link
Collaborator Author

hkvision commented Apr 9, 2024

image
Qwen-1.8B seems working well.

@hkvision
Copy link
Collaborator Author

hkvision commented Apr 9, 2024

image
Chatglm3 seems working well.

@github-actions github-actions bot added the stale label May 21, 2024
Copy link

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

@hkvision hkvision reopened this May 22, 2024
@github-actions github-actions bot removed the stale label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant