From 2c64be6d943d6108065d03cdce0f656d34a956f7 Mon Sep 17 00:00:00 2001 From: shihaobai <42648726+shihaobai@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:58:14 +0800 Subject: [PATCH] [debug]: add some debug log (#699) Co-authored-by: shihaobai --- .../server/router/model_infer/model_rpc.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lightllm/server/router/model_infer/model_rpc.py b/lightllm/server/router/model_infer/model_rpc.py index d5f1a6106..064cad0ae 100644 --- a/lightllm/server/router/model_infer/model_rpc.py +++ b/lightllm/server/router/model_infer/model_rpc.py @@ -93,15 +93,23 @@ def exposed_add_batch(self, batch_id, reqs): # @calculate_time(show=False, min_cost_ms=300) def exposed_prefill_batch(self, batch_id): - if self.world_size != 1: - batch_id = obtain(batch_id) - return self.backend.prefill_batch(batch_id) + try: + if self.world_size != 1: + batch_id = obtain(batch_id) + return self.backend.prefill_batch(batch_id) + except Exception as e: + err_msg = str(e) + logger.exception(f"Batch prefill encountered an unexpected ERROR: {err_msg}") # @calculate_time(show=True, min_cost_ms=200) def exposed_decode_batch(self, batch_id): - if self.world_size != 1: - batch_id = obtain(batch_id) - return self.backend.decode_batch(batch_id) + try: + if self.world_size != 1: + batch_id = obtain(batch_id) + return self.backend.decode_batch(batch_id) + except Exception as e: + err_msg = str(e) + logger.exception(f"Batch decode encountered an unexpected ERROR: {err_msg}") # @calculate_time(show=True, min_cost_ms=0.1) def exposed_filter_batch(self, batch_id, req_id_list, finished_req_id_list):