Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KuilongCui committed Sep 19, 2024
1 parent d7b0102 commit 235c5c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/e2e_test/test_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def clear_ray_state():
def parse_log_file():
json_files = [f for f in os.listdir('.') if f.endswith('_latency_info.json')]

def get_markdown_data(filter: str, head_name: str):
def get_markdown_data(key: str, head_name: str):
latencies = []

for json_file in json_files:
with open(json_file, 'r', encoding="utf-8") as file:
data = json.load(file)[0]

latencies.append(data.get('decode_latencies', []))
latencies.append(data.get(key, []))

latencies_array = np.array(latencies)

Expand All @@ -97,9 +97,11 @@ def get_markdown_data(filter: str, head_name: str):
["latency(ms)", f"{p25:.2f}", f"{p50:.2f}", f"{p75:.2f}", f"{p95:.2f}", f"{p99:.2f}", f"{mean:.2f}"]
]

return data

decode_data = get_markdown_data('decode_latencies', 'decode')
prefill_data = get_markdown_data('prefilll_latencies', 'prefill')
prefill_data = get_markdown_data('prefill_latencies', 'prefill')

return to_markdown_table(prefill_data) + "\n\n" + to_markdown_table(decode_data)

@pytest.mark.asyncio
Expand Down

0 comments on commit 235c5c2

Please sign in to comment.