Unverified Commit 95c45509 authored by Hongkuan Zhou's avatar Hongkuan Zhou Committed by GitHub
Browse files

refactor: restructure planner package into subpackage hierarchy (#7689)


Signed-off-by: default avatarhongkuanz <hongkuanz@nvidia.com>
parent 68628976
...@@ -17,7 +17,8 @@ import logging ...@@ -17,7 +17,8 @@ import logging
from dataclasses import dataclass from dataclasses import dataclass
from typing import Any, Optional from typing import Any, Optional
from dynamo.planner.defaults import WORKER_COMPONENT_NAMES, SubComponentType from dynamo.planner.config.backend_components import WORKER_COMPONENT_NAMES
from dynamo.planner.config.defaults import SubComponentType
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
from typing import Optional from typing import Optional
from dynamo.planner.utils.decode_planner import DecodePlanner from dynamo.planner.config.planner_config import PlannerConfig
from dynamo.planner.utils.dryrun_plot_utils import create_dryrun_plot from dynamo.planner.core.budget import (
from dynamo.planner.utils.planner_config import PlannerConfig
from dynamo.planner.utils.planner_core import (
PlannerSharedState,
_apply_component_gpu_budget, _apply_component_gpu_budget,
_apply_global_gpu_budget, _apply_global_gpu_budget,
) )
from dynamo.planner.utils.prefill_planner import PrefillPlanner from dynamo.planner.core.decode import DecodePlanner
from dynamo.planner.utils.trace_data_extractor import extract_metrics_from_mooncake from dynamo.planner.core.prefill import PrefillPlanner
from dynamo.planner.core.state import PlannerSharedState
from dynamo.planner.offline.dryrun_plot import create_dryrun_plot
from dynamo.planner.offline.trace_data import extract_metrics_from_mooncake
def run_sla_planner_dryrun( def run_sla_planner_dryrun(
......
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.
...@@ -21,8 +21,8 @@ import os ...@@ -21,8 +21,8 @@ import os
import yaml import yaml
from deploy.utils.dynamo_deployment import DynamoDeploymentClient from deploy.utils.dynamo_deployment import DynamoDeploymentClient
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.planner.utils.planner_config import PlannerPreDeploymentSweepMode from dynamo.planner.config.planner_config import PlannerPreDeploymentSweepMode
from dynamo.profiler.utils.config import Config, get_service_name_by_type from dynamo.profiler.utils.config import Config, get_service_name_by_type
from dynamo.profiler.utils.config_modifiers import CONFIG_MODIFIERS from dynamo.profiler.utils.config_modifiers import CONFIG_MODIFIERS
from dynamo.profiler.utils.config_modifiers.parallelization_mapping import ( from dynamo.profiler.utils.config_modifiers.parallelization_mapping import (
......
...@@ -25,7 +25,7 @@ from aiconfigurator.sdk.picking import pick_autoscale, pick_default, pick_load_m ...@@ -25,7 +25,7 @@ from aiconfigurator.sdk.picking import pick_autoscale, pick_default, pick_load_m
from aiconfigurator.sdk.task import TaskConfig from aiconfigurator.sdk.task import TaskConfig
from deploy.utils.dynamo_deployment import DynamoDeploymentClient from deploy.utils.dynamo_deployment import DynamoDeploymentClient
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.rapid import _generate_dgd_from_pick from dynamo.profiler.rapid import _generate_dgd_from_pick
from dynamo.profiler.utils.aic_dataframe import ( from dynamo.profiler.utils.aic_dataframe import (
build_decode_row, build_decode_row,
......
...@@ -24,7 +24,8 @@ from typing import Any, Optional ...@@ -24,7 +24,8 @@ from typing import Any, Optional
from pydantic import BaseModel from pydantic import BaseModel
from dynamo.common.utils.paths import get_workspace_dir from dynamo.common.utils.paths import get_workspace_dir
from dynamo.planner.defaults import WORKER_COMPONENT_NAMES, SubComponentType from dynamo.planner.config.backend_components import WORKER_COMPONENT_NAMES
from dynamo.planner.config.defaults import SubComponentType
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
......
...@@ -6,7 +6,7 @@ import logging ...@@ -6,7 +6,7 @@ import logging
from dataclasses import dataclass from dataclasses import dataclass
from enum import Enum from enum import Enum
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.utils.defaults import PREFILL_MAX_NUM_TOKENS from dynamo.profiler.utils.defaults import PREFILL_MAX_NUM_TOKENS
from dynamo.profiler.utils.model_info import MOE_ADDITIONAL_TP_ARCHITECTURES, ModelInfo from dynamo.profiler.utils.model_info import MOE_ADDITIONAL_TP_ARCHITECTURES, ModelInfo
......
...@@ -19,7 +19,7 @@ import copy ...@@ -19,7 +19,7 @@ import copy
import logging import logging
from typing import Any, Protocol, Tuple from typing import Any, Protocol, Tuple
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.utils.config import ( from dynamo.profiler.utils.config import (
Config, Config,
Container, Container,
......
...@@ -7,7 +7,7 @@ from typing import Tuple ...@@ -7,7 +7,7 @@ from typing import Tuple
import yaml import yaml
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.utils.config import ( from dynamo.profiler.utils.config import (
Config, Config,
append_argument, append_argument,
......
...@@ -8,7 +8,7 @@ from typing import Tuple ...@@ -8,7 +8,7 @@ from typing import Tuple
import yaml import yaml
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.utils.config import ( from dynamo.profiler.utils.config import (
Config, Config,
append_argument, append_argument,
......
...@@ -6,7 +6,7 @@ from typing import Tuple ...@@ -6,7 +6,7 @@ from typing import Tuple
import yaml import yaml
from dynamo.planner.defaults import SubComponentType from dynamo.planner.config.defaults import SubComponentType
from dynamo.profiler.utils.config import ( from dynamo.profiler.utils.config import (
Config, Config,
append_argument, append_argument,
......
...@@ -23,8 +23,8 @@ import numpy as np ...@@ -23,8 +23,8 @@ import numpy as np
import yaml import yaml
from dynamo.common.utils.paths import get_workspace_dir from dynamo.common.utils.paths import get_workspace_dir
from dynamo.planner.defaults import MockerComponentName from dynamo.planner.config.backend_components import MockerComponentName
from dynamo.planner.utils.planner_config import PlannerConfig from dynamo.planner.config.planner_config import PlannerConfig
from dynamo.profiler.utils.config import DgdPlannerServiceConfig, set_argument_value from dynamo.profiler.utils.config import DgdPlannerServiceConfig, set_argument_value
from dynamo.profiler.utils.profile_common import ( from dynamo.profiler.utils.profile_common import (
ProfilerOperationalConfig, ProfilerOperationalConfig,
......
...@@ -27,7 +27,7 @@ from typing import Any, Dict, List, Optional ...@@ -27,7 +27,7 @@ from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field, model_validator from pydantic import BaseModel, Field, model_validator
# Import canonical planner types - do NOT redefine them here. # Import canonical planner types - do NOT redefine them here.
from dynamo.planner.utils.planner_config import ( # noqa: F401 (re-exported) from dynamo.planner.config.planner_config import ( # noqa: F401 (re-exported)
PlannerConfig, PlannerConfig,
PlannerPreDeploymentSweepMode, PlannerPreDeploymentSweepMode,
) )
...@@ -185,7 +185,7 @@ class FeaturesSpec(BaseModel): ...@@ -185,7 +185,7 @@ class FeaturesSpec(BaseModel):
planner: Optional[PlannerConfig] = Field( planner: Optional[PlannerConfig] = Field(
default=None, default=None,
description="Planner is the raw SLA planner configuration passed to the planner service. Its schema is defined by dynamo.planner.utils.planner_config.PlannerConfig. Go treats this as opaque bytes; the Planner service validates it at startup. The presence of this field (non-null) enables the planner in the generated DGD.", description="Planner is the raw SLA planner configuration passed to the planner service. Its schema is defined by dynamo.planner.config.planner_config.PlannerConfig. Go treats this as opaque bytes; the Planner service validates it at startup. The presence of this field (non-null) enables the planner in the generated DGD.",
) )
mocker: Optional[MockerSpec] = Field( mocker: Optional[MockerSpec] = Field(
default=None, default=None,
......
...@@ -27,7 +27,7 @@ from __future__ import annotations ...@@ -27,7 +27,7 @@ from __future__ import annotations
import logging import logging
from dynamo.planner.utils.planner_config import PlannerPreDeploymentSweepMode from dynamo.planner.config.planner_config import PlannerPreDeploymentSweepMode
from dynamo.profiler.utils.defaults import SearchStrategy from dynamo.profiler.utils.defaults import SearchStrategy
from dynamo.profiler.utils.dgdr_v1beta1_types import ( from dynamo.profiler.utils.dgdr_v1beta1_types import (
DynamoGraphDeploymentRequestSpec, DynamoGraphDeploymentRequestSpec,
......
...@@ -564,7 +564,7 @@ spec: ...@@ -564,7 +564,7 @@ spec:
planner: planner:
description: |- description: |-
Planner is the raw SLA planner configuration passed to the planner service. Planner is the raw SLA planner configuration passed to the planner service.
Its schema is defined by dynamo.planner.utils.planner_config.PlannerConfig. Its schema is defined by dynamo.planner.config.planner_config.PlannerConfig.
Go treats this as opaque bytes; the Planner service validates it at startup. Go treats this as opaque bytes; the Planner service validates it at startup.
The presence of this field (non-null) enables the planner in the generated DGD. The presence of this field (non-null) enables the planner in the generated DGD.
type: object type: object
......
...@@ -37,12 +37,12 @@ from typing import List, Optional, Tuple ...@@ -37,12 +37,12 @@ from typing import List, Optional, Tuple
# Planner-specific types are the canonical hand-written source of truth. # Planner-specific types are the canonical hand-written source of truth.
_IMPORT_OVERRIDES: dict[str, tuple[str, str, bool]] = { _IMPORT_OVERRIDES: dict[str, tuple[str, str, bool]] = {
"PlannerPreDeploymentSweepMode": ( "PlannerPreDeploymentSweepMode": (
"dynamo.planner.utils.planner_config", "dynamo.planner.config.planner_config",
"PlannerPreDeploymentSweepMode", "PlannerPreDeploymentSweepMode",
True, True,
), ),
"PlannerConfig": ( "PlannerConfig": (
"dynamo.planner.utils.planner_config", "dynamo.planner.config.planner_config",
"PlannerConfig", "PlannerConfig",
True, True,
), ),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment