PR #4912 (2 of 6) ยท
RL head 1cb4fef4 (cited code unchanged at 44035e16) ยท Megatron-LM pinned at e0a4bfed (through Megatron-Bridge ae0a1b02)
disaggregation_role to that config. The field exists only in a Megatron-LM commit newer than the one the repo installs.Two pages on this PR, one question each โ this one: why the engine build fails, and what fixes it.
The Dynamo worker adds two fields to Megatron-LM's engine config through
_inference_config_overrides().
The worker merges them in and calls
InferenceConfig(**kwargs).
At the pinned Megatron-LM, InferenceConfig is a
plain dataclass
with kv_transport_backend but no disaggregation_role.
A dataclass refuses unknown keyword arguments, so the call raises before the engine exists.
The tests miss it because the
mixin test
only compares the returned dict. It never hands that dict to a real InferenceConfig. The
"is the Dynamo integration installed" check
also passes at the pin, because the module it imports does exist there.
๐ฌ review comment C3 โ dynamo_worker_mixin.py:80
Where the fix lands: RL only, in this PR.
The existing check require_megatron_dynamo_integration()
already runs in the worker's constructor, before the model loads. It also checks for the field, so an old Megatron-LM gets a clear error at startup instead of a TypeError at the first refit.
No Megatron-LM bump in this PR: a bump is a large change with convergence risk, so it lands on its own. The feature just needs to say plainly which Megatron-LM it requires.
Nothing below is implemented.
The guard, as pseudocode (proposed, not run)
# dynamo worker constructor, every rank, before the model loads def require_megatron_dynamo_integration(): import megatron.inference.integrations.dynamo.dynamic_engine # today's only check: passes at the pin if "disaggregation_role" not in fields(InferenceConfig): # the field 84c7f168 adds raise RuntimeError("needs Megatron-LM with InferenceConfig.disaggregation_role " "(84c7f168, #9534); use a newer one or drop dynamo")
Plus a CPU test that swaps in a fake InferenceConfig without the field and expects that error. A second Megatron-LM gap later in the stack (ChatRenderer, used by #5097's render workers) gets the same kind of check on #5097.
Do not just delete the field. Without it, a decode engine of a hybrid (Mamba) model keeps the prefix-cache budget that
prefix_caching_mamba_gb gives, and the pinned Megatron-LM then
refuses the KV handoff
at the first refit. The field is what turns that budget off for decode.