【Hackathon 9th No.88】为FastDeploy重构log日志打印范式#6682
Draft
cloudforge1 wants to merge 4 commits intoPaddlePaddle:developfrom
Draft
【Hackathon 9th No.88】为FastDeploy重构log日志打印范式#6682cloudforge1 wants to merge 4 commits intoPaddlePaddle:developfrom
cloudforge1 wants to merge 4 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
…sole handler, logger exports - Add FD_LOG_LEVEL env var to envs.py (defaults based on FD_DEBUG) - Populate fastdeploy/logger/__init__.py with get_logger() + exports - Add console StreamHandler to unified fastdeploy logger - Unify legacy loggers (get_trace_logger, _get_legacy_logger) to respect FD_LOG_LEVEL - Migrate print()/f-string logger calls in model_base.py to lazy %s formatting - Add 13 unit tests in tests/test_logging.py covering logger naming, FD_LOG_LEVEL env var, singleton pattern, console handler, legacy compat
…ing in config, engine, entrypoints, scheduler - config.py: demote verbose config dumps to logger.debug, fix f-string → %s - engine.py: demote internal debug messages, migrate f-strings to lazy formatting - common_engine.py: migrate all f-string logger calls to lazy %s formatting - api_server.py, multi_api_server.py: standardize log formatting - serving_engine.py, serving_embedding.py: lazy formatting migration - global_scheduler.py: migrate f-string logger calls to lazy %s formatting
…onfig/engine/scheduler/serving fixes - token_processor.py: 22 per-request/internal logs INFO→DEBUG, 2 error handlers INFO→ERROR, 2 request completion summaries f-string→%s (kept INFO) - config.py: parameter get/reset logs f-string→%s, sequence_parallel_moe→DEBUG - engine.py: cache task→DEBUG, dp queue service f-string→%s - common_engine.py: fix escaped quote syntax error in abort handler - serving_engine.py: both _acquire_semaphore calls f-string→DEBUG+%s - scheduler/: dp_scheduler typo fix (Recieve→Receive), all 3 schedulers enqueued/pulled/finished→DEBUG - spec_logger single head accept ratio→DEBUG Zero f-string .info() calls remain across all 12 target files. All 12 files pass Python AST syntax validation.
ed6bc79 to
4850b08
Compare
4850b08 to
2279d92
Compare
…st INFO→DEBUG + f-string→%s - model_executor/: 14 print() calls → logger.debug/warning/info (6 files) - graph_optimization/utils.py: memory info → debug - ops/gpu/__init__.py: sm_version → debug, module error → warning - models/adapters.py: load failure → warning - layers/attention/mla_attention_backend.py: flash attn detect → info - ops/triton_ops/triton_utils.py: kernel cache/compile → debug - ops/triton_ops/triton_utils_v2.py: kernel cache/compile → debug - entrypoints/: per-request INFO → DEBUG with lazy %s (12 files) - engine_client.py: objgraph debug, max_tokens, control methods - serving_chat.py: create/release/stream per-request calls - serving_completion.py: init/preprocess/response per-request calls - v1/serving_chat.py, v1/serving_completion.py: stream/response - run_batch.py: startup/progress f-string → %s (keep INFO) - llm.py, chat_utils.py, serving_reward.py, utils.py, v1/serving_base.py - scheduler/splitwise_scheduler.py: per-request → DEBUG, startup → INFO %s Acceptance criteria met: - Core module print() = 0 (excl subprocess string, .print() methods) - Per-request INFO = 0 in serving paths (all downgraded to DEBUG) - All hot-path logger calls use %s lazy formatting
2279d92 to
66aaef8
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Refactor log printing in FastDeploy to establish a clear, readable, and well-organized logging paradigm.
Hackathon 9th — Task #88 | Task List
Task Deliverables
Modifications
Phase A — Logging Infrastructure (Commit 1)
Unified FD_LOG_LEVEL Environment Variable (
fastdeploy/envs.py)FD_LOG_LEVELenv var that supersedesFD_DEBUGtoggleFD_DEBUG=1, otherwise INFOLogger Module Public API (
fastdeploy/logger/__init__.py)get_logger(name)factory returns namespaced loggers underfastdeploy.*Legacy Logger Unification (
fastdeploy/logger/logger.py)get_trace_logger()and_get_legacy_logger()now respectFD_LOG_LEVELConsole Handler (
fastdeploy/logger/setup_logging.py)fastdeployroot loggerModel Base Migration (
fastdeploy/model_executor/models/model_base.py)print()to structured logger calls with lazy%sUnit Tests (
tests/test_logging.py)Phase B — System-wide Migration (Commits 2-4)
Config / Engine / Entrypoints (8 files)
config.py: verbose config dumps tologger.debug, f-string to%sengine.py: internal debug messages demotedcommon_engine.py,api_server.py,multi_api_server.py,serving_engine.py,serving_embedding.py,global_scheduler.py: lazy formattingToken Processor + Scheduler/Serving (12 files)
token_processor.py: 22 per-request logs INFO→DEBUG, 2 error handlers INFO→ERRORdp_schedulertypo fix (Recieve→Receive), all 3 schedulers to DEBUGserving_engine.py:_acquire_semaphoreto DEBUGModel Executor + Entrypoints Completion (18 files)
model_executor/: 14print()→logger.debug/warning/infoacross 6 filesentrypoints/: per-request INFO→DEBUG with lazy%sacross 12 filessplitwise_scheduler: per-request to DEBUGUsage or Command
Accuracy Tests
print()= 0 (excl subprocess strings,.print()methods)%slazy formatting (zero f-string.info()calls)FD_LOG_LEVELenv variable controls all loggersFD_DEBUG=0/1Checklist
pre-commitbefore commit.releasebranch, cherry-pick fromdevelop. N/A — targetingdevelop.