-
Notifications
You must be signed in to change notification settings - Fork 494
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
Fix the Gemma generation #1094
Fix the Gemma generation #1094
Conversation
Fix the problem in generation. Aligned with https://github.com/pytorch/torchtune/blob/main/torchtune/modules/transformer.py .
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1094
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1b204e2 with merge base 66d1a9c (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Using |
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.
You're right that this should match the core TransformerDecoder module, since Gemma's is using the shared TransformerDecoderLayer and CausalSelfAttention. We enforced that the mask be a certain shape after the sample packing updates.
Actually while you're here, do you mind updating the docstrings as well to match TransformerDecoder? I'll approve and run CI in the meantime.
Update docstring.
Yeah, I Update the docstrings. |
Sorry, there are some problems with docstring. I will modify it soon. |
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.
Fix the issue.
Workflow test failure is related to tensorflow/tensorboard#6869, not anything wrong with this PR. Investigating now |
@solitude-alive Can you rebase on main? I just merged #1095, which should allow the workflows here to pass. |
Yeah, I merged main manually, is this work? |
Fix the problem in generation.
Aligned with https://github.com/pytorch/torchtune/blob/main/torchtune/modules/transformer.py .
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
Changelog
What are the changes made in this PR?
mask = self.causal_mask[None, None, input_pos]
tomask = self.causal_mask[None, input_pos]
.Make
GemmaTransformerDecoder
aligned withTransformerDecoder
in TransformerDecoder.py .Test plan
Please make sure to do each of the following if applicable to your PR. (If you're not sure about any one of these just ask and we will happily help.)
pre-commit install
)pytest tests
pytest tests -m integration_test