[diffusion] log: minor improve logging (#13735)
This commit is contained in:
@@ -347,7 +347,10 @@ class DiffGenerator:
|
|||||||
results.append(result_item)
|
results.append(result_item)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
"Failed to generate output for prompt %d: %s", request_idx + 1, e
|
"Failed to generate output for prompt %d: %s",
|
||||||
|
request_idx + 1,
|
||||||
|
e,
|
||||||
|
exc_info=True,
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ class DenoisingStage(PipelineStage):
|
|||||||
|
|
||||||
if num_timesteps > 0:
|
if num_timesteps > 0:
|
||||||
self.log_info(
|
self.log_info(
|
||||||
"Average time per step: %.4f seconds",
|
"average time per step: %.4f seconds",
|
||||||
(denoising_end_time - denoising_start_time) / len(timesteps),
|
(denoising_end_time - denoising_start_time) / len(timesteps),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ class DmdDenoisingStage(DenoisingStage):
|
|||||||
denoising_loop_end_time = time.time()
|
denoising_loop_end_time = time.time()
|
||||||
if len(timesteps) > 0:
|
if len(timesteps) > 0:
|
||||||
self.log_info(
|
self.log_info(
|
||||||
"Average time per step: %.4f seconds",
|
"average time per step: %.4f seconds",
|
||||||
(denoising_loop_end_time - denoising_loop_start_time) / len(timesteps),
|
(denoising_loop_end_time - denoising_loop_start_time) / len(timesteps),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -16,6 +15,7 @@ from dateutil.tz import UTC
|
|||||||
|
|
||||||
import sglang
|
import sglang
|
||||||
import sglang.multimodal_gen.envs as envs
|
import sglang.multimodal_gen.envs as envs
|
||||||
|
from sglang.multimodal_gen.runtime.utils.logging_utils import _SGLDiffusionLogger
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
@@ -123,7 +123,7 @@ class StageProfiler:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
stage_name: str,
|
stage_name: str,
|
||||||
logger: logging.Logger,
|
logger: _SGLDiffusionLogger,
|
||||||
timings: Optional["RequestTimings"],
|
timings: Optional["RequestTimings"],
|
||||||
simple_log: bool = False,
|
simple_log: bool = False,
|
||||||
):
|
):
|
||||||
@@ -131,7 +131,6 @@ class StageProfiler:
|
|||||||
self.timings = timings
|
self.timings = timings
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.simple_log = simple_log
|
self.simple_log = simple_log
|
||||||
self.logger = logging.getLogger(__name__)
|
|
||||||
self.start_time = 0.0
|
self.start_time = 0.0
|
||||||
|
|
||||||
# Check env var at runtime to ensure we pick up changes (e.g. from CLI args)
|
# Check env var at runtime to ensure we pick up changes (e.g. from CLI args)
|
||||||
@@ -158,12 +157,7 @@ class StageProfiler:
|
|||||||
self.stage_name,
|
self.stage_name,
|
||||||
execution_time_s * 1000,
|
execution_time_s * 1000,
|
||||||
exc_val,
|
exc_val,
|
||||||
)
|
exc_info=True,
|
||||||
if self.metrics_enabled:
|
|
||||||
self.logger.error(
|
|
||||||
"[%s] Traceback: %s",
|
|
||||||
self.stage_name,
|
|
||||||
"".join(traceback.format_tb(exc_tb)),
|
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user