feat(vdb): bound batch LanceDB ingestion with Arrow streaming - #2567
feat(vdb): bound batch LanceDB ingestion with Arrow streaming#2567jioffe502 wants to merge 7 commits into
Conversation
Signed-off-by: jioffe502 <jioffe@nvidia.com>
Signed-off-by: jioffe502 <jioffe@nvidia.com>
|
Refreshed this branch onto current Post-merge validation:
The 12-dataset measurements in the PR body remain the source-frozen Architectural scope is now explicit: this PR is LanceDB-first. The Arrow schema, |
Signed-off-by: jioffe502 <jioffe@nvidia.com>
Greptile SummaryThe PR replaces the global LanceDB handoff with coordinated Arrow batch streaming and adds operation tracking, commit validation, and index finalization.
|
| Filename | Overview |
|---|---|
| nemo_retriever/src/nemo_retriever/common/vdb/sink.py | Implements canonical Arrow batching, coordinated LanceDB writes, validation, and finalization. |
| nemo_retriever/src/nemo_retriever/common/vdb/sink_operation.py | Adds durable operation identities and lifecycle markers for safe retry handling. |
| nemo_retriever/src/nemo_retriever/graph/executor.py | Adds capability-driven terminal batch streaming to Ray execution. |
| nemo_retriever/src/nemo_retriever/operators/vdb.py | Exposes bounded-batch consumption for supported VDB ingestion operators. |
| nemo_retriever/src/nemo_retriever/common/vdb/lancedb.py | Adds sink readiness enforcement and phase-level index timing support. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Ray[Ray Dataset blocks] --> Iter[iter_batches]
Iter --> Project[Canonical row projection]
Project --> Pack[Byte-budgeted Arrow batches]
Pack --> Reader[RecordBatchReader]
Reader --> Lance[Single LanceDB mutation]
Lance --> Validate[Validate rows and schema]
Validate --> Index[Build and validate indexes]
Index --> Success[Record operation success]
Iter --> Result[Retained pandas result]
Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile
Signed-off-by: jioffe502 <jioffe@nvidia.com>
3a7a33e to
89ba429
Compare
89ba429 to
29f9c6c
Compare
Why
Batch VDB ingestion currently repartitions the complete embedded Ray dataset into one block before LanceDB starts writing. This creates a corpus-sized handoff and leaves the VDB write and index work until the end of the pipeline.
What this changes
This PR replaces that handoff with one coordinated LanceDB stream:
repartition(num_blocks=1);RecordBatchReaderto one LanceDB data mutation;This is not a per-Ray-block append design. Ray workers do not independently commit, overwrite, or build indices.
The implementation is LanceDB-specific, but the Ray executor is not: it asks the ingest operator whether bounded terminal streaming is supported. Custom VDB implementations and
PutVdbOperatorkeep their existing behavior.Measured result
We ran the existing implementation and this PR through the real
RayDataExecutoron the same source-frozen, CPU-only set of 12 nightly datasets: 197,796 stored rows per arm and 24 completed/validated runs.Correctness checks showed:
Validation
Local validation after merging current
main:Scope of the measurements
These are single-repetition sink-slice measurements, not end-to-end extraction/embedding results or statistically qualified performance claims. The retained inputs contain canonical VDB rows rather than the original wide graph rows.
The public pandas result remains corpus-sized. The configured byte limit bounds canonical Arrow batches owned by the sink; it does not claim a corpus-independent total process RSS bound. The performance matrix covers dense overwrite and indexing.
Detailed design and evidence: bounded Ray Data LanceDB sink research.
Relates to #2476.