Skip to content

feat(dynamo): add managed Slurm generation with W&B telemetry - #3391

Merged
yuki-97 merged 21 commits into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/dynamo-slurm-wandb
Aug 19, 2026
Merged

feat(dynamo): add managed Slurm generation with W&B telemetry#3391
yuki-97 merged 21 commits into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/dynamo-slurm-wandb

Conversation

@jthomson04

@jthomson04 jthomson04 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a managed-only Dynamo generation backend for sync and async GRPO on Ray-managed Slurm
  • launch and own etcd, NATS JetStream, the Dynamo frontend, and a fixed Ray-scheduled vLLM worker fleet
  • support NeMo-Gym token translation, NCCL weight refits, cache invalidation, deterministic cleanup, and W&B generation telemetry
  • add a two-GPU smoke recipe plus a parameterized six-node Nemotron Nano SWE recipe

This PR is independent of #2990 and targets current main. It excludes Kubernetes, DGD, external Dynamo deployments, and the NeMo-Gym submodule update.

Container

  • derive from the standard NeMo-RL release image
  • skip the NeMo-RL vLLM, SGLang, and TRT-LLM extras and actor environments
  • install only ai-dynamo[vllm]==1.3.0.post1 as the inference backend in isolated Python 3.12 /opt/dynamo_venv
  • install fixed etcd 3.5.21 and NATS Server 2.11.6 binaries
  • assert vLLM 0.23.0 and apply the vLLM PR #44814 layerwise-reload backport with an applicability check and marker

Validation

  • 294 focused unit tests across all changed test files
  • full pre-commit suite, including ruff, format, pyrefly, and recipe minimization
  • root and derived lock validation
  • clean vLLM 0.23.0 patch applicability/apply/reverse check
  • successful standard base and derived Dynamo image builds
  • inspected the loaded base image, main environment, and every Ray actor environment: none contains vLLM, SGLang, TRT-LLM, or ai-dynamo
  • inspected /opt/dynamo_venv: ai-dynamo 1.3.0.post1, vLLM 0.23.0, no SGLang/TRT-LLM, and the #44814 patch present in installed source
  • shell syntax checks and dry runs for both Slurm launchers
  • L1_Functional_Tests_Dynamo green on f270519, asserting max(train/token_mult_prob_error) < 1.05
  • four-step 3n8g Nemotron Nano SWE1 run on H100: train/token_mult_prob_error median 1.0376 / final 1.0477, mean generation KL 0.003654, four refits and four cache invalidations, no leaked managed processes — full report in feat(dynamo): add managed Slurm generation with W&B telemetry #3391 (comment)

@jthomson04
jthomson04 requested review from a team as code owners July 29, 2026 00:07
@copy-pr-bot

copy-pr-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 9fc9146

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Jul 29, 2026
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test b3a726120d635750185175db9ae90be59fab92e8

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test b3a7261

@jthomson04 jthomson04 added the CI:L1 Run doctests, unit tests, and functional tests label Jul 29, 2026
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 9d4f807

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 878db7b

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 3afa5c7

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test c4b2b5c

@jthomson04 jthomson04 mentioned this pull request Jul 29, 2026
4 tasks
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 7224c0d

@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-slurm-wandb branch from 7224c0d to 321c9b5 Compare July 29, 2026 18:32
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 321c9b5

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the managed Dynamo backend — 46 inline comments. Thanks for a genuinely well-built integration: the _ArgvBuilder conflict detection, the git apply --check gate on the vLLM #44814 backport, the pre-flight dynamo.vllm argv validation in the engine's own venv, and FixedDynamoWorkerPool.validate() checking GPU-reservation liveness before every refit are all careful work that most PRs this size don't do.

Most comments open with an explicit action count so you can triage. A few themes:

Correctness — verified, not speculative

  • TRT-LLM silently lost its NeMo-Gym spin-up. The new elif backend == "dynamo": was inserted immediately before the if enable_nemo_gym: block that ended the trtllm branch, so it now belongs to dynamo. The diff renders it as context because the lines are unchanged. grpo.py:1300.
  • No CI shard collects the five new test files (37 tests). Proven by a genuinely failing assert in test_swe_dynamo_r2_config.py:68 sitting green today.
  • NEMO_RL_PY_EXECUTABLES_SYSTEM=1 in both launchers routes MegatronPolicyWorker to an interpreter without megatron-core. That flag's only valid home is the NGC PyTorch image, whose venv is built --system-site-packages; the Dynamo image derives from docker/Dockerfile, which isn't.
  • VLLM_PORT is never forwarded, leaving vLLM's TP rendezvous port kernel-ephemeral — the exact failure #2380 was written to prevent.
  • AREAL-style cache invalidation silently degrades to Magistral-style, because invalidate_kv_cache() runs on the unpickled collector copy where _managed_runtime is None.
  • expert_parallel_size is accepted and ignored; the vLLM backend rejects the same configuration.

