Skip to content

Commit 04d281b

Browse files
kevincheng2claude
andcommitted
[BugFix][KVCache] fix pre-commit code style issues
## Motivation 修复 CI pre-commit 代码风格检查失败问题。 ## Modifications - `fastdeploy/engine/common_engine.py`: black 格式化 - `fastdeploy/worker/worker_process.py`: black 格式化 + isort 修复 - `fastdeploy/cache_manager/v1/storage/__init__.py`: isort 修复 - `fastdeploy/worker/gpu_worker.py`: isort 修复 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9a64c75 commit 04d281b

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

fastdeploy/cache_manager/v1/storage/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- create_storage_connector: Create a StorageConnector instance based on config
1010
"""
1111

12-
from typing import Any, Dict, Optional, TYPE_CHECKING
12+
from typing import TYPE_CHECKING, Any, Dict, Optional
1313

1414
if TYPE_CHECKING:
1515
from fastdeploy.config import CacheConfig

fastdeploy/engine/common_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ def start_worker_service(self, async_llm_pid=None):
283283

284284
# If block number is specified and model is deployed in splitwise mode, start cache manager first
285285
if (
286-
not self.do_profile
287-
and self.cfg.scheduler_config.splitwise_role != "mixed"
286+
not self.do_profile
287+
and self.cfg.scheduler_config.splitwise_role != "mixed"
288288
and not envs.ENABLE_V1_KVCACHE_MANAGER
289289
):
290290
device_ids = self.cfg.parallel_config.device_ids.split(",")
@@ -319,7 +319,7 @@ def check_worker_initialize_status_func(res: dict):
319319
if self.do_profile:
320320
self._stop_profile()
321321
elif (
322-
self.cfg.scheduler_config.splitwise_role == "mixed"
322+
self.cfg.scheduler_config.splitwise_role == "mixed"
323323
and self.cfg.cache_config.enable_prefix_caching
324324
and not envs.ENABLE_V1_KVCACHE_MANAGER
325325
):

fastdeploy/worker/gpu_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from fastdeploy import envs
2626
from fastdeploy.config import FDConfig
27-
from fastdeploy.engine.request import Request, BatchRequest
27+
from fastdeploy.engine.request import BatchRequest, Request
2828
from fastdeploy.plugins.model_runner import load_model_runner_plugins
2929
from fastdeploy.usage.usage_lib import report_usage_stats
3030
from fastdeploy.utils import get_logger, set_random_seed

fastdeploy/worker/worker_process.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@
4949
SpeculativeConfig,
5050
StructuredOutputsConfig,
5151
)
52-
from fastdeploy.engine.request import ControlRequest, ControlResponse, RequestType, BatchRequest
52+
from fastdeploy.engine.request import (
53+
BatchRequest,
54+
ControlRequest,
55+
ControlResponse,
56+
RequestType,
57+
)
5358
from fastdeploy.eplb.async_expert_loader import (
5459
MODEL_MAIN_NAME,
5560
REARRANGE_EXPERT_MAGIC_NUM,
@@ -1377,7 +1382,9 @@ def run_worker_proc() -> None:
13771382

13781383
if __name__ == "__main__":
13791384
import sys
1385+
13801386
from fastdeploy.cache_manager.ops import cuda_host_alloc
1387+
13811388
print(f"[DEBUG] Worker process sys.path[0] = {sys.path[0]}", flush=True)
13821389
print(f"[DEBUG] Worker process cuda_host_alloc = {cuda_host_alloc}", flush=True)
13831390
run_worker_proc()

0 commit comments

Comments
 (0)