-
Notifications
You must be signed in to change notification settings - Fork 546
feat(dynamo): add managed Slurm generation with W&B telemetry #3391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yuki-97
merged 21 commits into
NVIDIA-NeMo:main
from
jthomson04:jthomson04/dynamo-slurm-wandb
Aug 19, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c0edd40
feat(dynamo): add managed Slurm generation with W&B telemetry
jthomson04 9ee7859
chore: format Dynamo project TOML
jthomson04 2affcf4
chore: register Dynamo arguments with Pyrefly
jthomson04 9d655da
docs: register Dynamo integration in toctree
jthomson04 b40d750
chore: complete Dynamo Pyrefly registration
jthomson04 1fc1d57
fix: make Dynamo SWE recipe independently resolvable
jthomson04 49ad08e
test: account for Dynamo SWE recipe
jthomson04 e984d48
fix(dynamo): address integration review feedback
jthomson04 3bd071f
fix(dynamo): address final review feedback
jthomson04 cb0d501
fix(dynamo): address CI validation failures
jthomson04 17722f4
fix(dynamo): address pending review feedback
jthomson04 553f828
fix(dynamo): align weight initialization timeout
jthomson04 1615f17
fix(dynamo): address follow-up review feedback
jthomson04 e00703a
fix(dynamo): align NCCL across refit peers
jthomson04 7fb3182
fix(dynamo): validate TensorBoard telemetry tags
jthomson04 0e3b665
Update nemo_rl/models/generation/dynamo/token_wrapper.py
jthomson04 cab406b
fix(dynamo): address managed rollout review feedback
jthomson04 f383ac4
fix(dynamo): address managed runtime review feedback
jthomson04 6e26b30
ci: limit Dynamo functional test to H100
jthomson04 e4c8b79
fix(dynamo): address review follow-ups
jthomson04 f270519
fix(dynamo): remove stale refit fallback
jthomson04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) | ||
| project_dir=${NEMO_RL_DYNAMO_PROJECT_DIR:-${script_dir}} | ||
| repo_root=$(realpath "${script_dir}/../..") | ||
| dynamo_venv_dir=${NEMO_RL_DYNAMO_VENV_DIR:-${repo_root}/venvs/dynamo} | ||
| dynamo_python_version=${DYNAMO_PYTHON_VERSION:-3.12.11} | ||
| etcd_version=${ETCD_VERSION:-v3.5.21} | ||
| nats_version=${NATS_VERSION:-v2.11.6} | ||
|
|
||
| target_arch=${TARGETARCH:-} | ||
| if [[ -z "${target_arch}" ]]; then | ||
| case "$(uname -m)" in | ||
| x86_64) target_arch=amd64 ;; | ||
| aarch64) target_arch=arm64 ;; | ||
| *) | ||
| echo "Unsupported host architecture: $(uname -m)" >&2 | ||
| exit 2 | ||
| ;; | ||
| esac | ||
| fi | ||
| case "${target_arch}" in | ||
| amd64|arm64) ;; | ||
| *) | ||
| echo "Unsupported TARGETARCH: ${target_arch}" >&2 | ||
| exit 2 | ||
| ;; | ||
| esac | ||
|
|
||
| uv python install "${dynamo_python_version}" | ||
| uv venv --python "${dynamo_python_version}" "${dynamo_venv_dir}" | ||
| UV_PROJECT_ENVIRONMENT="${dynamo_venv_dir}" uv sync \ | ||
| --directory "${project_dir}" \ | ||
| --locked \ | ||
| --no-dev \ | ||
| --no-install-project \ | ||
| --link-mode copy | ||
|
|
||
| dynamo_python=${dynamo_venv_dir}/bin/python | ||
| vllm_version=$("${dynamo_python}" -c \ | ||
| 'from importlib.metadata import version; print(version("vllm"))') | ||
| if [[ "${vllm_version}" != "0.23.0" ]]; then | ||
| echo "Expected vllm==0.23.0 from ai-dynamo[vllm]==1.3.0.post1; got ${vllm_version}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| vllm_root=$("${dynamo_python}" -c \ | ||
| 'from pathlib import Path; import vllm; print(Path(vllm.__file__).resolve().parent.parent)') | ||
| patch_file=${project_dir}/patches/vllm-0.23.0-layerwise-reload-composed-loader.patch | ||
|
|
||
| # Dynamo 1.3.0 pins vLLM 0.23.0, which predates vLLM PR #44814. | ||
| # Without that fix, composed weight loaders can make layerwise reload finalize | ||
| # a layer early, leaving trailing NemotronH/Mamba2 parameters such as mixer.D | ||
| # unloaded and corrupting logits after a weight refit. | ||
| # Remove this backport only after Dynamo pins a vLLM release containing #44814. | ||
| if git -C "${vllm_root}" apply --check "${patch_file}"; then | ||
| git -C "${vllm_root}" apply "${patch_file}" | ||
| elif [[ -f "${dynamo_venv_dir}/VLLM_BACKPORTS" ]] \ | ||
| && git -C "${vllm_root}" apply --reverse --check "${patch_file}"; then | ||
| echo "vLLM PR #44814 backport is already applied" | ||
| else | ||
| echo "vLLM PR #44814 backport does not apply cleanly to vLLM ${vllm_version}" >&2 | ||
| exit 1 | ||
| fi | ||
| printf '%s\n' \ | ||
| 'vllm PR #44814 merge commit c9e5bf813530fb9ce06024e075da0f520b0718c8' \ | ||
| > "${dynamo_venv_dir}/VLLM_BACKPORTS" | ||
|
|
||
| download_dir=$(mktemp -d "${TMPDIR:-/tmp}/nemorl-dynamo-install.XXXXXX") | ||
| trap 'rm -rf "${download_dir}"' EXIT | ||
|
|
||
| curl --fail --location --retry 3 \ | ||
| "https://github.com/etcd-io/etcd/releases/download/${etcd_version}/etcd-${etcd_version}-linux-${target_arch}.tar.gz" \ | ||
| --output "${download_dir}/etcd.tgz" | ||
| tar -xzf "${download_dir}/etcd.tgz" -C "${download_dir}" | ||
| install -m 0755 \ | ||
| "${download_dir}/etcd-${etcd_version}-linux-${target_arch}/etcd" \ | ||
| "${dynamo_venv_dir}/bin/etcd" | ||
|
|
||
| curl --fail --location --retry 3 \ | ||
| "https://github.com/nats-io/nats-server/releases/download/${nats_version}/nats-server-${nats_version}-linux-${target_arch}.tar.gz" \ | ||
| --output "${download_dir}/nats.tgz" | ||
| tar -xzf "${download_dir}/nats.tgz" -C "${download_dir}" | ||
| install -m 0755 \ | ||
| "${download_dir}/nats-server-${nats_version}-linux-${target_arch}/nats-server" \ | ||
| "${dynamo_venv_dir}/bin/nats-server" | ||
|
|
||
| "${dynamo_python}" -c \ | ||
| 'import importlib.metadata as m; assert m.version("ai-dynamo") == "1.3.0.post1"; assert m.version("vllm") == "0.23.0"; assert m.version("nvidia-nccl-cu13") == "2.30.7"' | ||
| test -s "${dynamo_venv_dir}/VLLM_BACKPORTS" | ||
| grep -Fqx \ | ||
| 'vllm PR #44814 merge commit c9e5bf813530fb9ce06024e075da0f520b0718c8' \ | ||
| "${dynamo_venv_dir}/VLLM_BACKPORTS" | ||
| "${dynamo_venv_dir}/bin/etcd" --version | ||
| "${dynamo_venv_dir}/bin/nats-server" --version |
24 changes: 24 additions & 0 deletions
24
docker/dynamo/patches/vllm-0.23.0-layerwise-reload-composed-loader.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| diff --git a/vllm/model_executor/model_loader/reload/meta.py b/vllm/model_executor/model_loader/reload/meta.py | ||
| index 397a458cb..ad6eceb8a 100644 | ||
| --- a/vllm/model_executor/model_loader/reload/meta.py | ||
| +++ b/vllm/model_executor/model_loader/reload/meta.py | ||
| @@ -185,4 +185,18 @@ def get_numel_loaded( | ||
| """ | ||
| with CopyCounter() as counter: | ||
| return_value = weight_loader(*args.args, **args.kwargs) | ||
| - return counter.copied_numel, return_value | ||
| + | ||
| + # A weight loader fills a single destination parameter, so the number of | ||
| + # loaded elements is at most that parameter's size. Some loaders copy into | ||
| + # the parameter more than once -- e.g. ``composed_weight_loader`` runs an | ||
| + # in-place post-load transform (``param.copy_(fn(param))``) on top of the | ||
| + # initial copy -- which would make CopyCounter report twice the parameter | ||
| + # size. Over-counting inflates the layer's loaded-element total and can | ||
| + # finalize the layer before every parameter is loaded, silently dropping | ||
| + # the trailing parameter(s) (e.g. Mamba ``mixer.D``). Cap the count at the | ||
| + # destination size to keep the per-layer accounting correct. | ||
| + numel = counter.copied_numel | ||
| + param = args.arguments.get("param", None) | ||
| + if isinstance(param, torch.Tensor): | ||
| + numel = min(numel, param.numel()) | ||
| + return numel, return_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [project] | ||
| name = "nemo-rl-dynamo-runtime" | ||
| version = "0.0.0" | ||
| requires-python = "==3.12.*" | ||
| dependencies = ["ai-dynamo[vllm]==1.3.0.post1"] | ||
|
|
||
| [tool.uv] | ||
| package = false | ||
| override-dependencies = ["nvidia-nccl-cu13==2.30.7; sys_platform == 'linux'"] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.