mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
remove seq_lens_this_time (#4821)
This commit is contained in:
@@ -91,12 +91,7 @@ else:
|
||||
|
||||
from fastdeploy.output.pooler import PoolerOutput, PoolingSequenceGroupOutput
|
||||
from fastdeploy.output.stream_transfer_data import DecoderState, StreamTransferData
|
||||
from fastdeploy.worker.output import (
|
||||
LogprobsTensors,
|
||||
ModelOutputData,
|
||||
ModelRunnerOutput,
|
||||
SamplerOutput,
|
||||
)
|
||||
from fastdeploy.worker.output import LogprobsTensors, ModelOutputData, SamplerOutput
|
||||
|
||||
DISABLE_RECOVER = envs.FD_DISABLED_RECOVER == "1"
|
||||
|
||||
@@ -208,7 +203,7 @@ def pre_process(
|
||||
"""
|
||||
token_num = paddle.sum(seq_lens_this_time)
|
||||
|
||||
if current_platform.is_cuda() and not speculative_decoding:
|
||||
if (current_platform.is_cuda() or current_platform.is_iluvatar()) and not speculative_decoding:
|
||||
# Note(ZKK): This case's code is very simple!
|
||||
ids_remove_padding, batch_id_per_token, cu_seqlens_q, cu_seqlens_k = get_padding_offset(
|
||||
input_ids, token_num, seq_lens_this_time
|
||||
@@ -322,7 +317,7 @@ def post_process_normal(
|
||||
async_output_queue: queue.Queue = None,
|
||||
think_end_id: int = -1,
|
||||
line_break_id: int = -1,
|
||||
) -> ModelRunnerOutput:
|
||||
):
|
||||
"""Post-processing steps after completing a single token generation."""
|
||||
if think_end_id > 0:
|
||||
limit_thinking_content_length(
|
||||
|
||||
@@ -2050,7 +2050,7 @@ class GPUModelRunner(ModelRunnerBase):
|
||||
self,
|
||||
model_forward_batch: Optional[List[Request]] = None,
|
||||
num_running_requests: int = None,
|
||||
) -> Optional[ModelRunnerOutput]:
|
||||
) -> None:
|
||||
"""
|
||||
The Entrance of model execute.
|
||||
Args:
|
||||
@@ -2140,10 +2140,6 @@ class GPUModelRunner(ModelRunnerBase):
|
||||
async_output_queue=self.async_output_queue,
|
||||
)
|
||||
|
||||
self.seq_lens_this_time_buffer[:num_running_requests].copy_(
|
||||
self.share_inputs["seq_lens_this_time"][:num_running_requests], False
|
||||
)
|
||||
|
||||
return None
|
||||
else:
|
||||
hidden_states = rebuild_padding(
|
||||
@@ -2305,9 +2301,6 @@ class GPUModelRunner(ModelRunnerBase):
|
||||
self.speculative_config.num_speculative_tokens,
|
||||
)
|
||||
|
||||
self.seq_lens_this_time_buffer[:num_running_requests].copy_(
|
||||
self.share_inputs["seq_lens_this_time"][:num_running_requests], False
|
||||
)
|
||||
return None
|
||||
|
||||
def _pool(self, hidden_states: paddle.Tensor, num_running_requests: int) -> Optional[ModelRunnerOutput]:
|
||||
|
||||
Reference in New Issue
Block a user