Skip to content

datasets: publish complete index caches atomically - #8196

Open
ZenAlexa wants to merge 2 commits into
NVIDIA:mainfrom
ZenAlexa:contrib/8189-dataset-index-cache-rank-0-crash-mid-numpy-save-leaves
Open

ZenAlexa wants to merge 2 commits into
NVIDIA:mainfrom
ZenAlexa:contrib/8189-dataset-index-cache-rank-0-crash-mid-numpy-save-leaves

Conversation

@ZenAlexa

@ZenAlexa ZenAlexa commented Oct 13, 2026 •

Copy link
Copy Markdown

what changed

stage dataset index arrays on the same filesystem, replace their final paths after all writes finish, and publish the description last. gpt, blended, and masked datasets use the same save path. cache names, formats, and existing read paths stay unchanged.

fixes #8189.

why

an interrupted numpy.save currently leaves a truncated file that passes the cache hit check on restart. staging keeps incomplete writes away from the final paths. a normal restart rebuilds an incomplete cache, and existing readers keep their original mappings during replacement.

this prevents new torn writes. caches already damaged by earlier runs still need rebuilding. power-loss durability and fast-cache-load synchronization are outside this change.

validation

  • the three new gpt, blended, and bert recovery cases fail on main with a truncated-array error and pass with this change.
  • 13 focused checks pass on linux with python 3.12, numpy 1.26.4, and torch 2.8.0a0 using cpu/gloo. these include the existing gpt and cache-preparation checks, including fast loading and deferred mmap. the existing checkpoint-directory fixture was reused. the full gpu test runner remains for ci.
  • four separate process-exit scenarios pass, covering interruption during array writes and between replacements, fresh and existing caches, restart with leftover staging directories, and existing mmap readers.
  • tools/autoformat.sh completed in check mode. black, isort, pylint, and ruff pass. its non-blocking mypy step reports existing type errors and missing imports in the lint environment.

Project CI: Please run the project GPU dataset test runner and its supported shared-filesystem cache cases. The Linux CPU/Gloo recovery, process-interruption, and mmap-reader results above are ready for review.

stage index arrays beside their cache paths and replace them before publishing
the description. interrupted writes leave the final paths readable or absent,
so the next normal build can regenerate an incomplete cache.

cover interrupted gpt, blended, and masked dataset cache writes through dataset
construction, sample reads, and cache reloads.

fixes NVIDIA#8189

Signed-off-by: ZenAlexa <zimingwang945@gmail.com>
Signed-off-by: ZenAlexa <zimingwang945@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ZenAlexa
ZenAlexa marked this pull request as ready for review October 17, 2026 05:44
@ZenAlexa
ZenAlexa requested review from a team as code owners October 17, 2026 05:44
Copilot AI balanced review requested due to automatic review settings October 17, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team October 17, 2026 05:44
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset index cache: rank-0 crash mid-numpy.save leaves torn .npy that passes the isfile cache hit-test — restarted job crashes in dataloader

3 participants