Skip to content

feat(batch): opt-in elastic actor pools from heuristic bounds - #2775

Closed
jioffe502 wants to merge 5 commits into
mainfrom
devin/1791344324-elastic-actor-pools
Closed

jioffe502 wants to merge 5 commits into
mainfrom
devin/1791344324-elastic-actor-pools

Conversation

@jioffe502

@jioffe502 jioffe502 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds an opt-in actor_pool_mode ("fixed" default | "elastic") to BatchTuningParams, carried on IngestExtractBatchOptions / IngestEmbedBatchOptions as ingest.extract.batch.actor_pool_mode and ingest.embed.batch.actor_pool_mode, so external benchmark runners (e.g. NRB library.settings) can set them. The NRL harness that used to validate these override paths was removed from main in #2777, so this PR no longer touches it.

Today resolve_requested_plan computes per-stage min/initial/max actor counts, but batch_tuning_to_node_overrides sends only *_initial_actors to Ray as a fixed count. With elastic, stages that have no explicit worker count get Ray's native (min, max, initial) tuple from the existing heuristic bounds:

  • extract: PageElementDetectionActor, the OCR actor, TableStructureActor
  • embed: _BatchEmbedActor (stays fixed when local captioning recomputes its budget; min == max emits a plain int, so single-GPU embed is unchanged)

Preflight (_preflight_executor_nodes) admits min for elastic pools, plans the startup count up to initial within the budget, and leaves max untouched so Ray can grow into resources released later. The internal elastic_pool marker is never forwarded to map_batches. Explicit *_workers, remote endpoints, CPU-only runs, GPU fractions, and all non-elastic auto tuples (e.g. StoreOperator) behave exactly as before.

Example on a 2-GPU cluster: PE (2, 20, 6), OCR (2, 20, 6), embed (2, 8, 4), compared with fixed 6 / 6 / 4 today.

Related: #2741 and #2756 add explicit per-stage bounds; this switch reuses the heuristic bounds instead. Exploratory: NRB BO767 campaigns showed mixed results (a gain on 1× H100, no gain on 2× H200, OCR OOMs on 4× L40S), so this isn't proposed for merge as-is.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/8c8e73611f52484a97367e37465678e3
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/8c8e73611f52484a97367e37465678e3?variant=devin

@jioffe502
jioffe502 requested review from a team as code owners October 7, 2026 03:45
@jioffe502
jioffe502 requested a review from edknv October 7, 2026 03:45
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@copy-pr-bot

copy-pr-bot Bot commented Oct 7, 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.

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects actor sizing in batch ingestion workflows.

The PR still needs the existing fix for captioned ingestion on a 2-GPU cluster before merging.

Findings

  1. P1 Captioned ingestion cannot start ▶
Fix with agent prompt
### Issue 1
nemo_retriever/src/nemo_retriever/graph/ingestor_runtime.py:323-327
On a 2-GPU cluster, local captioning, local embedding, and all three extraction stages cannot start with elastic extraction. Each extraction pool now requires at least 2 actors, reserving 0.6 GPUs together. Captioning needs 1 GPU and embedding needs another 0.5, so preflight rejects the 2.1-GPU minimum before processing any documents.

Fixed mode can fit this configuration because each extraction pool can shrink to 1 actor. Adjust the extraction minimums to fit the shared caption and embedding budget.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds opt-in elastic actor pools for batch extraction and embedding.

  • Batch extract and embed pools can grow beyond their startup count.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Batch options] --> B{actor_pool_mode}
    B -->|fixed| C[Existing worker counts]
    B -->|elastic| D{Eligible local GPU stage?}
    D -->|No| C
    D -->|Yes| E[Heuristic minimum, maximum, initial]
    E --> F[Preflight fits startup count]
    F --> G[Ray pool keeps maximum for later growth]
Loading

Reviews (6) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

jioffe502 and others added 4 commits October 12, 2026 21:06
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…overrides

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@jioffe502
jioffe502 force-pushed the devin/1791344324-elastic-actor-pools branch from 42a90df to 89c101c Compare October 12, 2026 21:06
Comment on lines +316 to +320
_set_elastic_pool(
ocr_actor_name,
plan.ocr_min_actors,
plan.ocr_max_actors,
plan.ocr_initial_actors,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Captioned ingestion cannot start

On a 2-GPU cluster, local captioning, local embedding, and all three extraction stages cannot start with elastic extraction. Each extraction pool now requires at least 2 actors, reserving 0.6 GPUs together. Captioning needs 1 GPU and embedding needs another 0.5, so preflight rejects the 2.1-GPU minimum before processing any documents.

Fixed mode can fit this configuration because each extraction pool can shrink to 1 actor. Adjust the extraction minimums to fit the shared caption and embedding budget.

Knowledge Base Used: Graph construction and execution

Prompt To Fix With AI
This is a comment left during a code review.
Path: nemo_retriever/src/nemo_retriever/graph/ingestor_runtime.py
Line: 316-320

Comment:
**Captioned ingestion cannot start**

On a 2-GPU cluster, local captioning, local embedding, and all three extraction stages cannot start with elastic extraction. Each extraction pool now requires at least 2 actors, reserving 0.6 GPUs together. Captioning needs 1 GPU and embedding needs another 0.5, so preflight rejects the 2.1-GPU minimum before processing any documents.

Fixed mode can fit this configuration because each extraction pool can shrink to 1 actor. Adjust the extraction minimums to fit the shared caption and embedding budget.

**Knowledge Base Used:** [Graph construction and execution](https://app.greptile.com/nvidia-public-github/-/custom-context/knowledge-base/nvidia/nemo-retriever/-/docs/graph-construction-and-execution.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

# Conflicts:
#	nemo_retriever/src/nemo_retriever/common/params/utils.py
#	nemo_retriever/src/nemo_retriever/graph/ingestor_runtime.py
#	nemo_retriever/src/nemo_retriever/ingest/plan.py
#	nemo_retriever/tests/test_ingest_plans.py
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Closing. Its own campaign was mixed (gain on 1x H100, none on 2x H200, OCR OOMs on 4x L40S), and Ray Data's native autoscaler doesn't fit our GPU pools: it adds 1 actor per decision at ~1.75 slot occupancy, packed fractional embed actors onto one GPU, and vLLM engines added later fail the free-memory check or OOM. The embed side is covered by #2837.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant