Skip to content

[RFC]: Log system refactoring #442

@Bounty-hunter

Description

@Bounty-hunter

Motivation.

The current logging system has several issues:

  • Multiple logging mechanisms are mixed together (e.g., logging, print, and the vLLM logger), which leads to duplicate log outputs, and poor maintainability in the long term.
_logging.getLogger(__name__).debug(
    "[Stage-%s] Received batch size=%d, request_ids=%s",
    stage_id,
    len(batch_tasks),
    batch_request_ids,
)
print("--------------------------------", flush=True)
print(
    f"[Stage-{stage_id}] Received batch size={len(batch_tasks)}, request_ids={batch_request_ids}",
    flush=True,
)
print("--------------------------------", flush=True)
try:
    summary = metrics.build_and_log_summary(final_stage_id_for_e2e)
    logger.info("[Summary] %s", summary)
except Exception as e:
    logger.exception("[Orchestrator] Failed to build/log summary: %s", e)
finally:
    self.request_states.pop(request_id, None)
def build_and_log_summary(self, final_stage_id_to_prompt: dict[str, int]) -> dict[str, Any]:
    ...
    if self.enable_stats and self.stats_file:
        log_orchestrator_summary(self.stats_file, summary)
    if self.enable_stats and self.overall_stats_file:
        log_overall_summary(self.overall_stats_file, summary)
    return summary
  • Logs from different stages are mixed together making it difficult to distinguish and analyze stage-specific behaviors.
INFO 12-24 01:51:22 [initialization.py:60] Created connector for 1 -> 2: SharedMemoryConnector
The argument `trust_remote_code` is to be used with Auto classes. It has no effect here and is ignored.
Unrecognized keys in `rope_scaling` for 'rope_type'='default': {'mrope_section'}
INFO 12-24 01:51:23 [model.py:637] Resolved architecture: Qwen2_5OmniModel
INFO 12-24 01:51:23 [model.py:1750] Using max model len 32768
Image

Proposed Change.

Image
  • unifiled with vllm logger
  • metric refactor

Feedback Period.

No response

CC List.

No response

Any Other Things.

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions