Skip to content

feat(vllm): add deferred model load for overlapped NeMo Gym init - #2750

Merged
yfw merged 1 commit into
mainfrom
yifu/vllm_deferred_load
Jun 10, 2026
Merged

yfw merged 1 commit into
mainfrom
yifu/vllm_deferred_load

Conversation

@yfw

@yfw yfw commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Port the deferred-load mechanism from the super/ultra-v3 lineage (eb401ba), adapted to main's refactored vLLM workers:

  • VllmGeneration: defer_model_load flag; when set, workers only reserve ports and dp_openai_server_base_urls is populated immediately via _collect_reserved_urls(); load_and_start() performs the heavy load later.
  • BaseVllmGenerationWorker: split init into _init_config()/_apply_vllm_patches() /_load_model(); patches now applied for all workers (incl. non-owners).
  • VllmAsyncGenerationWorker: reserve a listening socket in init and hand it to uvicorn via server.serve(sockets=) (no close/rebind race); load_model() and get_reserved_url() added.
  • Add test_vllm_deferred_model_load.

Enables overlapping vLLM model loading with NeMo Gym spinup. Split out from the NeMo Gym integration work so the vLLM mechanism can land and be tested independently. Original PR combining the two #2741

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

Port the deferred-load mechanism from the ultra-v3 lineage (eb401ba),
adapted to main's refactored vLLM workers:

- VllmGeneration: defer_model_load flag; when set, workers only reserve
  ports and dp_openai_server_base_urls is populated immediately via
  _collect_reserved_urls(); load_and_start() performs the heavy load later.
- BaseVllmGenerationWorker: split __init__ into _init_config()/_apply_vllm_patches()
  /_load_model(); patches now applied for all workers (incl. non-owners).
- VllmAsyncGenerationWorker: reserve a listening socket in __init__ and hand
  it to uvicorn via server.serve(sockets=) (no close/rebind race); load_model()
  and get_reserved_url() added.
- Add test_vllm_deferred_model_load.

Enables overlapping vLLM model loading with NeMo Gym spinup. Split out from
the NeMo Gym integration work so the vLLM mechanism can land and be tested
independently.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Co-Authored-By: Felipe Vieira Frujeri <[email protected]>
Co-Authored-By: Peter Jin <[email protected]>
Co-Authored-By: Yashaswi Karnati <[email protected]>
@yfw
yfw requested review from a team as code owners June 9, 2026 17:52
@copy-pr-bot

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

@yfw yfw added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Jun 9, 2026
@yfw

yfw commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bc2c3bb

@yfw
yfw merged commit f6e9187 into main Jun 10, 2026
75 of 76 checks passed
@yfw
yfw deleted the yifu/vllm_deferred_load branch June 10, 2026 15:18
pengdurice pushed a commit to pengdurice/RL that referenced this pull request Jun 12, 2026
…DIA-NeMo#2750)

Signed-off-by: Yi-Fu Wu <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Felipe Vieira Frujeri <[email protected]>
Co-authored-by: Peter Jin <[email protected]>
Co-authored-by: Yashaswi Karnati <[email protected]>
ashors1 pushed a commit that referenced this pull request Jun 27, 2026
Signed-off-by: Yi-Fu Wu <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Felipe Vieira Frujeri <[email protected]>
Co-authored-by: Peter Jin <[email protected]>
Co-authored-by: Yashaswi Karnati <[email protected]>
Signed-off-by: Anna Shors <[email protected]>

This branch was previously deployed

2 inactive deployments
test — bc2c3bba Deployed Jun 9, 2026 by copy-pr-bot[bot] via Wait in test approval queue #12154
public — bc2c3bba Deployed Jun 9, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #889
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants