Repository navigation
Studio: resolve S3 Parquet audio paths before loading - #18008
danielhanchen merged 7 commits into
Conversation
Signed-off-by: dimitri <[email protected]>
Signed-off-by: dimitri <[email protected]>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 280fad161c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for batch in source.iter_batches(batch_size = 1024): | ||
| writer.write_table( |
There was a problem hiding this comment.
Honor cancellation between Parquet rewrite batches
For a large S3 Parquet shard, a Stop/Cancel request arriving during this loop is ignored until every remaining batch has been read and recompressed: prepare_s3_dataset_download() passes cancel_callback to the download helpers, but not to _rewrite_audio_references() or this rewriter. This can keep a cancelled run busy for minutes and, if training.py::_stop_watchdog_loop force-terminates it, bypass removal of the owned download directory. Thread the cancellation callback through and check it between batches so S3DownloadCancelled reaches the existing cleanup path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing: a cancel during the rewrite still takes effect, since the audio download that follows checks it before every file. The rewrite runs about 5 us per row locally (200k rows in 0.94 s), so the delay is seconds at most and far below the audio download it precedes.
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
S3 audio downloads leave paths in Parquet manifests unchanged. A row pointing to
audio/a.wavstill resolves against the process working directory after the recording is downloaded into a freshunsloth_s3_dataset_*directory. Fulls3://references also bypass the downloaded copy. JSON, JSONL and CSV manifests already use the local paths. The Parquet limitation was noted in the review of #16830.Apply the existing reference resolver to Parquet rows in batches of 1,024, preserving the Arrow schema and Hugging Face feature metadata. Paths use the allocator's actual filenames, including collision suffixes. A completed rewrite replaces the manifest atomically; ambiguity or write errors leave the original intact and remove the staged file. A manifest without matching references stays byte-identical.
The S3 fake now writes real Parquet rather than text under a
.parquetfilename, so the existing download and collision tests continue to exercise valid input.Validation on macOS, Python 3.12.4, datasets 4.3.0 and PyArrow 21.0.0:
datasets.load_datasetround trip preserves Audio features and resolves a WAV whose sample bytes and sample rate are checked.git diff --checkpass.S3 transport is faked. No AWS service call, model training, or GPU run.
Follow-up fixes on this branch:
_mlx_audio_rowsdecoded the clips, so S3 audio training there failed for JSON, JSONL, CSV and Parquet manifests alike. The worker now keeps an S3 audio download until the run ends.test_mlx_s3_audio_download_outlives_the_model_loadfails without this change.