Lightning-AI / Lightning-AI/litData

Interrupt and resume merge_datasets

Open
#784 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
614
Forks
106
Avg merge
15h 8m
Merged PRs (30d)
22

Description

## 🚀 Feature

Being able to interrupt and resume the `merge_datasets` process

### Motivation

When dealing with very large datasets, one cannot run ld.optimize on a single machine at once. Then, the workflow is:

split dataset in pieces -> ld.optimize on every piece (eventually in parallel) -> merge_datasets to reconstruct full dataset

merge_datasets can take a significant amount of time and sometimes crashes (interrupted connection, dead workers). In that situation, it would be great that re-executing merge_datasets doesn't crash but resume the merging operation instead. Right now, I have to delete the written partially merged folder and restart from the beginning.

### Pitch

When `merge_datasets`crashes and i execute it again, instead of failing it should scan the already created folder and resume the merging operation

### Alternatives

In the meantime, would it be viable to "recursively" call `merge_datasets`? Let's say my dataset is split into 20 parts, calling merge_datasets separately on parts 0-4, 5-9, 10-14, 15-19, and then call again merge_datasets on the resulting folders? Would it be equivalent to call merge_datasets only once on everything?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the `merge_datasets` entry point and tracing how it writes the partially merged folder after `ld.optimize` outputs are combined. Reproduce an interrupted merge, then rerun it to determine the existing folder state and define the resume behavior. Done means a rerun continues without deleting completed work and produces the same result as an uninterrupted merge.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.