-
Notifications
You must be signed in to change notification settings - Fork 680
Re-organizing collation utils #1463
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1463
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 17f9899 with merge base 0bdd308 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1463 +/- ##
==========================================
+ Coverage 69.80% 69.97% +0.17%
==========================================
Files 272 270 -2
Lines 13053 13102 +49
==========================================
+ Hits 9111 9168 +57
+ Misses 3942 3934 -8 ☔ View full report in Codecov by Sentry. |
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.
beautiful
Context
What is the purpose of this PR? Is it to
closes #1261, ref #1249
Changelog
This PR:
padded_collate_sft
, to indicate that it is task-specific.left_pad_sequence_function
.padded_collate
, which can be flexibly configured with a choice of base padding function to suit tasks not covered bypadded_collate_sft
. This is demonstrated through the PPO recipe currently, but the tests for the function also show how it could be used for e.g. classification tasks.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. We also have a contributing page for some guidance on contributing.)
pre-commit install
)pytest tests
pytest tests -m integration_test
UX
If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.