Skip to content

Commit

Permalink
relax a bit prefill time comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed Dec 20, 2024
1 parent dad4c6d commit a247803
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/python_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

def pytest_make_parametrize_id(config, val, argname):
if argname in ['prompt', 'prompts', 'batched_prompts']:
return f'{val}'
# Print only first 1000 characters of long prompts.
return f'{val[:1000]}'
elif argname == 'model_descr':
return f"{val[0]}"
elif argname == 'chat_config':
Expand Down
2 changes: 1 addition & 1 deletion tests/python_tests/test_generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ def test_perf_metrics(model_descr, generation_config, prompt):
durations = np.array(raw_metrics.m_durations) / 1000
# Check that prefill is not included in durations for TPOT calculation.
# For the very long prompt prefill is slow and TTFT is much larger than any other token genration duration.
assert np.all(mean_ttft > durations * 10)
assert np.all(mean_ttft > durations * 5)

mean_tpot, std_tpot = perf_metrics.get_tpot()
assert (mean_tpot, std_tpot) == (perf_metrics.get_tpot().mean, perf_metrics.get_tpot().std)
Expand Down

0 comments on commit a247803

Please sign in to comment.