feat(py + cli): download datasets as files by default, add --zip flag#20
Open
ravivooda wants to merge 1 commit into
Open
feat(py + cli): download datasets as files by default, add --zip flag#20ravivooda wants to merge 1 commit into
ravivooda wants to merge 1 commit into
Conversation
`lightning dataset download` always packaged the version into a .zip via shutil.make_archive, deleting the raw files afterwards. The deflate step dominates wall time on large datasets (~34s of a 48s / 819MB download) and forces users to unzip again before use. Default to downloading the files straight into a directory and gate the archive behind an opt-in `--zip` flag. The `as_zip` option is threaded through the CLI, `datasets.download_dataset`, and `_download_dataset_version` (default False); when set it keeps the previous temp-dir + make_archive behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ravivooda
force-pushed
the
ravivooda/dataset-download-no-zip
branch
from
July 15, 2026 17:56
937da6a to
136a797
Compare
ravivooda
marked this pull request as ready for review
July 16, 2026 23:07
ravivooda
requested review from
ethanwharris,
justusschock and
k223kim
as code owners
July 16, 2026 23:07
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.
What
lightning dataset downloadnow downloads a dataset version's files into a directory by default, and only produces a.zipwhen the new--zipflag is passed.Why
The command always packaged the version into a
.zipviashutil.make_archiveand then deleted the raw files. Two problems:.zipthey must unzip again before the data is usable — there was no way to get the plain files.Change
download_dataset(CLI): output is now<target-path>/<dataset>_<version>/by default;--zipwrites<target-path>/<dataset>_<version>.zip(previous behaviour)._download_dataset_version: newas_zip: bool = Falsekwarg. WhenFalse, files are written straight intotarget_path; whenTrue, the previous temp-dir +make_archivepath is used. Backward compatible (new kwarg defaults off).Test results
Measured against a single-file 819 MB dataset (
MLP_input_output.npy), same payload, cold each run:--no-zip)--zip.zip(760 MB)Breakdown of the old (
--zip) path: ~14.5 s single-stream download + ~34.3 smake_archivedeflate. Dropping the forced zip removes that ~34 s and yields directly-usable files. Downloaded bytes verified byte-identical in both modes (MD5 match).Unit tests
test_download_dataset_version/test_download_dataset_version_no_token_no_cluster— updated to passas_zip=True, keeping coverage of the archive path.test_download_dataset_version_default_downloads_files_no_zip— new: asserts the default does not callmake_archiveand writes files into the target directory.test_dataset_download_help/test_datasets_download_help— updated for the new help text; assert--zipis documented.All 7 pass.
🤖 Generated with Claude Code