Repository navigation
Conversation
…copying it per rank StreamingDataset turned its entries into a list. The trainer passes an Arrow-backed datasets.Dataset, so list() decoded every row into Python objects in every rank, and every forked DataLoader worker then copy-on-wrote the pages it touched. An indexable source is now kept as is; only an iterator is still materialized. On a 3.1M-row Muse-Spark corpus the list measured 80 GB per rank, and with 4 ranks and 8 DataLoader workers each it OOM-killed a trainer node with 950 GB of host memory. On the 3.48M-row corpus of the released Muse-Spark-Open DFlash2 drafter, a trainer node stopped responding 20 steps into training. Kept as Arrow, the rows are memory-mapped and shared by the forked workers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This was referenced Oct 30, 2026
Contributor
Author
|
Folded into #2617 together with #2617's own fix and the other two small fixes, rebased onto |
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.
Stack (merge in this order; each PR's base is the branch of the one before it). [7/7] reproduces nvidia/Muse-Spark-Open-816B-A42B-DFlash2 and needs all of them.
What does this PR do?
Type of change: Bug fix
StreamingDataset.__init__turned its entries into a list. The streaming trainer (examples/speculative_decoding/eagle_utils.py) passes an Arrow-backeddatasets.Dataset, solist()decoded every row of the corpus into Python objects in every rank. Every forked DataLoader worker then copy-on-wrote the pages it touched.An indexable source is now kept as is: its rows stay memory-mapped and are shared by the forked workers. Only an iterator is still materialized. The empty-corpus check moved after the assignment, since a generator is always truthy.
Why it matters. The copy grows with the corpus, the rank count and the worker count:
Usage
No API or config change.
Testing
test_an_indexable_corpus_is_kept_and_an_iterator_materializedintests/unit/torch/speculative/plugins/test_hf_streaming_dataset.py. It fails on the previous code and passes with this change; the file's 19 tests pass (CPU, transformers 5.5.4).Before your PR is "Ready for review"
CONTRIBUTING.md: N/AAdditional Information
🤖 Generated with Claude Code