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

Iterable Datasets work with TPUs #17321

Closed
gkroiz opened this issue Apr 11, 2023 · 1 comment · Fixed by #17331
Closed

Iterable Datasets work with TPUs #17321

gkroiz opened this issue Apr 11, 2023 · 1 comment · Fixed by #17331
Labels
accelerator: tpu Tensor Processing Unit feature Is an improvement or enhancement help wanted Open to be worked on
Milestone

Comments

@gkroiz
Copy link
Contributor

gkroiz commented Apr 11, 2023

Bug description

The error TPUs do not currently support IterableDataset objects, the dataset must implement len. HINT: You can mock the length on your dataset to bypass this error. is raised when using IterableDatasets on TPUs (code location for fabric and pytorch). At the time this error was introduced (#6875), there was a line in the xla code that would call for len(). However, this issue from the xla side was fixed shortly after in pytorch/xla#2866. #6955 was then submitted to request a fix for the error check, but was never resolved. Since #6955 is from two years ago and I am unable to open the issue, I wanted to revive this topic in a new issue.

For reference, I ran into this warning when running the dqn lightning tutorial on TPU(s).

Unless there is a good reason to keep this error check, can we either remove it entirely or adjust it to a warning saying something along the lines of "If you want to use len() on your IterableDataset, you will need to manually implement len()?

What version are you seeing the problem on?

1.6.x, 1.7.x, 1.8.x, 1.9.x, 2.0+

cc @Borda @JackCaoG @steventk-g @Liyang90 @carmocca

@gkroiz gkroiz added bug Something isn't working needs triage Waiting to be triaged by maintainers labels Apr 11, 2023
@carmocca carmocca self-assigned this Apr 11, 2023
@carmocca carmocca added feature Is an improvement or enhancement accelerator: tpu Tensor Processing Unit and removed bug Something isn't working needs triage Waiting to be triaged by maintainers labels Apr 11, 2023
@carmocca
Copy link
Contributor

Hi! I think we can just remove this check. Would you like to open a PR?

@carmocca carmocca added this to the future milestone Apr 11, 2023
@carmocca carmocca removed their assignment Apr 11, 2023
@carmocca carmocca added the help wanted Open to be worked on label Apr 11, 2023
@carmocca carmocca modified the milestones: future, 2.1 Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accelerator: tpu Tensor Processing Unit feature Is an improvement or enhancement help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants