IlyasMoutawwakil HF staff commited on
Commit
9feeb78
·
1 Parent(s): e70447d

use reduction for latency instead of speedup

Browse files
Files changed (1) hide show
  1. run.py +12 -12
run.py CHANGED
@@ -149,10 +149,10 @@ def postprocess_table(table, experiment_name):
149
  table = table.set_index("experiment_name")
150
  table.reset_index(inplace=True)
151
  if "forward.latency(s)" in table.columns:
152
- table["forward.latency.speedup(%)"] = (
153
- 1 - table["forward.latency(s)"] / table["forward.latency(s)"].iloc[0]
154
  ) * 100
155
- table["forward.latency.speedup(%)"] = table["forward.latency.speedup(%)"].round(2)
156
 
157
  if "forward.throughput(samples/s)" in table.columns:
158
  table["forward.throughput.speedup(%)"] = (
@@ -161,16 +161,16 @@ def postprocess_table(table, experiment_name):
161
  table["forward.throughput.speedup(%)"] = table["forward.throughput.speedup(%)"].round(2)
162
 
163
  if "forward.peak_memory(MB)" in table.columns:
164
- table["forward.peak_memory.savings(%)"] = (
165
- 1 - table["forward.peak_memory(MB)"] / table["forward.peak_memory(MB)"].iloc[0]
166
  ) * 100
167
- table["forward.peak_memory.savings(%)"] = table["forward.peak_memory.savings(%)"].round(2)
168
 
169
  if "generate.latency(s)" in table.columns:
170
- table["generate.latency.speedup(%)"] = (
171
- 1 - table["generate.latency(s)"] / table["generate.latency(s)"].iloc[0]
172
  ) * 100
173
- table["generate.latency.speedup(%)"] = table["generate.latency.speedup(%)"].round(2)
174
 
175
  if "generate.throughput(tokens/s)" in table.columns:
176
  table["generate.throughput.speedup(%)"] = (
@@ -179,9 +179,9 @@ def postprocess_table(table, experiment_name):
179
  table["generate.throughput.speedup(%)"] = table["generate.throughput.speedup(%)"].round(2)
180
 
181
  if "generate.peak_memory(MB)" in table.columns:
182
- table["generate.peak_memory.savings(%)"] = (
183
- 1 - table["generate.peak_memory(MB)"] / table["generate.peak_memory(MB)"].iloc[0]
184
  ) * 100
185
- table["generate.peak_memory.savings(%)"] = table["generate.peak_memory.savings(%)"].round(2)
186
 
187
  return table
 
149
  table = table.set_index("experiment_name")
150
  table.reset_index(inplace=True)
151
  if "forward.latency(s)" in table.columns:
152
+ table["forward.latency.reduction(%)"] = (
153
+ table["forward.latency(s)"] / table["forward.latency(s)"].iloc[0] - 1
154
  ) * 100
155
+ table["forward.latency.reduction(%)"] = table["forward.latency.reduction(%)"].round(2)
156
 
157
  if "forward.throughput(samples/s)" in table.columns:
158
  table["forward.throughput.speedup(%)"] = (
 
161
  table["forward.throughput.speedup(%)"] = table["forward.throughput.speedup(%)"].round(2)
162
 
163
  if "forward.peak_memory(MB)" in table.columns:
164
+ table["forward.peak_memory.reduction(%)"] = (
165
+ table["forward.peak_memory(MB)"] / table["forward.peak_memory(MB)"].iloc[0] - 1
166
  ) * 100
167
+ table["forward.peak_memory.reduction(%)"] = table["forward.peak_memory.savings(%)"].round(2)
168
 
169
  if "generate.latency(s)" in table.columns:
170
+ table["generate.latency.reduction(%)"] = (
171
+ table["generate.latency(s)"] / table["generate.latency(s)"].iloc[0] - 1
172
  ) * 100
173
+ table["generate.latency.reduction(%)"] = table["generate.latency.reduction(%)"].round(2)
174
 
175
  if "generate.throughput(tokens/s)" in table.columns:
176
  table["generate.throughput.speedup(%)"] = (
 
179
  table["generate.throughput.speedup(%)"] = table["generate.throughput.speedup(%)"].round(2)
180
 
181
  if "generate.peak_memory(MB)" in table.columns:
182
+ table["generate.peak_memory.reduction(%)"] = (
183
+ table["generate.peak_memory(MB)"] / table["generate.peak_memory(MB)"].iloc[0] - 1
184
  ) * 100
185
+ table["generate.peak_memory.reduction(%)"] = table["generate.peak_memory.reduction(%)"].round(2)
186
 
187
  return table