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

Add unbatcher node #1416

Merged
merged 2 commits into from
Dec 30, 2024
Merged

Add unbatcher node #1416

merged 2 commits into from
Dec 30, 2024

Conversation

andrewkho
Copy link
Contributor

Required for #1415

Changes

  • Add Unbatcher node and unit test

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 26, 2024
Copy link

pytorch-bot bot commented Dec 26, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/data/1416

Note: Links to docs will display an error until the docs builds have been completed.

❌ 13 New Failures

As of commit b771bea with merge base 62092dd (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

self._batch_idx = 0

def next(self) -> T:
while self._batch_idx >= len(self._batch):
Copy link
Contributor

@divyanshk divyanshk Dec 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be if instead of while ? i.e. if the _batch_idx overshoots the current _batch, get a new _batch and reset _batch_idx to 0.

EDIT: while also works though, in case the next batch if of size 0 and we want to skip that too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@divyanshk yes i was worried about next batch of size 0 case, although I'm assuming that's unlikely but it's an edge case none the less

@andrewkho
Copy link
Contributor Author

Test failure seems unrelated, not sure what caused this but it seems weird to rely on a particular implementation of the RNG

Copy link
Contributor

@divyanshk divyanshk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andrewkho andrewkho merged commit 88c7b96 into main Dec 30, 2024
39 of 65 checks passed
@andrewkho andrewkho deleted the andrewkh/unbatcher branch December 30, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants