Repository navigation
Conversation
SuryanshSS1011
force-pushed
the
fix-fingerprint-chunk-independent-8327
branch
from
July 16, 2026 19:22
747cab6 to
543ee3e
Compare
Sanjays2402
reviewed
Jul 18, 2026
- Preserve duplicate field names when reconstructing the arrow table
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Elsword016
pushed a commit
to Elsword016/datasets
that referenced
this pull request
Aug 6, 2026
…ce#8339) * Make the dataset fingerprint independent of Arrow chunking * Refactor create_arrowTable to use from_arrays - Preserve duplicate field names when reconstructing the arrow table
sharonyu-115
added a commit
to zhangyimi/RL
that referenced
this pull request
Sep 19, 2026
The PR lockfile refresh resolves datasets 5.0.1 and pyarrow 25.0.1. Datasets 5.0.1 combines Arrow chunks while fingerprinting in-memory tables (huggingface/datasets#8339). NemoGymDataset stores raw JSONL lines in extra_env_info, so large inputs exceed the approximately 2 GiB limit of Arrow string's 32-bit offsets during Dataset.from_dict. This raises ArrowInvalid before training starts. Declare extra_env_info as large_string, which uses 64-bit offsets, and keep task_name as string. Preserve raw JSON values, repetition, and the current dependency versions. Explain the schema choice at the construction site. Validation: four full Slurm runs on 2e13bf9 plus this schema fix passed the original training targets and all nine metric checks: 18926860 (SWE1), 18926861 (RLVR), 18926862 (async SWE1), and 18926863 (MOPD). These are not full-run results for the rebased head. The updated loader is executable-code-identical to that tested fix. CPU smoke job 18928236 verifies the updated checkout with datasets 5.0.1/pyarrow 25.0.1; focused Ruff and Pyrefly checks pass. Signed-off-by: Shuang Yu <[email protected]>
4 tasks done
sharonyu-115
added a commit
to zhangyimi/RL
that referenced
this pull request
Sep 19, 2026
The PR lockfile refresh resolves datasets 5.0.1 and pyarrow 25.0.1. Datasets 5.0.1 combines Arrow chunks while fingerprinting in-memory tables (huggingface/datasets#8339). NemoGymDataset stores raw JSONL lines in extra_env_info, so large inputs exceed the approximately 2 GiB limit of Arrow string's 32-bit offsets during Dataset.from_dict. This raises ArrowInvalid before training starts. Declare extra_env_info as large_string, which uses 64-bit offsets, and keep task_name as string. Preserve raw JSON values, repetition, and the current dependency versions. Explain the schema choice at the construction site. Validation: four full Slurm runs on 2e13bf9 plus this schema fix passed the original training targets and all nine metric checks: 18926860 (SWE1), 18926861 (RLVR), 18926862 (async SWE1), and 18926863 (MOPD). These are not full-run results for the rebased head. The updated loader is executable-code-identical to that tested fix. CPU smoke job 18928236 verifies the updated checkout with datasets 5.0.1/pyarrow 25.0.1; focused Ruff and Pyrefly checks pass. Signed-off-by: Shuang Yu <[email protected]>
This was referenced Nov 13, 2026
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.
Fixes #8327.
As discussed in the issue, the OOM in
Dataset.from_pandascomes fromgenerate_fingerprint, not from the Arrow conversion. Fingerprinting hashesdataset.__dict__, and the underlyingpa.Table(and theInMemoryTablewrapping it) pickles chunk-by-chunk, so the serialized size and the hashing cost scale with the number of chunks rather than the amount of data.shuffle().to_pandas()produces one chunk per row, which is where it really blows up.Following @lhoestq's suggestion to make the table hash chunk-count-independent (rather than calling
combine_chunks()on the stored data), this PR does two things:InMemoryTablenow serializes via its underlyingtableonly. The_batches/_offsetsindex is derived and rebuilt in__init__, so there's no need to pickle it. This mirrors howMemoryMappedTableandConcatenationTablealready define__getstate__/__setstate__.pa.Tableandpa.ChunkedArrayget dill reducers that serialize a chunk-count-independent form. They combine one column at a time, so memory stays bounded and a table with the same data hashes the same regardless of how it's chunked.The combine is transient and per-column, so it never materializes a full extra copy of the table.
Result
On the repro from the issue (25k rows shuffled to one chunk per row),
Dataset.from_pandasgoes from a ~1.5 GB allocation to a few MB. I measured RSS on the scaled 2000-chunk case: the delta acrossfrom_pandasdropped from ~1500 MB to ~4 MB.The fingerprint is now stable across different chunkings of the same data and still distinguishes different data.
pickleround-trips of a dataset reconstruct correctly.tests/test_fingerprint.pyandtests/test_table.pypass (the two failures I see,test_hash_torch_compiled_moduleandtest_move_script_doesnt_change_hash, also fail onmainin my environment and are unrelated).I added
test_hash_arrow_table_is_independent_of_chunkingto cover the invariant.One thing that I would flag is that this changes the fingerprint values for existing datasets, so it will invalidate caches once. This seems unavoidable for a fix that changes how the table is hashed.