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

Support batch size > 1 #80

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

xwang365
Copy link

Support BatchSize > 1

This PR suppose to support batch size > 1 for Medusa inference model.
This is only a draft for now and need further improvement.

Main change

Update update_inference_inputs tree_decoding generate_candidates to support bs>1

using [PAD] to fill the inputs, such as:

prompt:
          A B C [PAD] [PAD]
          D E F   H     I

plan to squeeze the [PAD] in the middle of inputs when add new tokens to the sequence, such as:

prompt:                                 new_tokens:
          A B C [PAD] [PAD]               X         Y
          D E F   H     I                 Z      [PAD]

new sequence:

          A B C X Y [PAD]    
          D E F H I   Z      

Test:

 python -m medusa.inference.inference_test --model 'FasterDecoding/medusa-vicuna-7b-v1.3'

This PR is marked as draft as there is more work required to get this into a mergable state.

update bs>1 and add server
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

Successfully merging this pull request may close these issues.

None yet

1 participant