[Misc] Clean logs for image gen task (#3414)
Signed-off-by: wuhang <wuhang6@huawei.com>
This commit is contained in:
1 parent
3bf4f2850c
commit
3f27ffbd4d
7 files changed
+21
-19
No files matched your search
@@ -147,7 +147,7 @@ class DiffusionEngine:
|
||||
preprocess_start_time = time.perf_counter()
|
||||
request = self.pre_process_func(request)
|
||||
preprocess_time = time.perf_counter() - preprocess_start_time
|
||||
logger.info(f"Pre-processing completed in {preprocess_time:.4f} seconds")
|
||||
logger.debug("Pre-processing completed in %.4f seconds", preprocess_time)
|
||||
|
||||
exec_start_time = time.perf_counter()
|
||||
output = await self.async_add_req_and_wait_for_response(request)
|
||||
@@ -157,7 +157,7 @@ class DiffusionEngine:
|
||||
raise DiffusionRequestAbortedError(output.abort_message or "Diffusion request aborted.")
|
||||
if output.error:
|
||||
raise RuntimeError(output.error)
|
||||
logger.info("Generation completed successfully.")
|
||||
logger.debug("Generation completed successfully.")
|
||||
|
||||
if output.output is None:
|
||||
logger.warning("Output is None, returning empty OmniRequestOutput")
|
||||
@@ -204,10 +204,10 @@ class DiffusionEngine:
|
||||
model_fps = outputs.get("fps")
|
||||
outputs = outputs.get("video", outputs)
|
||||
postprocess_time = time.perf_counter() - postprocess_start_time
|
||||
logger.info(f"Post-processing completed in {postprocess_time:.4f} seconds")
|
||||
logger.debug("Post-processing completed in %.4f seconds", postprocess_time)
|
||||
|
||||
step_total_ms = (time.perf_counter() - diffusion_engine_start_time) * 1000
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"DiffusionEngine.step breakdown: preprocess=%.2f ms, "
|
||||
"add_req_and_wait=%.2f ms, postprocess=%.2f ms, total=%.2f ms",
|
||||
preprocess_time * 1000,
|
||||
|
||||
@@ -86,7 +86,7 @@ class InlineStageDiffusionClient:
|
||||
sampling_params: OmniDiffusionSamplingParams,
|
||||
kv_sender_info: dict[int, dict[str, Any]] | None = None,
|
||||
) -> None:
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"[InlineStageDiffusionClient] stage-%s [rep-%s] add request: %s",
|
||||
self.stage_id,
|
||||
self.replica_id,
|
||||
@@ -144,7 +144,7 @@ class InlineStageDiffusionClient:
|
||||
sampling_params: OmniDiffusionSamplingParams,
|
||||
kv_sender_info: dict[int, dict[str, Any]] | None = None,
|
||||
) -> None:
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"[InlineStageDiffusionClient] stage-%s [rep-%s] add batch request: %s (%d prompts)",
|
||||
self.stage_id,
|
||||
self.replica_id,
|
||||
|
||||
@@ -536,8 +536,10 @@ class ZImagePipeline(nn.Module, DiffusionPipelineProfilerMixin):
|
||||
image = PIL.Image.open(raw_image) if isinstance(raw_image, str) else raw_image
|
||||
|
||||
# strength is currently only applicable for Z-Image I2I; other pipelines ignore this parameter
|
||||
strength = req.sampling_params.strength if req.sampling_params.strength is not None else strength
|
||||
if strength is not None and image is None:
|
||||
explicit_strength = req.sampling_params.strength is not None
|
||||
if explicit_strength:
|
||||
strength = req.sampling_params.strength
|
||||
if explicit_strength and image is None:
|
||||
logger.warning(
|
||||
"strength parameter (%.2f) is only applicable for image-to-image (I2I) generation. "
|
||||
"It will be ignored for text-to-image (T2I) generation.",
|
||||
|
||||
@@ -212,7 +212,7 @@ class DiffusionModelRunner(OmniConnectorModelRunnerMixin):
|
||||
peak_allocated_gb = peak_allocated_bytes / (1024**3)
|
||||
pool_overhead_gb = peak_reserved_gb - peak_allocated_gb
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"Peak GPU memory (this request): %.2f GB reserved, %.2f GB allocated, %.2f GB pool overhead (%.1f%%)",
|
||||
peak_reserved_gb,
|
||||
peak_allocated_gb,
|
||||
|
||||
@@ -981,6 +981,11 @@ class OmniKVTransferManager:
|
||||
Returns:
|
||||
Tuple of (data dict, size) if successful, (None, 0) otherwise
|
||||
"""
|
||||
# Check if we should receive KV cache based on config
|
||||
if not self.config.need_recv_cache:
|
||||
logger.debug("Skip receiving KV cache for %s (need_recv_cache=False)", request_id)
|
||||
return None, 0
|
||||
|
||||
if not self.connector:
|
||||
logger.warning("No connector available for receiving KV cache")
|
||||
return None, 0
|
||||
@@ -990,11 +995,6 @@ class OmniKVTransferManager:
|
||||
logger.warning("Receive stages not configured")
|
||||
return None, 0
|
||||
|
||||
# Check if we should receive KV cache based on config
|
||||
if not self.config.need_recv_cache:
|
||||
logger.info(f"Skip receiving KV cache for {request_id} (need_recv_cache=False)")
|
||||
return None, 0
|
||||
|
||||
# Skip during warmup dummy run — no sender is available.
|
||||
if request_id == "dummy_req_id":
|
||||
logger.info("Skip receiving KV cache for dummy warmup request")
|
||||
|
||||
@@ -227,7 +227,7 @@ class Orchestrator:
|
||||
raise ValueError(f"Missing sampling params for stage 0. Got {len(sampling_params_list)} stage params.")
|
||||
final_stage_id = msg["final_stage_id"]
|
||||
|
||||
logger.info(
|
||||
logger.debug(
|
||||
"[Orchestrator] _handle_add_request: stage=%s req=%s "
|
||||
"prompt_type=%s original_prompt_type=%s final_stage=%s "
|
||||
"num_sampling_params=%d",
|
||||
|
||||
@@ -1606,7 +1606,7 @@ async def generate_images(request: ImageGenerationRequest, raw_request: Request)
|
||||
request_id = f"img_gen-{random_uuid()}"
|
||||
raw_request.state.request_metadata = RequestResponseMetadata(request_id=request_id)
|
||||
|
||||
logger.info(f"Generating {request.n} image(s) {size_str}")
|
||||
logger.debug(f"Generating {request.n} image(s) {size_str}")
|
||||
|
||||
# Generate images using AsyncOmni (multi-stage mode)
|
||||
result = await _generate_with_async_omni(
|
||||
@@ -1626,7 +1626,7 @@ async def generate_images(request: ImageGenerationRequest, raw_request: Request)
|
||||
# Extract images from result
|
||||
images = _extract_images_from_result(result)
|
||||
|
||||
logger.info(f"Successfully generated {len(images)} image(s)")
|
||||
logger.debug(f"Successfully generated {len(images)} image(s)")
|
||||
|
||||
# Determine output format (default to png)
|
||||
output_format = _choose_output_format(request.output_format or "png", None)
|
||||
@@ -1854,7 +1854,7 @@ async def edit_images(
|
||||
# 4. Generate images
|
||||
request_id = f"img_edit-{random_uuid()}"
|
||||
raw_request.state.request_metadata = RequestResponseMetadata(request_id=request_id)
|
||||
logger.info(f"Generating {n} image(s) {size_str}")
|
||||
logger.debug(f"Generating {n} image(s) {size_str}")
|
||||
|
||||
if len(stage_configs) > 1:
|
||||
# Multi-stage pipeline (e.g. GLM-Image AR+Diffusion): route through
|
||||
@@ -1932,7 +1932,7 @@ async def edit_images(
|
||||
)
|
||||
images = _extract_images_from_result(result)
|
||||
|
||||
logger.info(f"Successfully generated {len(images)} image(s)")
|
||||
logger.debug(f"Successfully generated {len(images)} image(s)")
|
||||
|
||||
# Encode images to base64
|
||||
image_data = [
|
||||
|
||||
Reference in new issue
Block a user