-
Notifications
You must be signed in to change notification settings - Fork 647
Fix TypeError: tuple indices must be integers or slices, not str issue with collate_fn #1011
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 TypeError: tuple indices must be integers or slices, not str issue with collate_fn #1011
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1011
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b3abc95 with merge base dc74267 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @tambulkar! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Appreciate you patching this. Actually we should go the other way - we are standardizing on outputting dictionaries for each sample now instead of a tuple of list[int].
and the return types need to be updated. That should be all that needs to change. Since you're already here you can do this or I can make the change, let me know how you want to proceed :) |
I can go ahead and amend this PR - give me a few minutes |
you'll need to update |
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.
so glad you caught this early, thanks for jumping on a fix! were you able to launch your run successfully?
Confirmed it runs on my end with the changes by running one of the built-in configs with wikitext |
My run works as well! |
…e with collate_fn (pytorch#1011)
…e with collate_fn (pytorch#1011)
I observed that 1. When CP is used without other data parallel (`dp_replicate` / `dp_shard`), it works fine with and without torch.compile 2. When CP is combined with any other data parallel, it only works without torch.compile. It would fail under compile, with error info like "_UnboundLocalError: cannot access local variable 'buf899' where it is not associated with a value_" So I'm marking CP as "to be fixed".
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
#1010
Changelog
What are the changes made in this PR?
Change indexing
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