Skip to content

Commit

Permalink
log results and models
Browse files Browse the repository at this point in the history
  • Loading branch information
songhappy committed Aug 28, 2024
1 parent 876d6d2 commit eec305d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/llm/dev/benchmark/all-in-one/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2062,13 +2062,15 @@ def run_pipeline_parallel_gpu(repo_id,
lookahead = True
run_model(model, api, in_out_pairs, conf['local_model_hub'], conf['warm_up'], conf['num_trials'], conf['num_beams'],
conf['low_bit'], conf['cpu_embedding'], batch_size, streaming, use_fp16_torch_dtype, lookahead, task, optimize_model)
print("-------------------- Finish running model: {} --------------------".format(model))
df = pd.DataFrame(results, columns=['model', '1st token avg latency (ms)', '2+ avg latency (ms/token)', 'encoder time (ms)',
'input/output tokens', 'batch_size', 'actual input/output tokens', 'num_beams', 'low_bit', 'cpu_embedding',
'model loading time (s)', 'peak mem (GB)', 'streaming', 'use_fp16_torch_dtype'])
print("-------------------- Results: {} --------------------".format(results))
if "pipeline" in api or "deepspeed" in api:
if torch.distributed.get_rank() == 0:
df.index += max(line_counter - 1, 0)
if line_counter == 0:
if line_counter == 0
df.to_csv(csv_name, mode='a', encoding='utf-8')
else:
df.to_csv(csv_name, mode='a', header=None, encoding='utf-8')
Expand All @@ -2082,3 +2084,4 @@ def run_pipeline_parallel_gpu(repo_id,
df.to_csv(csv_name, mode='a', header=None, encoding='utf-8')
line_counter += len(df.index)
results = []

0 comments on commit eec305d

Please sign in to comment.