baptistecolle HF staff commited on
Commit
003f467
β€’
1 Parent(s): 591a3e4

intel results accesible in the leaderboard

Browse files
Files changed (3) hide show
  1. app.py +14 -17
  2. src/llm_perf.py +7 -5
  3. src/panel.py +15 -7
app.py CHANGED
@@ -4,6 +4,7 @@ from src.assets import custom_css
4
 
5
  # from src.attention import create_attn_plots
6
  from src.content import ABOUT, CITATION_BUTTON, CITATION_BUTTON_LABEL, LOGO, TITLE
 
7
  from src.leaderboard import create_leaderboard_table
8
  from src.llm_perf import get_llm_perf_df
9
  from src.map import create_lat_score_mem_plot
@@ -13,15 +14,7 @@ from src.panel import (
13
  create_select_callback,
14
  )
15
 
16
- # from custom_kernels import create_quant_krnl_plots
17
-
18
- MACHINE_TO_HARDWARE = {
19
- "1xA10": "A10-24GB-150W πŸ–₯️",
20
- "1xA100": "A100-80GB-275W πŸ–₯️",
21
- "1xT4": "T4-16GB-70W πŸ–₯️",
22
- "intel": "4th-Gen-Intel-Xeon-385W πŸ–₯️",
23
- # "1xH100": "H100-80GB-700W πŸ–₯️",
24
- }
25
 
26
 
27
  demo = gr.Blocks(css=custom_css)
@@ -30,12 +23,13 @@ with demo:
30
  gr.HTML(TITLE, elem_classes="title")
31
  ####################### HARDWARE TABS #######################
32
  with gr.Tabs(elem_classes="tabs"):
33
- for id, (machine, hardware) in enumerate(MACHINE_TO_HARDWARE.items()):
34
- with gr.TabItem(hardware, id=id):
35
- ####################### CONTROL PANEL #######################
36
  (
37
  filter_button,
38
  machine_textbox,
 
39
  score_slider,
40
  memory_slider,
41
  backend_checkboxes,
@@ -43,17 +37,18 @@ with demo:
43
  optimization_checkboxes,
44
  quantization_checkboxes,
45
  kernels_checkboxes,
46
- ) = create_control_panel(machine=machine)
47
  ####################### HARDWARE SUBTABS #######################
48
  with gr.Tabs(elem_classes="subtabs"):
49
- open_llm_perf_df = get_llm_perf_df(machine=machine)
50
  ####################### LEADERBOARD TAB #######################
51
  with gr.TabItem("Leaderboard πŸ…", id=0):
52
  search_bar, columns_checkboxes, leaderboard_table = (
53
  create_leaderboard_table(open_llm_perf_df)
54
  )
55
- with gr.TabItem("Find Your Best Model 🧭", id=1):
56
- lat_score_mem_plot = create_lat_score_mem_plot(open_llm_perf_df)
 
57
  ###################### ATTENTIONS SPEEDUP TAB #######################
58
  # with gr.TabItem("Attention πŸ“ˆ", id=2):
59
  # attn_prefill_plot, attn_decode_plot = create_attn_plots(
@@ -70,6 +65,7 @@ with demo:
70
  filter_button,
71
  # inputs
72
  machine_textbox,
 
73
  score_slider,
74
  memory_slider,
75
  backend_checkboxes,
@@ -92,6 +88,7 @@ with demo:
92
  create_select_callback(
93
  # inputs
94
  machine_textbox,
 
95
  # interactive
96
  columns_checkboxes,
97
  search_bar,
@@ -100,7 +97,7 @@ with demo:
100
  )
101
 
102
  ####################### ABOUT TAB #######################
103
- with gr.TabItem("About πŸ“–", id=3):
104
  gr.Markdown(ABOUT, elem_classes="descriptive-text")
105
  ####################### CITATION
106
  with gr.Row():
 
4
 
5
  # from src.attention import create_attn_plots
6
  from src.content import ABOUT, CITATION_BUTTON, CITATION_BUTTON_LABEL, LOGO, TITLE
7
+ from src.hardware import load_hardware_configs
8
  from src.leaderboard import create_leaderboard_table
