[Model Runner V2] Fix seq_lens_cpu_upper_bound (#42202)
Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
@@ -104,9 +104,8 @@ class RequestState:
|
||||
self.num_computed_prefill_tokens[req_idx] = num_computed_tokens
|
||||
self.num_computed_tokens_np[req_idx] = num_computed_tokens
|
||||
self.num_computed_tokens.stage_write_elem(req_idx, num_computed_tokens)
|
||||
self.num_computed_tokens_np[req_idx] = num_computed_tokens
|
||||
|
||||
if num_computed_tokens > 0 and num_computed_tokens <= prefill_len:
|
||||
if 0 < num_computed_tokens <= prefill_len:
|
||||
# For PD disagg or resumed requests: set last_sampled to the last
|
||||
# computed token so the first decode step gets the right input_id.
|
||||
# For fresh prefill requests (num_computed_tokens == 0) the tensor
|
||||
@@ -134,8 +133,8 @@ class RequestState:
|
||||
self.free_indices.append(req_idx)
|
||||
return True
|
||||
|
||||
def any_prefills(self, idx_mapping_np: np.ndarray) -> bool:
|
||||
return np.any(
|
||||
def is_prefilling(self, idx_mapping_np: np.ndarray) -> np.ndarray:
|
||||
return (
|
||||
self.num_computed_prefill_tokens[idx_mapping_np]
|
||||
< self.prefill_len.np[idx_mapping_np]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user