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

TypeError: LlamaSdpaAttention.forward() got an unexpected keyword argument 'lookahead' #59

Open
zev123456 opened this issue Apr 25, 2024 · 5 comments

Comments

@zev123456
Copy link

run:
USE_LADE=1 LOAD_LADE=1 python minimal.py
result:

Traceback (most recent call last):
  File "/home/workspace/LookaheadDecoding/minimal.py", line 32, in <module>
    greedy_output = model.generate(**model_inputs, max_new_tokens=1)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/lade/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/lade/lib/python3.12/site-packages/transformers/generation/utils.py", line 1718, in generate
    return self.greedy_search(
           ^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/LookaheadDecoding/lade/decoding.py", line 24, in greedy_search_proxy
    return jacobi_greedy_search_multilevel(self, chat=False, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/LookaheadDecoding/lade/decoding.py", line 988, in jacobi_greedy_search_multilevel
    outputs = self.jforward_multilevel(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/LookaheadDecoding/lade/models/modeling_llama.py", line 1519, in jforward_multilevel
    outputs = self.model.LlamaModeljforward(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/LookaheadDecoding/lade/models/modeling_llama.py", line 1224, in LlamaModeljforward
    layer_outputs = decoder_layer(
                    ^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/lade/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/miniconda3/envs/lade/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/workspace/LookaheadDecoding/lade/models/modeling_llama.py", line 864, in forward
    hidden_states, self_attn_weights, present_key_value = self.self_attn.forward(
                                                          ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LlamaSdpaAttention.forward() got an unexpected keyword argument 'lookahead'

how solve this?

@jivanph
Copy link

jivanph commented May 16, 2024

I am having the same issue.

@david-wei-01001
Copy link

I am having the same issue

@david-wei-01001
Copy link

But mine is having an unexpected "padding_mask"
TypeError: LlamaSdpaAttention.forward() got an unexpected keyword argument 'padding_mask'

@jivanph
Copy link

jivanph commented May 17, 2024

I solved this by downgrading my version of transformers. I believe version 4.36.2 (https://pypi.org/project/transformers/4.36.2/) worked for me.

@david-wei-01001
Copy link

Yeah downgrade transformer to version 4.36.2 work for me as well
So I guess this is resolved and the solution is to downgrade transformer to version 4.36.2

The team can close this haha
Thank you very much jivanph

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

No branches or pull requests

3 participants