Skip to content

Commit e7eea5a

Browse files
authored
[V1][CI] Fix failed v1-test because of min_p (#13316)
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
1 parent a12934d commit e7eea5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/v1/worker/test_gpu_input_batch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _construct_expected_sampling_metadata(
6262
repetition_penalties = [1.0 for _ in range(num_reqs)]
6363
top_k = [0 for _ in range(num_reqs)]
6464
top_p = [0.0 for _ in range(num_reqs)]
65+
min_p = [0.0 for _ in range(num_reqs)]
6566
temperature = [0.0 for _ in range(num_reqs)]
6667
stop_token_ids: List[Set[int]] = [set() for _ in range(num_reqs)]
6768
min_tokens = [0 for _ in range(num_reqs)]
@@ -80,12 +81,12 @@ def _construct_expected_sampling_metadata(
8081
req.sampling_params.repetition_penalty)
8182
top_k[index_in_input_batch] = req.sampling_params.top_k
8283
top_p[index_in_input_batch] = req.sampling_params.top_p
84+
min_p[index_in_input_batch] = req.sampling_params.min_p
8385
temperature[index_in_input_batch] = req.sampling_params.temperature
8486
stop_token_ids[
8587
index_in_input_batch] = req.sampling_params.all_stop_token_ids
8688
min_tokens[index_in_input_batch] = req.sampling_params.min_tokens
8789
logit_bias[index_in_input_batch] = req.sampling_params.logit_bias
88-
8990
return SamplingMetadata(
9091
temperature=torch.tensor(temperature, dtype=torch.float,
9192
device=device),
@@ -95,6 +96,8 @@ def _construct_expected_sampling_metadata(
9596
top_k=torch.tensor(top_k, dtype=torch.int, device=device),
9697
no_top_p=all(x == 1.0 for x in top_p),
9798
no_top_k=all(x == 0 for x in top_k),
99+
min_p=torch.tensor(min_p, dtype=torch.float, device=device),
100+
no_min_p=all(x == 0.0 for x in min_p),
98101
generators={},
99102
max_num_logprobs=0,
100103
prompt_token_ids=make_tensor_with_pad(

0 commit comments

Comments
 (0)