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

can eagle support #90

Closed
zhangxy1234 opened this issue Jul 4, 2024 · 6 comments
Closed

can eagle support #90

zhangxy1234 opened this issue Jul 4, 2024 · 6 comments

Comments

@zhangxy1234
Copy link

zhangxy1234 commented Jul 4, 2024

when I inference multi batch, it raise an Error

RuntimeError: output with shape [1, 32, 84, 128] doesn't match the broadcast shape [2, 32, 84, 128]

@hongyanz
Copy link
Contributor

hongyanz commented Jul 8, 2024

Only EAGLE-1 supports bs > 1 now.

@haiduo
Copy link

haiduo commented Jul 8, 2024

Is it because of the dynamic tree attention mechanism that Eagle2 does not support batch size>1?

@Liyuhui-12
Copy link
Collaborator

EAGLE-2 requires some code modifications to support bs>1, so it temporarily does not support bs>1.

@zhangxy1234
Copy link
Author

Only EAGLE-1 supports bs > 1 now.

can you show me an example to use bs = 2 ?

I create model and prompts this way but it raise this error
model = EaModel.from_pretrained(
base_model_path=base_model_path,
ea_model_path=EAGLE_model_path,
torch_dtype=torch.bfloat16,
low_cpu_mem_usage=True,
device_map="auto",
pretraining_tp = 1, # use if tp>1
)

input_ids=model.tokenizer([prompt1,prompt2]).input_ids

RuntimeError: output with shape [1, 32, 44, 128] doesn't match the broadcast shape [2, 32, 44, 128]

@hongyanz

@hongyanz
Copy link
Contributor

You can go to the v1 branch and check here: https://github.com/SafeAILab/EAGLE/tree/v1?tab=readme-ov-file#batch-size--1

@DeclK
Copy link

DeclK commented Aug 13, 2024

EAGLE-2 requires some code modifications to support bs>1, so it temporarily does not support bs>1.

Can you give some hints about how to make EAGLE2 for batch inference? If the tree mask is not the same for different batch, how can we modify this?

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

5 participants