Skip to content

feat: support bounded elastic embedding actor pools in batch mode - #2741

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

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

Conversation

@jioffe502

@jioffe502 jioffe502 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Expose an opt-in bounded embedding actor pool for batch/Ray Data, using Ray's native actor-pool autoscaling. Existing defaults and fixed embed_workers behavior are unchanged.

  • Add embed_workers_min, embed_workers_initial, and embed_workers_max to batch tuning and programmatic ingest-plan options.
  • Require the complete positive ordered range and reject mixing it with fixed workers.
  • Map the range to Ray's (minimum, maximum, initial) concurrency contract. Initial resource admission budgets the initial count without reserving or clamping the maximum.
  • Preserve existing positional IngestEmbedBatchOptions and build_embed_option_kwargs arguments; new builder bounds are keyword-only.
  • Document configuration, logical-resource versus VRAM limits, startup costs, and per-query quality checks.
  • Apply one inherited, AST-unchanged Black wrapping hunk in nemo_agent/agent.py required by the repository-wide formatter, alongside the new validator's formatting fix.

No adaptive default, payback controller, global Ray patch, release gate, device-placement guarantee, Helm change, or new dedicated CLI flag is included.

Validation

  • Parameter/configuration and ingest-plan tests: 63 passed, 3 skipped (ffmpeg unavailable).
  • Root CLI/workflow tests: 105 passed, including positional compatibility and end-to-end option forwarding.
  • git diff --check passes.
  • Final-head 435b74f03 repository unit tests, pre-commit, slim imports, Windows/macOS installs and automated review pass. Docker build/test is still in progress; aggregate validation awaits it. All code checks, including Docker, passed on preceding head a28c932b9.
  • Strict MkDocs build not run: MkDocs is unavailable in the validation environment.

Why the boundary is native opt-in controls

The accompanying investigation found concrete reasons not to promote the experimental phase-aware controller/default:

  • Saved BO767 fixed/calibrated/ungated artifacts contain identical stable page IDs but changed extracted text. All three known rank-boundary pages differ even after whitespace normalization. Query vectors and pre-embedding images were not retained, so extraction, inference, and ANN effects cannot be fully separated. Calibrated Recall@5 loses 2/991, outside the original 0.002 absolute gate; improved nDCG@10 does not cancel that failure.
  • A frozen official-ID BRIGHT psychology pair (52,835 documents, 101 queries, official exclusions, no new chunking) has identical Recall@5/10 but 18 changed exact top-10 lists and 24,204 nonidentical corpus vectors. Shared query vectors, exact float64 L2 retrieval, matched Ray batch boundaries, and physical GPU UUID joins locate the first isolated divergence in corpus inference. No claim of a particular kernel cause is made.
  • Retained BO767/ViDoRe admission arithmetic is internally consistent, but missing timestamps, worker-service inputs, and marginal-decision history prevent a full counterfactual replay. Operator completion is not independently observed physical GPU release. The prototype also lacks pipeline-isolation qualification.

Research GPU runs use a pinned historical Retriever source, not this current-main PR revision. They establish the promotion boundary, not an end-to-end performance claim for this PR. The BRIGHT wall-time comparison is additionally cold/warm-cache confounded.

Completed bounded correctness matrix

Values below are fixed → elastic/calibrated. Recall@5 and nDCG@10 are primary; Recall@10 is always reported.

Dataset / qrels Recall@5 Recall@10 nDCG@10
BO767, retained A1 → A2 0.902119 → 0.900101 0.931382 → 0.931382 0.788273 → 0.788948
BRIGHT psychology, official gold 0.220749 → 0.220749 0.304159 → 0.304159 0.257735 → 0.257803
BrowseComp-Plus, evidence 0.093160 → 0.093160 0.125868 → 0.125868 0.124811 → 0.124811
BrowseComp-Plus, gold 0.120803 → 0.120803 0.162554 → 0.162554 0.120101 → 0.120101

