Skip to content

feat(dynamo): support native weight transfer - #3178

Open
biswapanda wants to merge 5 commits into
PrimeIntellect-ai:mainfrom
biswapanda:pr/dynamo-inmemory-weight-transfer
Open

feat(dynamo): support native weight transfer#3178
biswapanda wants to merge 5 commits into
PrimeIntellect-ai:mainfrom
biswapanda:pr/dynamo-inmemory-weight-transfer

Conversation

@biswapanda

@biswapanda biswapanda commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Why: Discovery lets Prime-RL generate through Dynamo, but RL training also requires every external inference worker to receive each new trainer weight version. The existing collective setup assumes locally managed engines and cannot safely initialize multi-rank Dynamo workers.

Changes:

  • initialize discovered Dynamo engines through their native collective RPC surface
  • pass each engine's rank offset and world size into NCCL and NIXL initialization
  • route full-model updates through the existing Prime-RL weight-broadcast lifecycle
  • support NCCL and NIXL without deriving ranks from worker URL order
  • pass filesystem weight paths compatibly to external admin endpoints

Dependencies

This branch includes those prerequisite commits because every upstream PR currently targets main. Its effective diff will shrink as the prerequisites merge.

Test plan

  • ruff check on the combined changed surface
  • focused NCCL, rank-mapping, Dynamo discovery, and in-memory transfer tests
  • aggregate validation: 37 focused tests passed

Note

High Risk
Changes NCCL/NIXL process-group membership, broadcast initialization, and weight-update RPC paths for production inference; mis-ranking or world-size mismatch would deadlock or corrupt weights.

Overview
Enables native in-memory weight transfer (NCCL/NIXL) against externally managed Dynamo/vLLM inference instead of only locally launched engines.

Discovery and config: ClientConfig.dynamo_discovery_url discovers admin endpoints and per-engine world_size from /v1/rl/workers (mutually exclusive with admin_base_url and elastic). Shared/orchestrator weight_broadcast.inference_world_size is required for Dynamo and propagated for topology checks; NCCL’s local “≥2 GPUs” guard is skipped when inference is external but an explicit world size is set.

Rank topology: Broadcast init passes per-engine rank_offset, engine_world_size, and optional /collective_rpc (Dynamo path) instead of assuming one GPU per admin URL. vLLM workers map to global ranks via global_inference_rank (TP/PP/DP and dense vs MoE data_parallel_size quirks).

Runtime: New DynamoInferencePool wires discovered topology into NCCL/NIXL init and full weight updates. NCCL checkpoint-format loads preserve layer/state-dict boundaries (receive_state_dicts + layerwise apply). Orchestrator calls policy_inference.init_*_broadcast on the pool abstraction (static, elastic, Dynamo).

Reviewed by Cursor Bugbot for commit ce7ed14. Bugbot is set up for automated code reviews on this repo. Configure here.

@biswapanda
biswapanda marked this pull request as ready for review August 3, 2026 21:37
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