Skip to content

Commit 58be02a

Browse files
committed
Add compile flushing to test
1 parent 8172c2b commit 58be02a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/generation/test_continuous_batching.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,10 @@ def _test_continuous_batching_parity(
630630
inputs = get_generation_inputs(user_messages, tokenizer, for_continuous_batching=False)
631631
num_input_tokens = inputs.input_ids.shape[1]
632632

633+
# Flush compile cache if CB used compile
634+
if continuous_batching_config.default_compile_level > 0:
635+
flush_memory(flush_compile=True)
636+
633637
# Generation without continuous batching (reload model to avoid any state contamination)
634638
_, model = get_tokenizer_and_model(model_id, attn_implementation, torch_device, dtype)
635639
model.generation_config.max_new_tokens = max_new_tokens

0 commit comments

Comments
 (0)