The new text pairs preserve every official retrieval ID, with one vector per document and no new chunking. They use shared frozen query vectors, exact float64 L2 retrieval with stable-ID tie ordering, and checked NeMo/TREC evaluator parity. All output vectors are finite, nonzero, normalized, and uniquely identified. BO767 is a read-only saved-artifact diagnosis, not an unjustified new confirmation run.

BrowseComp includes all 100,195 documents and 830 queries. Both successful arms keep the first 8192 tokens of the prefixed model input (right truncation). An earlier unbounded launch failed closed because the historical VL wrapper ignored its requested input-length setting; the failure is retained and is not a quality retry.

The warmed-cache BrowseComp pair demonstrates useful embedding-plus-parquet scaling: 3248.096 → 2212.881 seconds (31.87% less time; 46.78% more documents/second), and 697.653 → 635.958 sampled GPU Wh (8.84% less). This is one bounded pair, not a full-ingest, controller-payback, statistical, or cross-hardware guarantee. Four actors use two physical GPUs; six use three. No Ray task failures, actor restarts, or object-store spill occurred; cleanup passed.

BrowseComp has no per-query primary-metric loss in either qrel set. Eleven exact top-10 lists change only at unjudged documents. Deeper recall is not invariant: query 1224/document 72114 moves from rank 99 to 105, reducing Recall@100 while Recall@1000 is unchanged. All 3153 observed Ray batch boundaries match; corpus inference is the first isolated divergence before any ANN index. A specific internal kernel cause is not claimed.

Safety remains profile-specific: sampled peak memory reaches 45,042/46,068 MiB with only 1,026 MiB headroom. Logical fractional-GPU reservations are not a memory-safety envelope. Together with the BO767 quality failure and missing controller release/replay/isolation contracts, the evidence supports native opt-in controls and does not support an adaptive default or the experimental controller in this PR.

@copy-pr-bot

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

@jioffe502
jioffe502 marked this pull request as ready for review September 23, 2026 00:18
@jioffe502
jioffe502 requested review from a team as code owners September 23, 2026 00:18
@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previous compatibility and documentation concerns are fully addressed, and no new actionable defect was identified.

Summary

This PR adds opt-in bounded elastic embedding actor pools for Ray Data batch ingestion while preserving fixed-worker defaults and existing positional API behavior.

  • Adds validated minimum, initial, and maximum embedding-worker configuration.
  • Forwards elastic bounds through programmatic ingest plans and runtime node overrides.
  • Budgets the initial actor count during resource preflight without reserving the maximum.
  • Documents configuration, logical resource limits, startup costs, and quality-validation considerations.
  • Adds coverage for validation, runtime mapping, preflight admission, option forwarding, schema descriptions, and positional compatibility.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[BatchTuningParams] --> B{Worker configuration}
    B -->|embed_workers| C[Fixed actor concurrency]
    B -->|min + initial + max| D[Validate complete positive ordered range]
    D --> E[Map to Ray tuple: min, max, initial]
    E --> F[Batch embedding actor pool]
    E --> G[Resource preflight]
    G -->|Budget initial count| H[Admission decision]
    F -->|Scale within bounds| I[Ray Data scheduling]
Loading

Reviews (2) · Last reviewed commit: "Preserve positional embedding option bui..."

@jioffe502
jioffe502 marked this pull request as draft September 23, 2026 03:40
@jioffe502
jioffe502 force-pushed the jioffe502/elastic-embedding-actor-pools branch from 435b74f to 42014a5 Compare October 12, 2026 20:43
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Closing. The embed tail this targeted is fixed by #2837 (async vLLM + 4 batches in flight per actor), which keeps each engine's GPU busy instead of adding engines. A controller that grew embed engines this way was neutral on top of #2837 on ViDoRe, bo767 and dc10k at 8 GPUs, and a 5th engine on 1 GPU gave only +1.3%.

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