feat(refit): integrate ModelExpress weight synchronization - #3704
feat(refit): integrate ModelExpress weight synchronization#3704zhengluo-nv wants to merge 7 commits into
Conversation
69e6bd2 to
76d2bd1
Compare
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
76d2bd1 to
d26b92c
Compare
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
|
Two things I hit reading through this, neither an argument against the direction. The first is concrete. ai-dynamo/modelexpress#648 deletes The second is about the E2E. TP1 trainer to TP1 generator doesn't move any shard boundaries, so it isn't really exercising the reshard. The two geometries that caused us trouble were the MoE one (Megatron TP2/EP4 into vLLM TP4) and models where KV heads are fewer than TP -- there the per-rank KV count floors to zero, and most ranks legitimately own no K or V rows at all, so the sparse merge is the whole game. Since this moves Megatron tensor selection into MX, those are the two I'd want green before we swap out a path that's already been through them. Happy to point you at the configs and the reduced 64Q/2KV model if that's useful. |
Yeah, I want to only expose 3 public clients to external, and the receiver will become an internal class. A modularized modelexpress-rl with a handful of simple public APIs should make future framework integration much easier. We will make these public APIs stable during MX version upgrade.
I believe I copied all your code into the new folder. So it should not cause regression on the resharding |
7e59822 to
799c500
Compare
Signed-off-by: Zheng Luo <zheluo@nvidia.com>
799c500 to
ecfa860
Compare
Summary
model_expressas a NeMo-RL weight synchronization transport using the public ModelExpress control, trainer, and generator clientsArchitecture
NeMo-RL owns orchestration and safe points. ModelExpress owns rank-local transport resources and engine-specific transfer/install behavior.
flowchart LR subgraph Driver["NeMo-RL driver"] WS["ModelExpressWeightSynchronizer"] CC["ModelExpressControlClient"] WS --> CC end CP["ModelExpress RefitService<br/>version, shard, worker, lease metadata"] subgraph Policy["Megatron policy worker"] PW["Framework-native policy RPCs"] TC["ModelExpressTrainerClient"] TS["MX Megatron tensor selection"] SB["Registered trainer buffers"] MS["Trainer-local manifest service"] PW --> TC TC --> TS --> SB TC --> MS end subgraph Generator["vLLM generation worker"] GW["Framework-native vLLM RPCs"] GC["ModelExpressGeneratorClient"] ST["Staged NIXL transfer<br/>plan, pull, verify"] VI["vLLM graph-safe installer"] GW --> GC --> ST --> VI end CC -->|"create / inspect / retire version"| CP TC -->|"register worker + publish shard"| CP GC -->|"discover shards + hold lease"| CP GC -->|"fetch exact-version manifest"| MS SB -->|"NIXL reads"| ST WS -->|"publish / update / release RPCs"| PW WS -->|"initialize / update RPCs"| GWLifecycle:
ModelExpressTrainerClientbefore distributed setup so NIXL is initialized before NCCL.Integration boundary
The NeMo-RL orchestrator owns the version lifecycle through
ModelExpressControlClient. Existing framework-native worker RPCs invokeModelExpressTrainerClientinside Megatron policy actors andModelExpressGeneratorClientinside vLLM generator actors. NeMo-RL does not construct ModelExpress adapters or own transfer state.ModelExpress owns:
Dependencies
Current integration heads:
7e598221283a446a6eThe latest GPU E2E validated the compatible pair NeMo-RL
51f7e051dand ModelExpressfec7d02dusing the image below. The NeMo-RL delta to the current head only removes factory-level backend/topology gates and updates focused tests. ModelExpress has additional client, adapter, protobuf, and compatibility changes after the tested SHA, so a repeat GPU E2E on both current heads remains pending.Validation
Current-head automated checks
git diff --checkpassed in both repositoriesThe full NeMo-RL monorepo test suite has not been rerun for this branch.
Latest B200 GPU E2E
Model:
meta-llama/Llama-3.1-8B-Instruct, BF16. Both runs used imagenvcr.io/0980761089281446/model-express-dev-containers:nemo-rl-mx-fec7d02d-51f7e051d-b200-20260819-r2(sha256:0f84554615c7bc1e9fa1ba90c8ba0437572be68a647976361847a9a161e7cb4d) in namespacezheng.TP1 trainer → TP1 generator: lifecycle and redundant publishers
Step 1/1completed; driver exit code 0This run validates the version, lease, manifest, transfer, install, redundant-source, and training lifecycle. Because source and destination are both TP1, it does not exercise shard-boundary resharding.
TP2 trainer → TP1 generator: resharding
w4xnn; one Megatron TP2 group on two GPUs feeds one non-colocated vLLM TP1 generator on the third GPU, with a separate CPU Ray headStep 1/1; final head exit code 0The first TP2 attempt completed training but the 64 GiB CPU head was OOM-killed during teardown. The identical rerun with a 128 GiB CPU-head limit completed cleanly.
The TP1 and TP2 timings are individual functional-run observations, not an A/B performance comparison: generator count, node placement, cache warmth, and head resources differed. Explicit post-transfer parameter equality and generation-parity checks remain pending.
Earlier two-node TP1 smoke
An earlier compatible pair was validated with image
nvcr.io/0980761089281446/model-express-dev-containers:nemo-rl-mx-3cb98ac7-d26b92c02-b200-20260819-r3(sha256:fc14b6f451e4668ca51ef0b4e267e4d714290cb2855fd825906c50cd856fb2a3).rc,cuda_copy)RELEASINGwith no remaining shard or lease recordsA non-fatal interpreter-shutdown warning remained after successful completion; it occurred after the training result and outside the refit data path.