Scripts to download HF dataset in arrayrecord or parquet#3315
Open
Scripts to download HF dataset in arrayrecord or parquet#3315
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
07358c6 to
8fb1d8e
Compare
90ceb4d to
5ee8a5a
Compare
|
🤖 Hi @aireenmei, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
This PR adds two useful scripts for downloading and converting Hugging Face streaming datasets to ArrayRecord and Parquet formats. The implementation is well-structured and uses multiprocessing effectively for faster downloads.
🔍 General Feedback
- State Restoration: Fixed a critical bug in the retry mechanism where dataset byte and record tracking variables were not restored from checkpoints, which would have led to duplicate records in the final dataset files.
- Hugging Face Formatting: Suggested enforcing a minimum width of 5 digits when naming files to ensure strict adherence to standard Hugging Face dataset conventions.
- GCS Checkpoints: Identified and resolved an issue where PyArrow Parquet checkpoints were improperly saving to an invalid local directory path (
gs:/...) when using a GCS bucket. Utilizing the PyArrowfsfilesystem handles this elegantly.
41b09d9 to
92c0be6
Compare
NuojCheng
approved these changes
Mar 12, 2026
92c0be6 to
5705275
Compare
5705275 to
86a9696
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add scripts for downloading Hugging Face dataset in ArrayRecord or Parquet formats.
See the docstring in the script for details.
Tests
Use the scripts to download the OptimalScale/ClimbMix dataset
Log output:
Done! Wrote 553,315,056 records to 1665 files in 16245.8sFiles are in
gs://maxtext-dataset/array-record/climbmix/*.arrayrecordlog output:
Done! Wrote 553,315,056 rows in 12535.5sFiles are in
gs://maxtext-dataset/hf/climbmix/*.parquetChecklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.