9
  from src.llm_perf import get_llm_perf_df
10
  from src.map import create_lat_score_mem_plot
 
14
  create_select_callback,
15
  )
16
 
17
+ configs = load_hardware_configs("hardware.yml")
 
 
 
 
 
 
 
 
18
 
19
 
20
  demo = gr.Blocks(css=custom_css)
 
23
  gr.HTML(TITLE, elem_classes="title")
24
  ####################### HARDWARE TABS #######################
25
  with gr.Tabs(elem_classes="tabs"):
26
+ for id, config in enumerate(configs):
27
+ with gr.TabItem(config.description, id=id):
28
+ # ####################### CONTROL PANEL #######################
29
  (
30
  filter_button,
31
  machine_textbox,
32
+ subsets_values,
33
  score_slider,
34
  memory_slider,
35
  backend_checkboxes,
 
37
  optimization_checkboxes,
38
  quantization_checkboxes,
39
  kernels_checkboxes,
40
+ ) = create_control_panel(machine=config.machine, subsets=config.subsets)
41
  ####################### HARDWARE SUBTABS #######################
42
  with gr.Tabs(elem_classes="subtabs"):
43
+ open_llm_perf_df = get_llm_perf_df(machine=config.machine, subsets=config.subsets)
44
  ####################### LEADERBOARD TAB #######################
45
  with gr.TabItem("Leaderboard πŸ…", id=0):
46
  search_bar, columns_checkboxes, leaderboard_table = (
47
  create_leaderboard_table(open_llm_perf_df)
48
  )
49
+ if config.hardware_type != "intel": # TODO intel CPU does not measure the memory requirements correctly, so disable the graph feature until we fix the underlying issue
50
+ with gr.TabItem("Find Your Best Model 🧭", id=1):
51
+ lat_score_mem_plot = create_lat_score_mem_plot(open_llm_perf_df)
52
  ###################### ATTENTIONS SPEEDUP TAB #######################
53
  # with gr.TabItem("Attention πŸ“ˆ", id=2):
54
  # attn_prefill_plot, attn_decode_plot = create_attn_plots(
 
65
  filter_button,
66
  # inputs
67
  machine_textbox,
68
+ subsets_values,
69
  score_slider,
70
  memory_slider,
71
  backend_checkboxes,
 
88
  create_select_callback(
89
  # inputs
90
  machine_textbox,
91
+ subsets_values,
92
  # interactive
93
  columns_checkboxes,
94
  search_bar,
 
97
  )
98
 
99
  ####################### ABOUT TAB #######################
100
+ with gr.TabItem("About πŸ“–", id=len(configs)):
101
  gr.Markdown(ABOUT, elem_classes="descriptive-text")
102
  ####################### CITATION
103
  with gr.Row():
src/llm_perf.py CHANGED
@@ -1,7 +1,10 @@
1
  import os
 
2
 
3
  import pandas as pd
4
 
 
 
5
  from .utils import process_kernels, process_quantizations
6
 
7
  DATASET_DIRECTORY = "dataset"
@@ -28,13 +31,12 @@ COLUMNS_MAPPING = {
28
  "#Params (B)": "Params (B)",
29
  }
30
  SORTING_COLUMNS = ["Open LLM Score (%)", "Decode (tokens/s)", "Prefill (s)"]
31
- SUBSETS = ["unquantized", "awq", "bnb", "gptq"]
32
  SORTING_ASCENDING = [False, True, False]
33
 
34
 
35
- def get_raw_llm_perf_df(machine: str = "1xA10"):
36
  dfs = []
37
- for subset in SUBSETS:
38
  try:
