Skip to content

feat(embed): auto-select NVFP4 in batch mode when every Ray GPU is Blackwell - #2844

Closed
jioffe502 wants to merge 2 commits into
mainfrom
devin/1794328046-batch-nvfp4-autoselect
Closed

jioffe502 wants to merge 2 commits into
mainfrom
devin/1794328046-batch-nvfp4-autoselect

Conversation

@jioffe502

Copy link
Copy Markdown
Collaborator

Description

Today: batch (Ray) ingest always embeds with the BF16 Nemotron 3.5 checkpoint, even on Blackwell clusters where the faster NVFP4 checkpoint would work. The Ray driver can't see which GPUs the workers have, so main turned automatic NVFP4 selection off in batch mode.

This PR: before any embed actor starts, the driver sends one tiny Ray task to each alive GPU node. Each task reads the GPU compute capability through NVML, which does not open a CUDA context or use GPU memory. The run uses NVFP4 only if every GPU on every node is compute capability 10 or newer. Anything else gives BF16, which is today's behaviour: an older GPU, a probe error or timeout, or no GPU nodes. The answer is cached for the driver process. One decision then covers the whole run, so the embed actors and the LanceDB table always record the same model.

  • resolve_local_embed_model(..., native_nvfp4: bool | None = None) replaces allow_native_nvfp4. None checks the local CUDA devices (unchanged for in-process runs). A bool is used as given.
  • In batch mode the nvidia/nemotron-3.5-embed-1b alias now gets the same automatic choice as an omitted model, instead of being pinned to BF16 at plan time.

Scope: local GPU embedding in batch mode. Unchanged: in-process selection, explicit precision checkpoint IDs, remote/NIM embedding, and the LanceDB append guard. Appending to an existing table recorded with a different model still raises and asks for the table's model.

Why it matters (from earlier measurements, not this PR's runs): NVFP4 vs BF16 was 7–10% faster end to end on dc10k, bo767 and ViDoRe, with recall within about ±0.002. The vectors differ slightly, so a table built with one precision should not be appended with the other. The existing guard already prevents that.

Tests: unit tests cover the probe (all Blackwell, all Hopper, mixed nodes, no GPU nodes, NVML error, timeout) and batch resolution (actor and sink agree, explicit IDs kept, the driver's own GPUs never consulted). The probe was also run against a real local Ray cluster with no NVIDIA driver, and it returned False (BF16).

Pending: main vs PR batch evals on a 2x RTX PRO 6000 box (results will be added here).

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/59950d3fd2b64af4907fd9435d6f9b3c
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/59950d3fd2b64af4907fd9435d6f9b3c?variant=devin
Requested by: @jioffe502

@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

@devin-ai-integration

Copy link
Copy Markdown
Contributor

CI note on head 17a752c. All three red checks also fail on other open PRs, so they predate this change:

Written by Devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Closing in favour of #2834, which gets the same NVFP4 auto-select for single-node runs with far less code. The per-node probe only matters for multi-node Ray, which NRL doesn't support. Branch kept for reference.

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