Skip to content

Commit

Permalink
[Misc] Heterogeneous GPU Optimizer Logging Clean Up (#514)
Browse files Browse the repository at this point in the history
logging cleaned
  • Loading branch information
nwangfw authored Dec 10, 2024
1 parent cc526f7 commit 98b5ca4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
10 changes: 7 additions & 3 deletions python/aibrix/aibrix/gpu_optimizer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def start_serving_thread(watch_ver, deployment, watch_event: bool) -> bool:
watch_ver, deployment_name, namespace, lambda: new_deployment(deployment)
)
logger.info(
f'Deployment "{deployment_name}" added to the model monitor for "{model_name}"'
f'Deployment "{deployment_name}" found in watch version {watch_ver}, added to the model monitor for "{model_name}"'
)
return False

Expand Down Expand Up @@ -353,7 +353,7 @@ def main(signal, timeout):
logging.ERROR
) # Suppress kubenetes logs
logging.getLogger("pulp.apis.core").setLevel(logging.INFO) # Suppress pulp logs
logger = logging.getLogger("aibrix.gpuoptimizer")
logger = logging.getLogger("aibrix.gpu_optimizer")

timeout = 600
try:
Expand All @@ -374,10 +374,14 @@ def main(signal, timeout):
app,
host="0.0.0.0",
port=8080,
log_level="info",
log_config={
"version": 1,
"disable_existing_loggers": False,
"loggers": {"uvicorn.access": {"filters": ["dash_update_filter"]}},
"loggers": {
"uvicorn.access": {"filters": ["dash_update_filter"]},
"uvicorn.error": {"level": "INFO", "propagate": False},
},
"filters": {
"dash_update_filter": {
"()": ExcludePathsFilter,
Expand Down
8 changes: 5 additions & 3 deletions python/aibrix/aibrix/gpu_optimizer/load_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

Empty_Array: Iterable = []

logger = logging.getLogger("aibrix.gpuoptimizer.loadmonitor")
logger = logging.getLogger("aibrix.gpu_optimizer.load_monitor")

debug_gpu_profile = GPUProfile(
gpu="default", cost=1.0, tputs=[[100]], indexes=[[10], [10]]
Expand Down Expand Up @@ -60,7 +60,9 @@ def __init__(self, name: str, replicas: int = 1, min_replicas: int = 0):

@property
def cost(self):
return 0.0 if self.profile is None else self.profile.cost * self.replicas
return (
float("inf") if self.profile is None else self.profile.cost * self.replicas
)

@property
def replicas(self):
Expand Down Expand Up @@ -502,7 +504,7 @@ def _minimize(self):
self._cost = cost
self._lock.release()
logger.info(
f"{self.model_name} scaled to minimum, cost ${self._cost}: {list(self.deployments.values())}"
f"{self.model_name} scaled to minimum, total cost ${self._cost}. Detailed Configuration:{list(self.deployments.values())}"
)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from aibrix.gpu_optimizer.optimizer import GPUProfile

logger = logging.getLogger("aibrix.gpuoptimizer.profile_reader")
logger = logging.getLogger("aibrix.gpu_optimizer.profile_reader")


class ProfileReader(Protocol):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def default_datasource(_: str) -> Optional[ModelMonitor]:
"lock": threading.Lock(),
}

logger = logging.getLogger("aibrix.gpuoptimizer.loadmonitor.visualizer")
logger = logging.getLogger("aibrix.gpu_optimizer.load_monitor.visualizer")


def get_debug_model_montior(
Expand Down

0 comments on commit 98b5ca4

Please sign in to comment.