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 chunking to ds_tool #97

Merged
merged 31 commits into from
Sep 6, 2024
Merged

Add chunking to ds_tool #97

merged 31 commits into from
Sep 6, 2024

Conversation

liPatrick
Copy link
Contributor

@liPatrick liPatrick commented Aug 23, 2024

Adding chunking to ds_tool so it is more resilient to processing/upload failures for larger datasets.

Dynamically chunks dataset to process and upload. Failed chunks get reprocessed into smaller chunks and recursively go through the same process. Repeated until the chunk_split_threshold is reached, then it gets uploaded as is.

Note:
Push_to_hub automatically shards chunks into roughly 500mb. So in huggingface there will be a chunk and shard denominator, but we can just use a wildcard to set the path for our splits in the README, ie subset_name/split_name/**

@liPatrick liPatrick marked this pull request as ready for review August 23, 2024 18:23
Copy link
Contributor

@farzadab farzadab left a comment

Choose a reason for hiding this comment

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

Loved the DatasetChunkProcessor abstraction. It cleanly separates the concerns without increasing complexity in other areas of the code.

I left too many nit comments, feel free to ignore most, but 2 3 comments are very important:

  1. I feel like _upload would rewrite the whole set which is not desired and
  2. I didn't fully see the "recursive" logic that I thought you mentioned in TGIF. I expected a different approach there.
  3. Make sure dataset.py can handle the Error classes gracefully.

ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
Copy link
Contributor

@farzadab farzadab left a comment

Choose a reason for hiding this comment

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

Thanks Pat.
Left some comments, but approved to unblock you.

ultravox/tools/ds_tool/ds_tool.py Show resolved Hide resolved
ultravox/tools/ds_tool/ds_tool.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/chunked_dataset.py Outdated Show resolved Hide resolved
ultravox/tools/ds_tool/chunked_dataset.py Outdated Show resolved Hide resolved
@liPatrick liPatrick merged commit 96a17f5 into main Sep 6, 2024
1 check passed
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.

3 participants