NVIDIA-NeMo / NVIDIA-NeMo/Curator
[Interleaved IO] Allow filter stages to propagate materialized binary content to downstream stages
@VibhuJawa is already working on this.
Since Apr 2, 2026.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 327
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 30
Description
Problem
When materialize_on_read=False (the previous default), WDS pipelines with a filter stage suffer a double-fetch: images are read from the tar archive twice.
Stage-level timings on a single 79MB WDS shard (164 images, 56 samples):
| Stage | wds→wds (lazy read) | wds→wds (materialize_on_read=True) |
|---|---|---|
| reader | 0.16s | 3.14s (single fetch here) |
| aspect_ratio_filter | 6.35s (fetches all images to decode dimensions) | 0.30s (binary already present) |
| writer | 5.84s (re-fetches all 164 images again) | 0.40s (binary already present) |
| Total | 17.2s | 8.8s |
Root cause: InterleavedAspectRatioFilterStage decodes each image from the tar to compute width/height, but does not write the decoded bytes back into the binary_content column of the output DataFrame. So image_rows_missing_binary remains 164/164 after the filter, and the writer opens the tar a second time for every image row.
On 80 shards (~10GB), this wastes ~350s of redundant I/O.
Proposed fix
Allow filter stages to persist materialized binary content so downstream stages don't re-fetch. Options:
Option A — Filter writes binary back : After decoding an image to compute aspect ratio, store the decoded bytes in binary_content. Rows that pass the filter already have their binary populated; downstream stages find image_rows_missing_binary=0.
Option A is the simplest: the filter already has the bytes in memory when it decodes for dimension checks — it just needs to populate binary_content before returning the filtered batch.
Impact
- Affects any pipeline: WDS source → filter stage → writer
- No impact on Parquet source pipelines (binary already embedded)
Labels
enhancement, interleaved, performance
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.