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

Ensure shards cannot be larger than 4GB #672

Merged
merged 1 commit into from
May 14, 2024

Conversation

snarayan21
Copy link
Collaborator

Description of changes:

Based on issue #659, users have seen that shards exceeding 4GB are not possible since we are encoding sample byte offsets using uint32, which has a max value of 2**32 - 1. To prevent users from hitting sample access errors much later, we instead will throw an error here.

If there are future use cases that MUST use shards larger than 4GB, we can revisit this and increase the byte offset encoding type to uint64 if applicable. This is currently not the case for any workload we support, including vision.

Added unit tests to all 3 writer types ensuring that the error is thrown correctly.

Issue #, if available:

Merge Checklist:

Put an x without space in the boxes that apply. If you are unsure about any checklist, please don't hesitate to ask. We are here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the contributor guidelines
  • This is a documentation change or typo fix. If so, skip the rest of this checklist.
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the MosaicML team.
  • I have updated any necessary documentation, including README and API docs (if appropriate).

Tests

  • I ran pre-commit on my change. (check out the pre-commit section of prerequisites)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate).
  • I ran the tests locally to make sure it pass. (check out testing)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes.

Copy link
Collaborator

@karan6181 karan6181 left a comment

Choose a reason for hiding this comment

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

LGTM. Thank You!

@snarayan21 snarayan21 enabled auto-merge (squash) May 14, 2024 17:54
@snarayan21 snarayan21 merged commit af8db4f into main May 14, 2024
8 checks passed
@snarayan21 snarayan21 deleted the saaketh/writer_size_limit_error branch May 14, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants