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

Update pipeline parallel serving for more model support #11428

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

plusbang
Copy link
Contributor

@plusbang plusbang commented Jun 25, 2024

Description

As a follow-up to #11319:

  • Move ModelRunner (implementation for pipeline parallel multi-stage serving) to source code
  • Update ModelRunner.load_model for different model support
  • Align ModelRunner.model_step with pipeline_parallel_generate about model forward and past key values
  • Some small fixes about serving example (remove unused function, add license)

1. Why the change?

Align PP serving and inference, therefore verified models in PP inference could be directly used in serving.

2. User API changes

from ipex_llm.transformers import ModelRunner

4. How to test?

  • Unit test
  • Local test (run llama2-7b, baichuan2-13b and chatglm3-6b with pp serving example)

@plusbang plusbang requested review from xiangyuT and sgwhat June 25, 2024 10:25
input_ids = None
inputs_embeds = input

output = self.model(input_ids=input_ids,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to pass attention_mask = make_attention_mask(cur_batch.prompt_lengths).to(input.device) here for batch serving.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to pass attention_mask = make_attention_mask(cur_batch.prompt_lengths).to(input.device) here for batch serving.

Have updated :)

@plusbang plusbang requested a review from hzjane June 27, 2024 06:20
Copy link
Contributor

@xiangyuT xiangyuT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@plusbang plusbang merged commit 987017e into intel-analytics:main Jun 27, 2024
31 checks passed
RyuKosei pushed a commit to RyuKosei/ipex-llm that referenced this pull request Jul 19, 2024
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.

2 participants