Skip to content
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
b3da856
feat(planner): DGD-owned GPU power caps and budget-aware scaling
kaim-eng Jul 22, 2026
89943ed
fix(ci): cover power-aware-budget example in CODEOWNERS and lychee
kaim-eng Jul 22, 2026
43e118c
chore(ci): retrigger short CI workflows
kaim-eng Jul 22, 2026
18c5857
fix(planner): preserve proposal mask through power clamp
kaim-eng Jul 22, 2026
48937f3
fix(planner): enforce budgets during partial refreshes
kaim-eng Jul 22, 2026
42a305a
fix(planner): stage opposing power rebalances before scale-up
kaim-eng Jul 23, 2026
9c502a1
refactor(planner): init-only static power caps and restore fail-stop …
kaim-eng Jul 23, 2026
0715d2c
refactor(planner): trim power PR scope per review
kaim-eng Jul 23, 2026
17fe40c
fix(planner): complete power review follow-ups
kaim-eng Jul 23, 2026
41e459b
refactor(planner): remove unreachable power fallback
kaim-eng Jul 23, 2026
73cae71
fix(planner): fail closed when power topology changes at runtime
kaim-eng Jul 23, 2026
c6f1548
fix(planner): close generic worker topology guard gap
kaim-eng Jul 23, 2026
1fdee7f
fix(planner): guard cap-only power rollouts
kaim-eng Jul 23, 2026
3b00bdf
fix(planner): share DGD fetch and surface GPU-then-power clamp
kaim-eng Jul 23, 2026
788f6f7
fix(planner): honor static caps and stage clamp-synthesized rebalance…
kaim-eng Jul 23, 2026
8ffbe81
fix(planner): residual GPU clamp for single-role disagg proposals
kaim-eng Jul 23, 2026
60c2518
fix(planner): stop swallowing connector TypeErrors; once-warn rollout…
kaim-eng Jul 23, 2026
d4afb5a
fix(planner): gate residual GPU clamp to power path; fix mypy
kaim-eng Jul 24, 2026
ed3709a
docs(planner): align power cap docs with startup-only reads
kaim-eng Jul 24, 2026
a1699e8
fix(planner): hold residual role at ready when fixed peer exhausts GP…
kaim-eng Jul 24, 2026
8fe7bfa
fix(planner): wait for worker rollout before caching power caps
kaim-eng Jul 24, 2026
1333441
fix(planner): mask empty power holds at actuation
kaim-eng Jul 24, 2026
41947e5
fix(planner): fail closed on power topology drift
kaim-eng Jul 24, 2026
832ade2
fix(planner): align power settlement with cap resolution
kaim-eng Jul 24, 2026
849ed5c
fix(planner): keep power caps startup-static
kaim-eng Jul 25, 2026
bf02fd8
fix(planner): reject enable_power_awareness with mode=agg
kaim-eng Jul 26, 2026
601aec0
docs(planner): document mode=agg restriction for power awareness
kaim-eng Jul 26, 2026
d28d081
style(planner): move inline imports to module scope, use lazy log for…
kaim-eng Jul 27, 2026
864ea20
fix(planner): derive DCD names from worker hash, not componentNames
kaim-eng Jul 27, 2026
3fff1c9
fix(planner): probe v1 worker hash before v2 for DCD settlement
kaim-eng Jul 27, 2026
aa09376
fix(planner): verify DGD power caps on worker pods
kaim-eng Jul 28, 2026
34f0f98
docs(planner): remove DCD/Grove residue from docstrings and test comm…
kaim-eng Jul 28, 2026
2f4ab9b
fix(planner): harden DGD power-budget startup and error paths
kaim-eng Jul 28, 2026
895b107
fix(planner): address PR review P1/P2/P3 for DGD power-budget stability
kaim-eng Jul 28, 2026
f84d461
fix(planner): address PR review items for DGD power-budget
kaim-eng Jul 28, 2026
4866fdd
fix(planner): address P1/P2/P3 review findings from PR #12012
kaim-eng Jul 29, 2026
010018e
fix(planner): close residual review gaps from DGD power-budget PR
kaim-eng Jul 29, 2026
2d18408
fix(planner): address pre-approval review findings for DGD power-budget
kaim-eng Jul 29, 2026
13cd948
fix(planner): restore PlannerConnector compat; gate check_terminating…
kaim-eng Jul 30, 2026
3983b3d
fix(planner): address offline-clarified review findings for DGD power…
kaim-eng Jul 30, 2026
29379be
operator/admission: move power validation to Go
sttts Jul 31, 2026
7ea605a
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
2f6f5ff
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
dd76e3a
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
183f616
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
eff8c19
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
a7c382e
fixup! operator/admission: move power validation to Go
sttts Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/codeowners/areas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ areas:
- examples/global_planner/
- aisimulate/
- examples/aisimulate/
- examples/power-aware-budget/
- label: runtime
github_team: '@ai-dynamo/dynamo-runtime-codeowners'
path_globs:
Expand Down
3 changes: 3 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@
# tree/main link in templates/dgdr.mdx 404s from CI until the PR is merged.
^https://github\.com/ai-dynamo/dynamo/tree/main/examples/deployments/dgdr$

