Skip to content

Commit 2d9045f

Browse files
robertgshaw2-redhatRobert Shaw
andauthored
[TPU][CI] Fix TPUModelRunner Test (#15667)
Signed-off-by: Robert Shaw <[email protected]> Co-authored-by: Robert Shaw <[email protected]>
1 parent 355f663 commit 2d9045f

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

.buildkite/run-tpu-v1-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ docker run --privileged --net host --shm-size=16G -it \
3030
&& echo TEST_4 \
3131
&& python3 /workspace/vllm/examples/offline_inference/tpu.py \
3232
&& echo TEST_5 \
33-
&& pytest -s -v /workspace/vllm/tests/tpu/worker/test_tpu_model_runner.py \
33+
&& pytest -s -v /workspace/vllm/tests/v1/tpu/worker/test_tpu_model_runner.py \
3434
&& echo TEST_6 \
3535
&& pytest -s -v /workspace/vllm/tests/v1/tpu/test_sampler.py" \
3636

tests/v1/tpu/worker/test_tpu_model_runner.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from vllm.sampling_params import SamplingParams
88
from vllm.v1.core.sched.output import (CachedRequestData, NewRequestData,
99
SchedulerOutput)
10-
from vllm.v1.sample.metadata import SamplingMetadata
1110
from vllm.v1.worker.tpu_model_runner import (TPUModelRunner,
1211
_get_padded_token_len,
1312
_get_paddings)
@@ -113,12 +112,6 @@ def _is_req_added(model_runner, req_id: str) -> bool:
113112
return req_id in model_runner.requests
114113

115114

116-
def _is_sampling_metadata_changed(model_runner,
117-
sampling_metadata_before: SamplingMetadata):
118-
return model_runner.input_batch.sampling_metadata is not (
119-
sampling_metadata_before)
120-
121-
122115
def _is_req_state_block_table_match(model_runner, req_id: str) -> bool:
123116
req_index = model_runner.input_batch.req_id_to_index[req_id]
124117
block_table = model_runner.input_batch.block_table
@@ -136,10 +129,8 @@ def test_update_states_new_request(model_runner):
136129
# new req
137130
scheduler_output = _schedule_new_request(req_id)
138131

139-
metadata_before = model_runner.input_batch.sampling_metadata
140132
model_runner._update_states(scheduler_output)
141133

142-
assert _is_sampling_metadata_changed(model_runner, metadata_before)
143134
assert _is_req_added(model_runner, req_id)
144135
assert _is_req_scheduled(model_runner, req_id)
145136
assert _is_req_state_block_table_match(model_runner, req_id)
@@ -170,9 +161,7 @@ def test_update_states_request_finished(model_runner):
170161
grammar_bitmask=None,
171162
)
172163

173-
metadata_before = model_runner.input_batch.sampling_metadata
174164
model_runner._update_states(scheduler_output)
175-
assert _is_sampling_metadata_changed(model_runner, metadata_before)
176165
assert not _is_req_added(model_runner, req_id)
177166
assert not _is_req_scheduled(model_runner, req_id)
178167

@@ -229,9 +218,7 @@ def test_update_states_request_resumed(model_runner):
229218
grammar_bitmask=None,
230219
)
231220

232-
metadata_before = model_runner.input_batch.sampling_metadata
233221
model_runner._update_states(scheduler_output)
234-
assert _is_sampling_metadata_changed(model_runner, metadata_before)
235222
assert _is_req_added(model_runner, req_id)
236223
assert _is_req_scheduled(model_runner, req_id)
237224
assert _is_req_state_block_table_match(model_runner, req_id)
@@ -262,9 +249,7 @@ def test_update_states_no_changes(model_runner):
262249
grammar_bitmask=None,
263250
)
264251

265-
metadata_before = model_runner.input_batch.sampling_metadata
266252
model_runner._update_states(scheduler_output)
267-
assert not _is_sampling_metadata_changed(model_runner, metadata_before)
268253
assert _is_req_added(model_runner, req_id)
269254
assert _is_req_scheduled(model_runner, req_id)
270255
assert _is_req_state_block_table_match(model_runner, req_id)
@@ -299,8 +284,7 @@ def test_update_states_request_unscheduled(model_runner):
299284
grammar_bitmask=None,
300285
)
301286

302-
metadata_before = model_runner._update_states(scheduler_output)
303-
assert _is_sampling_metadata_changed(model_runner, metadata_before)
287+
model_runner._update_states(scheduler_output)
304288

305289
assert _is_req_added(model_runner, req_ids[0])
306290
assert _is_req_scheduled(model_runner, req_ids[0])

0 commit comments

Comments
 (0)