Design — worth settling before this lands

The refit is wired as isinstance(policy_generation, DynamoGeneration) branches in the legacy path rather than through WeightSynchronizer, which #2444, #2608 and #2971 all landed through. DynamoGeneration already implements every method CollectiveWeightSynchronizer calls, with matching signatures, so the port is smaller than it looks — and it's the kind of shape that gets much more expensive to change after merge. Related: two state clusters in DynamoGeneration (metrics sampling, refit) have closed state and independent lifecycles, and extracting them would take __setstate__ from 19 attributes to 4.

Feature gaps that fail quietly

Speculative decoding, FP8/MXFP8 and NVFP4 all work on the vLLM backend and none work here — but only one of them errors, and on a misleading message. Guards requested; implementing the features is not.

Config and ports

oc.env usage, port bands above the ephemeral floor, engine_world_size being user-supplied where every sibling derives it, and dynamo_python requiring an absolute container path that no other interpreter in the repo does.

Non-blocking follow-ups are tracked in #3459 with stable LE-n ids so comments can point at a specific one; items we're asking for in this PR have been struck there so the two don't disagree.

Happy to be wrong on any of these — several comments are questions rather than findings, and where I couldn't construct a failing case I've said so.

Comment thread nemo_rl/models/generation/dynamo/dynamo_generation.py Outdated
Comment thread tests/unit/models/generation/test_swe_dynamo_r2_config.py Outdated
Comment thread nemo_rl/algorithms/grpo.py
Comment thread examples/swe_bench/run_grpo_nano_v3_5_swe_dynamo_hsg_r2_wandb.sh Outdated
Comment thread nemo_rl/models/generation/dynamo/arguments.py Outdated
Comment thread nemo_rl/models/generation/dynamo/dynamo_generation.py Outdated
Comment thread docker/dynamo/pyproject.toml
Comment thread nemo_rl/models/generation/dynamo/arguments.py Outdated
Comment thread nemo_rl/utils/packed_tensor.py Outdated
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-slurm-wandb branch from 321c9b5 to b80245d Compare August 4, 2026 16:15
@jthomson04
jthomson04 requested a review from a team as a code owner August 4, 2026 16:15
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test b80245d

@github-actions github-actions Bot added the CI Relating to CI label Aug 4, 2026
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-slurm-wandb branch from b80245d to 37a24cc Compare August 5, 2026 21:25
jthomson04 and others added 19 commits August 18, 2026 12:14
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Co-authored-by: Terry Kong <terrycurtiskong@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-slurm-wandb branch from 49e7f97 to e4c8b79 Compare August 18, 2026 19:51
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test e4c8b79

Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test f270519

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. CI is fully green on f270519, including L1_Functional_Tests_Dynamo.

Two non-blocking things I hit while reading the telemetry path are tracked in #3459 rather than held against this PR (summary):

  • LE-20 — no arm64 / GB200 coverage: L1_Functional_Tests_Dynamo is filtered out of the GB200 functional plan and the GB200 image never gets BUILD_DYNAMO=1, though docker/dynamo/install.sh handles arm64 itself.
  • LE-21generation_metrics/* logs each aliased Dynamo gauge next to its surviving vLLM twin, and one alias source went unreachable in e4c8b79b6. Plot noise only.

@yuki-97
yuki-97 enabled auto-merge (squash) August 19, 2026 07:14
@yuki-97
yuki-97 merged commit 85e02cc into NVIDIA-NeMo:main Aug 19, 2026
182 of 185 checks passed
seonjinn added a commit to seonjinn/RL that referenced this pull request Aug 26, 2026
Rebuilds the MXFP8 refit-prequantize path on main's CollectiveSenderSpec
model (NVIDIA-NeMo#3391): the generation side now owns refit buffer geometry, so the
PR's consumer-side buffer_size_bytes plumbing and
_resolve_target_packed_tensor_size are dropped in favor of main's
interfaces, with the producer-side buffer_size_bytes > 0 guard re-added.
Narrows main's grouped-MoE MXFP8 refit guard (NVIDIA-NeMo#3477) to reject only
on-the-fly quantization, letting trainer-prequantized E4M3 slabs pass
through. Rebuilds the refit trigger on main's unconditional
prepare_for_generation structure (NVIDIA-NeMo#2884) while keeping the
MegatronGeneration reshard branch. Adds a sender/receiver MXFP8
bit-equivalence test.

Signed-off-by: seonjinn <sna@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests CI Relating to CI Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants