-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 pipeline parallel for glm-4-9b-chat #11463
Conversation
714ea50
to
e0f3be7
Compare
inputs_embeds = self.embedding(input_ids) | ||
else: | ||
batch_size, seq_length, _ = inputs_embeds.shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If attention_mask is given a not-None and not-All value, input_ids
is needed in line 58 self.get_masks()
and it will raise error if input_ids
is still None. Maybe add an empty tensor here?
input_ids = torch.empty((batch_size, seq_length), device=inputs_embeds.device)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relative code in modeling_chatglm:
def get_masks(self, input_ids, past_key_values, padding_mask=None):
batch_size, seq_length = input_ids.shape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If attention_mask is given a not-None and not-All value,
input_ids
is needed in line 58self.get_masks()
and it will raise error ifinput_ids
is still None. Maybe add an empty tensor here?
Have updated in chatglm2.py
and chatglm4.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Support pipeline parallel inference & serving for glm-4-9b-chat
2. User API changes
N/A
4. How to test?