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

MPT: Change order of operands to enable PT2 compile for inference #559

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llmfoundry/models/mpt/modeling_mpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ def forward(
'output_attentions is not implemented for MPT when using attn_impl `flash` or `triton`.'
)

if (attention_mask is not None and
attention_mask[:, 0].sum() != attention_mask.shape[0] and
self.training):
if (self.training and
attention_mask is not None and
attention_mask[:, 0].sum() != attention_mask.shape[0]):
raise NotImplementedError(
'MPT does not support training with left padding.')

Expand Down
Loading