mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[PD Disaggregation] Add timestamp for analyzing splitwise deployment (#5317)
* Add timestamp for analyzing splitwise deployment * up * up * up * up * up * up * fix format * fix
This commit is contained in:
@@ -14,12 +14,13 @@
|
||||
# limitations under the License.
|
||||
"""
|
||||
|
||||
import time
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import numpy as np
|
||||
|
||||
from fastdeploy.engine.request import CompletionOutput, RequestOutput
|
||||
from fastdeploy.engine.request import CompletionOutput, RequestMetrics, RequestOutput
|
||||
from fastdeploy.output.token_processor import TokenProcessor
|
||||
from fastdeploy.worker.output import LogprobsLists
|
||||
|
||||
@@ -49,15 +50,18 @@ class TestTokenProcessorLogprobs(unittest.TestCase):
|
||||
self.task_mock.messages = None
|
||||
self.task_mock.disaggregate_info = None
|
||||
self.task_mock.eos_token_ids = [2]
|
||||
self.task_mock.inference_start_time = 100.0 # Set a float value for time calculation
|
||||
self.task_mock.arrival_time = 90.0
|
||||
self.task_mock.preprocess_end_time = 95.0
|
||||
self.task_mock.preprocess_start_time = 90.0
|
||||
self.task_mock.schedule_start_time = 95.0
|
||||
self.task_mock.llm_engine_recv_req_timestamp = 95.0
|
||||
self.task_mock.ic_req_data = {}
|
||||
self.task_mock.prompt_token_ids_len = 0
|
||||
|
||||
now = time.time()
|
||||
self.task_mock.metrics = RequestMetrics(
|
||||
arrival_time=now,
|
||||
preprocess_start_time=now - 0.2,
|
||||
preprocess_end_time=now - 0.1,
|
||||
scheduler_recv_req_time=now + 0.1,
|
||||
inference_start_time=now + 0.2,
|
||||
)
|
||||
|
||||
self.processor.resource_manager.tasks_list = [self.task_mock]
|
||||
|
||||
# Mock logger
|
||||
|
||||
Reference in New Issue
Block a user