# This example is introduced by the same PR as its docs link, so the main-branch
# URL returns 404 until merge.
^https://github\.com/ai-dynamo/dynamo/tree/main/examples/power-aware-budget$
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
/aisimulate/ @ai-dynamo/dynamo-planner-codeowners
/examples/aisimulate/ @ai-dynamo/dynamo-planner-codeowners
/examples/global_planner/ @ai-dynamo/dynamo-planner-codeowners
/examples/power-aware-budget/ @ai-dynamo/dynamo-planner-codeowners
/components/src/dynamo/planner/ @ai-dynamo/dynamo-planner-codeowners
/components/src/dynamo/profiler/ @ai-dynamo/dynamo-planner-codeowners
/components/src/dynamo/planner/core/ @ai-dynamo/dynamo-planner-codeowners
Expand Down
17 changes: 17 additions & 0 deletions components/src/dynamo/planner/config/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,23 @@ class SLAPlannerDefaults(BasePlannerDefaults):
# Advisory mode: compute and log decisions without executing scaling
advisory = False

# Power-aware scaling (disabled by default for backward compat).
#
# Per-GPU caps are DGD-owned: authored on each worker component's
# ``podTemplate.metadata.annotations`` (``dynamo.nvidia.com/gpu-power-limit``),
# stamped onto Pods by the operator, and enforced by the Power Agent. The
# planner only reads them. It does NOT own or write per-GPU caps, so no
# per-GPU / safe-default / sweep-interval fields live here — the planner
# config carries only the deployment-wide budget. Power inputs are
# process-static: DGD admission protects the per-component tuple, and a
# total-budget change requires a Planner restart.
#
# ``total_gpu_power_limit`` is required when ``enable_power_awareness=True``
# (validator enforces). Default None — not a placeholder integer — so the
# type itself signals "operator must set".
enable_power_awareness: bool = False
total_gpu_power_limit: Optional[int] = None


class SubComponentType(str, Enum):
PREFILL = "prefill"
Expand Down
70 changes: 67 additions & 3 deletions components/src/dynamo/planner/config/planner_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,42 @@ def _validate_ca_bundle_path(cls, v: Optional[str]) -> Optional[str]:
# Advisory mode: compute and log decisions without executing scaling
advisory: bool = SLAPlannerDefaults.advisory

# --- Power-aware budget (read-only caps; DGD-owned) ---
#
# Per-GPU caps are NOT configured here. They are authored on each worker
# component's ``podTemplate.metadata.annotations``
# (``dynamo.nvidia.com/gpu-power-limit``), applied to Pods by the operator,
# and enforced by the Power Agent. The planner reads those caps from the DGD
# and combines them with ``total_gpu_power_limit`` to project and clamp a
# power budget. It never writes per-GPU caps. These inputs are
# process-static; changing the total budget requires a Planner restart.
enable_power_awareness: bool = Field(
default=False,
description=(
"Enable power-aware budget projection and budget-gated replica "
"scaling. Per-GPU caps are read from DGD worker podTemplate "
"annotations; this planner combines them with total_gpu_power_limit "
"to publish power-budget gauges and clamp scale-up. Requires "
"total_gpu_power_limit, environment='kubernetes', and "
"mode in ('disagg', 'prefill', 'decode'). Not supported for "
"mode='agg'."
),
)
total_gpu_power_limit: Optional[int] = Field(
default=None,
ge=1,
description=(
"Total GPU power budget in watts for this DGD. Required when "
"enable_power_awareness=True; changing it requires a Planner "
"restart. Recommended formula: "
"(rack_capacity_W × headroom_factor) − non_gpu_overhead with "
"headroom_factor ≈ 0.85–0.9. Used for the power-budget gauges and "
"as the projected ceiling the final budget clamp holds scaling to — "
"a bound on projected draw from the requested caps, not a proven "
"hardware limit (see the Power Agent for effective enforcement)."
),
)

# Diagnostics report settings
report_interval_hours: Optional[float] = Field(
default=24.0,
Expand Down Expand Up @@ -645,15 +681,16 @@ def _validate_ca_bundle_path(cls, v: Optional[str]) -> Optional[str]:
default=8080,
description=(
"Port for the live diagnostics dashboard HTTP server. "
"Set to 0 to disable. When enabled, visit http://host:port/ "
"to view a real-time Plotly report of accumulated snapshots."
"Set to 0 to disable. When enabled, visit "
"http://<host>:<port>/ to view a real-time Plotly report of "
"accumulated snapshots."
),
)

