Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/srt/test_vision_chunked_prefill.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
DEFAULT_URL_FOR_TEST,
CustomTestCase,
calculate_rouge_l,
popen_launch_server,
)

Expand Down Expand Up @@ -178,7 +179,18 @@ def _test_chunked_prefill(self, batches, num_frames):
print(output_chunked)
print("output without chunked prefill:")
print(output_no_chunked)
self.assertEqual(output_chunked, output_no_chunked)
self.assertEqual(len(output_chunked), len(output_no_chunked))
rouge_scores = calculate_rouge_l(output_chunked, output_no_chunked)
avg_score = sum(rouge_scores) / len(rouge_scores)
print(f"ROUGE-L scores: {rouge_scores}")
print(f"Average ROUGE-L score: {avg_score:.4f}")
# Allow for occasional divergence in one item while maintaining overall output quality
self.assertGreater(
avg_score,
0.90,
f"Average ROUGE-L score too low: {avg_score:.4f}. "
f"Individual scores: {rouge_scores}",
)

def test_chunked_prefill(self):
self._test_chunked_prefill(batches=[False, True], num_frames=[1, [2, 6, 8, 10]])
Expand Down
Loading