39
  dfs.append(
40
  pd.read_csv(
@@ -110,14 +112,14 @@ def processed_llm_perf_df(llm_perf_df):
110
  return llm_perf_df
111
 
112
 
113
- def get_llm_perf_df(machine: str = "1xA10"):
114
  if not os.path.exists(DATASET_DIRECTORY):
115
  os.makedirs(DATASET_DIRECTORY)
116
 
117
  if os.path.exists(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv"):
118
  llm_perf_df = pd.read_csv(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv")
119
  else:
120
- llm_perf_df = get_raw_llm_perf_df(machine)
121
  llm_perf_df = processed_llm_perf_df(llm_perf_df)
122
  llm_perf_df.to_csv(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv", index=False)
123
 
 
1
  import os
2
+ from typing import List
3
 
4
  import pandas as pd
5
 
6
+ from src.hardware import HardwareConfig
7
+
8
  from .utils import process_kernels, process_quantizations
9
 
10
  DATASET_DIRECTORY = "dataset"
 
31
  "#Params (B)": "Params (B)",
32
  }
33
  SORTING_COLUMNS = ["Open LLM Score (%)", "Decode (tokens/s)", "Prefill (s)"]
 
34
  SORTING_ASCENDING = [False, True, False]
35
 
36
 
37
+ def get_raw_llm_perf_df(machine: str, subsets: List[str]):
38
  dfs = []
39
+ for subset in subsets:
40
  try:
41
  dfs.append(
42
  pd.read_csv(
 
112
  return llm_perf_df
113
 
114
 
115
+ def get_llm_perf_df(machine: str, subsets: List[str]):
116
  if not os.path.exists(DATASET_DIRECTORY):
117
  os.makedirs(DATASET_DIRECTORY)
118
 
119
  if os.path.exists(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv"):
120
  llm_perf_df = pd.read_csv(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv")
121
  else:
122
+ llm_perf_df = get_raw_llm_perf_df(machine, subsets)
123
  llm_perf_df = processed_llm_perf_df(llm_perf_df)
124
  llm_perf_df.to_csv(f"{DATASET_DIRECTORY}/llm-perf-leaderboard-{machine}.csv", index=False)
125
 
src/panel.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import gradio as gr
2
 
3
  from src.leaderboard import get_leaderboard_df
@@ -8,9 +10,10 @@ from src.llm_perf import get_llm_perf_df
8
  from src.map import get_lat_score_mem_fig
9
 
10
 
11
- def create_control_panel(machine: str):
12
  # controls
13
  machine_textbox = gr.Textbox(value=machine, visible=False)
 
14
  with gr.Accordion("Control Panel πŸŽ›οΈ", open=False, elem_id="control-panel"):
15
  with gr.Row():
16
  with gr.Column(scale=2, variant="panel"):
@@ -107,6 +110,7 @@ def create_control_panel(machine: str):
107
  return (
108
  filter_button,
109
  machine_textbox,
 
110
  score_slider,
111
  memory_slider,
112
  backend_checkboxes,
@@ -119,6 +123,7 @@ def create_control_panel(machine: str):
119
 
120
  def filter_rows_fn(
121
  machine,
 
122
  # inputs
123
  score,
124
  memory,
@@ -131,7 +136,7 @@ def filter_rows_fn(
131
  columns,
132
  search,
133
  ):
134
- llm_perf_df = get_llm_perf_df(machine=machine)
135
  # print(attentions)
136
  # print(llm_perf_df["Attention πŸ‘οΈ"].unique())
137
  filtered_llm_perf_df = llm_perf_df[
@@ -145,7 +150,7 @@ def filter_rows_fn(
145
  & (llm_perf_df["Memory (MB)"] <= memory)
146
  ]
147
  selected_filtered_llm_perf_df = select_columns_fn(
148
- machine, columns, search, filtered_llm_perf_df
149
  )
150
  selected_filtered_lat_score_mem_fig = get_lat_score_mem_fig(filtered_llm_perf_df)
151
  # filtered_bt_prefill_fig = get_bt_prefill_fig(filtered_df)
@@ -172,6 +177,7 @@ def create_control_callback(
172
  filter_button,
173
  # fixed
174
  machine_textbox,
 
175
  # inputs
176
  score_slider,
177
  memory_slider,
@@ -198,6 +204,7 @@ def create_control_callback(
198
  inputs=[
199
  # fixed
200
  machine_textbox,
 
201
  # inputs
202
  score_slider,
203
  memory_slider,
@@ -223,9 +230,9 @@ def create_control_callback(
223
  )
224
 
225
 
226
- def select_columns_fn(machine, columns, search, llm_perf_df=None):
227
  if llm_perf_df is None:
228
- llm_perf_df = get_llm_perf_df(machine=machine)
229
 
230
  selected_leaderboard_df = get_leaderboard_df(llm_perf_df)
231
  selected_leaderboard_df = selected_leaderboard_df[
@@ -239,6 +246,7 @@ def select_columns_fn(machine, columns, search, llm_perf_df=None):
239
  def create_select_callback(
240
  # fixed
241
  machine_textbox,
 
242
  # interactive
243
  columns_checkboxes,
244
  search_bar,
@@ -247,11 +255,11 @@ def create_select_callback(
247
  ):
248
  columns_checkboxes.change(
249
  fn=select_columns_fn,
250
- inputs=[machine_textbox, columns_checkboxes, search_bar],
251
  outputs=[leaderboard_table],
252
  )
253
  search_bar.change(
254
  fn=select_columns_fn,
255
- inputs=[machine_textbox, columns_checkboxes, search_bar],
256
  outputs=[leaderboard_table],
257
  )
 
1
+ from typing import List
2
+
3
  import gradio as gr
4
 
5
  from src.leaderboard import get_leaderboard_df
 
10
  from src.map import get_lat_score_mem_fig
11
 
12
 
13
+ def create_control_panel(machine: str, subsets: List[str]):
14
  # controls
15
  machine_textbox = gr.Textbox(value=machine, visible=False)
16
+ subsets_values = gr.State(value=subsets)
17
  with gr.Accordion("Control Panel πŸŽ›οΈ", open=False, elem_id="control-panel"):
18
  with gr.Row():
19
  with gr.Column(scale=2, variant="panel"):
 
110
  return (
111
  filter_button,
112
  machine_textbox,
113
+ subsets_values,
114
  score_slider,
115
  memory_slider,
116
  backend_checkboxes,
 
123
 
124
  def filter_rows_fn(
125
  machine,
126
+ subsets,
127
  # inputs
128
  score,
129
  memory,
 
136
  columns,
137
  search,
138
  ):
139
+ llm_perf_df = get_llm_perf_df(machine=machine, subsets=subsets)
140
  # print(attentions)
141
  # print(llm_perf_df["Attention πŸ‘οΈ"].unique())
142
  filtered_llm_perf_df = llm_perf_df[
 
150
  & (llm_perf_df["Memory (MB)"] <= memory)
151
  ]
152
  selected_filtered_llm_perf_df = select_columns_fn(
153
+ machine, subsets, columns, search, filtered_llm_perf_df
154
  )
155
  selected_filtered_lat_score_mem_fig = get_lat_score_mem_fig(filtered_llm_perf_df)
156
  # filtered_bt_prefill_fig = get_bt_prefill_fig(filtered_df)
 
177
  filter_button,
178
  # fixed
179
  machine_textbox,
180
+ subsets_textbox,
181
  # inputs
182
  score_slider,
183
  memory_slider,
 
204
  inputs=[
205
  # fixed
206
  machine_textbox,
207
+ subsets_textbox,
208
  # inputs
209
  score_slider,
210
  memory_slider,
 
230
  )
231
 
232
 
233
+ def select_columns_fn(machine, subsets, columns, search, llm_perf_df=None):
234
  if llm_perf_df is None:
235
+ llm_perf_df = get_llm_perf_df(machine=machine, subsets=subsets)
236
 
237
  selected_leaderboard_df = get_leaderboard_df(llm_perf_df)
238
  selected_leaderboard_df = selected_leaderboard_df[
 
246
  def create_select_callback(
247
  # fixed
248
  machine_textbox,
249
+ subsets_values,
250
  # interactive
251
  columns_checkboxes,
252
  search_bar,
 
255
  ):
256
  columns_checkboxes.change(
257
  fn=select_columns_fn,
258
+ inputs=[machine_textbox, subsets_values, columns_checkboxes, search_bar],
259
  outputs=[leaderboard_table],
260
  )
261
  search_bar.change(
262
  fn=select_columns_fn,
263
+ inputs=[machine_textbox, subsets_values, columns_checkboxes, search_bar],
264
  outputs=[leaderboard_table],
265
  )