scheduling: SchedulingConfig = Field(
default_factory=SchedulingConfig,
description=(
"Plugin-pipeline scheduling config — see ``SchedulingConfig`` " "docstring."
"Plugin-pipeline scheduling config — see ``SchedulingConfig`` docstring."
),
)

Expand Down Expand Up @@ -752,6 +789,33 @@ def _validate_config(self) -> "PlannerConfig":
f"got {self.fpm_sample_bucket_size}"
)

# Power-awareness validation. Per-GPU caps come from DGD worker
# podTemplate annotations, not this config, so the only required knob
# is the total budget — and a Kubernetes connector to read the DGD.
if self.enable_power_awareness:
if self.total_gpu_power_limit is None:
raise ValueError(
"total_gpu_power_limit is required when enable_power_awareness=True. "
"Recommended: (rack_capacity_W × headroom_factor) − non_gpu_overhead "
"with headroom_factor ≈ 0.85–0.9. Setting this incorrectly "
"could silently cap your cluster — there is no safe default."
)
if self.environment != "kubernetes":
raise ValueError(
"enable_power_awareness=True requires environment='kubernetes'. "
"Per-GPU caps are read from DGD worker podTemplate annotations, "
"which only the Kubernetes connector resolves; virtual/replay and "
"global-planner modes have no DGD with authoritative caps."
)
if self.mode == "agg":
raise ValueError(
"enable_power_awareness=True is not supported with mode='agg'. "
"The Kubernetes deployment-validation and GPU-count paths use the "
"typed decode role resolver, which does not follow the generic "
"type:worker fallback used by the power parser. Power awareness "
"is supported for mode='disagg', 'prefill', and 'decode'."
)

if self.environment == "global-planner" and not self.global_planner_namespace:
raise ValueError(
"global_planner_namespace is required when environment='global-planner'. "
Expand Down
78 changes: 76 additions & 2 deletions components/src/dynamo/planner/connectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@

from __future__ import annotations

from typing import Optional, Protocol
import inspect
from typing import TYPE_CHECKING, Optional, Protocol, TypeGuard, runtime_checkable

from dynamo.planner.config.defaults import SubComponentType, TargetReplica
from dynamo.planner.monitoring.worker_info import WorkerInfo

if TYPE_CHECKING:
from dynamo.planner.monitoring.dgd_services import ComponentPowerConfig


class WorkerInfoProvider(Protocol):
def get_worker_info(
Expand Down Expand Up @@ -68,4 +72,74 @@ async def set_component_replicas(
pass


__all__ = ["PlannerConnector", "WorkerInfoProvider"]
@runtime_checkable
class PowerAwareConnector(Protocol):
"""Narrow read-only power capability — Kubernetes-specific, not part of PlannerConnector.

The environment calls ``is_power_aware_connector(controller)`` at each
power-aware boundary when ``enable_power_awareness=True``. All four methods
must be present and callable; a typo or absent method is caught at that check
rather than silently falling back to a no-op.
"""

def get_graph_deployment(self) -> dict:
...

def get_component_power_configs(
self,
require_prefill: bool = True,
require_decode: bool = True,
prefill_component_name: Optional[str] = None,
decode_component_name: Optional[str] = None,
deployment: Optional[dict] = None,
) -> tuple[Optional[ComponentPowerConfig], Optional[ComponentPowerConfig]]:
...

async def wait_for_settled_graph_deployment(
self,
include_planner: bool = False,
*,
require_prefill: bool = True,
require_decode: bool = True,
prefill_component_name: Optional[str] = None,
decode_component_name: Optional[str] = None,
) -> dict:
...

async def get_power_aware_worker_counts(
self,
prefill_component_name: Optional[str] = None,
decode_component_name: Optional[str] = None,
) -> tuple[int, int, bool]:
...


_POWER_AWARE_REQUIRED: tuple[str, ...] = (
"get_graph_deployment",
"get_component_power_configs",
"wait_for_settled_graph_deployment",
"get_power_aware_worker_counts",
)


def is_power_aware_connector(obj: object) -> TypeGuard[PowerAwareConnector]:
"""Return True if ``obj`` is a ``PowerAwareConnector``.

Uses ``inspect.getattr_static`` (so the check is correct on Python < 3.12,
where ``isinstance(..., Protocol)`` may return True for objects such as an
unrestricted ``MagicMock`` that satisfy the protocol only via
``__getattr__``). Each attribute must also be callable to exclude
non-callable class-level sentinels.
"""
return all(
callable(inspect.getattr_static(obj, name, None))
for name in _POWER_AWARE_REQUIRED
)


__all__ = [
"PlannerConnector",
"PowerAwareConnector",
"WorkerInfoProvider",
"is_power_aware_connector",
]
Loading
Loading