agh123 commited on
Commit
8121e85
·
1 Parent(s): 2a89186

add Versions

Browse files
src/components/filters.py CHANGED
@@ -17,6 +17,7 @@ def render_grouping_options() -> List[str]:
17
  "n_context",
18
  "n_batch",
19
  "n_ubatch",
 
20
  ]
21
 
22
  default_groups = [
@@ -31,7 +32,7 @@ def render_grouping_options() -> List[str]:
31
  "TG Config",
32
  ]
33
 
34
- #st.markdown("### Group Results")
35
  selected_groups = st.multiselect(
36
  "Group By",
37
  options=available_groups,
@@ -113,16 +114,25 @@ def render_column_visibility() -> Set[str]:
113
  return selected_columns
114
 
115
 
116
- def render_filters(models: List[str], platforms: List[str], devices: List[str],
117
- cache_type_v: List[str], cache_type_k: List[str], pp_range: Tuple[int, int],
118
- tg_range: Tuple[int, int], n_threads: Tuple[int, int], versions: List[str], max_n_gpu_layers: int) -> Dict:
 
 
 
 
 
 
 
 
 
119
  """Render all filters in a compact two-row layout"""
120
  filters = {}
121
 
122
  # Row 1: Grouping
123
  filters["grouping"] = render_grouping_options()
124
 
125
- st.markdown("**Filters**")
126
  # Row 2: All filters in columns
127
  # col1 = st.columns(1)
128
 
@@ -159,7 +169,6 @@ def render_filters(models: List[str], platforms: List[str], devices: List[str],
159
  "Cache Type V", options=["All"] + cache_type_v, key="filter_cache_type_v"
160
  )
161
 
162
-
163
  with col7:
164
  filters["pp_range"] = st.slider(
165
  "PP Range",
@@ -182,11 +191,15 @@ def render_filters(models: List[str], platforms: List[str], devices: List[str],
182
 
183
  with col9:
184
  filters["n_threads"] = st.slider(
185
- "Threads", min_value=n_threads[0], max_value=n_threads[1], value=n_threads, key="filter_threads"
 
 
 
 
186
  )
187
 
188
  with col10:
189
- filters["Version"] = st.multiselect(
190
  "Version", options=["All"] + versions, key="filter_version"
191
  )
192
 
@@ -197,14 +210,54 @@ def render_filters(models: List[str], platforms: List[str], devices: List[str],
197
 
198
 
199
  def render_table_filters(
200
- models: List[str], platforms: List[str], devices: List[str], cache_type_v: List[str], cache_type_k: List[str], pp_range: Tuple[int, int], tg_range: Tuple[int, int], n_threads: Tuple[int, int], versions: List[str], max_n_gpu_layers: int
 
 
 
 
 
 
 
 
 
201
  ) -> Dict:
202
  """Main entry point for table filters"""
203
- return render_filters(models, platforms, devices, cache_type_v, cache_type_k, pp_range, tg_range, n_threads, versions, max_n_gpu_layers)
 
 
 
 
 
 
 
 
 
 
 
204
 
205
 
206
  def render_plot_filters(
207
- models: List[str], platforms: List[str], devices: List[str], cache_type_v: List[str], cache_type_k: List[str], pp_range: Tuple[int, int], tg_range: Tuple[int, int], n_threads: Tuple[int, int], versions: List[str], max_n_gpu_layers: int
 
 
 
 
 
 
 
 
 
208
  ) -> Dict:
209
  """Main entry point for plot filters"""
210
- return render_filters(models, platforms, devices, cache_type_v, cache_type_k, pp_range, tg_range, n_threads, versions, max_n_gpu_layers)
 
 
 
 
 
 
 
 
 
 
 
 
17
  "n_context",
18
  "n_batch",
19
  "n_ubatch",
20
+ "Version",
21
  ]
22
 
23
  default_groups = [
 
32
  "TG Config",
33
  ]
34
 
35
+ # st.markdown("### Group Results")
36
  selected_groups = st.multiselect(
37
  "Group By",
38
  options=available_groups,
 
114
  return selected_columns
115
 
116
 
117
+ def render_filters(
118
+ models: List[str],
119
+ platforms: List[str],
120
+ devices: List[str],
121
+ cache_type_v: List[str],
122
+ cache_type_k: List[str],
123
+ pp_range: Tuple[int, int],
124
+ tg_range: Tuple[int, int],
125
+ n_threads: Tuple[int, int],
126
+ versions: List[str],
127
+ max_n_gpu_layers: int,
128
+ ) -> Dict:
129
  """Render all filters in a compact two-row layout"""
130
  filters = {}
131
 
132
  # Row 1: Grouping
133
  filters["grouping"] = render_grouping_options()
134
 
135
+ # st.markdown("**Filters**")
136
  # Row 2: All filters in columns
137
  # col1 = st.columns(1)
138
 
 
169
  "Cache Type V", options=["All"] + cache_type_v, key="filter_cache_type_v"
170
  )
171
 
 
172
  with col7:
173
  filters["pp_range"] = st.slider(
174
  "PP Range",
 
191
 
192
  with col9:
193
  filters["n_threads"] = st.slider(
194
+ "Threads",
195
+ min_value=n_threads[0],
196
+ max_value=n_threads[1],
197
+ value=n_threads,
198
+ key="filter_threads",
199
  )
200
 
201
  with col10:
202
+ filters["Version"] = st.selectbox(
203
  "Version", options=["All"] + versions, key="filter_version"
204
  )
205
 
 
210
 
211
 
212
  def render_table_filters(
213
+ models: List[str],
214
+ platforms: List[str],
215
+ devices: List[str],
216
+ cache_type_v: List[str],
217
+ cache_type_k: List[str],
218
+ pp_range: Tuple[int, int],
219
+ tg_range: Tuple[int, int],
220
+ n_threads: Tuple[int, int],
221
+ versions: List[str],
222
+ max_n_gpu_layers: int,
223
  ) -> Dict:
224
  """Main entry point for table filters"""
225
+ return render_filters(
226
+ models,
227
+ platforms,
228
+ devices,
229
+ cache_type_v,
230
+ cache_type_k,
231
+ pp_range,
232
+ tg_range,
233
+ n_threads,
234
+ versions,
235
+ max_n_gpu_layers,
236
+ )
237
 
238
 
239
  def render_plot_filters(
240
+ models: List[str],
241
+ platforms: List[str],
242
+ devices: List[str],
243
+ cache_type_v: List[str],
244
+ cache_type_k: List[str],
245
+ pp_range: Tuple[int, int],
246
+ tg_range: Tuple[int, int],
247
+ n_threads: Tuple[int, int],
248
+ versions: List[str],
249
+ max_n_gpu_layers: int,
250
  ) -> Dict:
251
  """Main entry point for plot filters"""
252
+ return render_filters(
253
+ models,
254
+ platforms,
255
+ devices,
256
+ cache_type_v,
257
+ cache_type_k,
258
+ pp_range,
259
+ tg_range,
260
+ n_threads,
261
+ versions,
262
+ max_n_gpu_layers,
263
+ )
src/components/visualizations.py CHANGED
@@ -55,10 +55,14 @@ def filter_dataframe(df: pd.DataFrame, filters: Dict) -> pd.DataFrame:
55
 
56
  # Cache Type filters
57
  if filters["cache_type_k"] != "All":
58
- filtered_df = filtered_df[filtered_df["cache_type_k"] == filters["cache_type_k"]]
 
 
59
 
60
  if filters["cache_type_v"] != "All":
61
- filtered_df = filtered_df[filtered_df["cache_type_v"] == filters["cache_type_v"]]
 
 
62
 
63
  # Range filters
64
  pp_min, pp_max = filters["pp_range"]
@@ -71,7 +75,6 @@ def filter_dataframe(df: pd.DataFrame, filters: Dict) -> pd.DataFrame:
71
  tg_values = filtered_df["TG Config"]
72
  filtered_df = filtered_df[(tg_values >= tg_min) & (tg_values <= tg_max)]
73
 
74
-
75
  n_threads_min, n_threads_max = filters["n_threads"]
76
 
77
  if n_threads_min is not None and n_threads_max is not None:
@@ -81,9 +84,8 @@ def filter_dataframe(df: pd.DataFrame, filters: Dict) -> pd.DataFrame:
81
  ]
82
 
83
  # Version filter - handle multiple selections
84
- if filters.get("version") != "All" and filters.get("version"):
85
- filtered_df = filtered_df[filtered_df["Version"].isin(filters["version"])]
86
-
87
 
88
  return filtered_df
89
 
@@ -230,6 +232,9 @@ def render_leaderboard_table(df: pd.DataFrame, filters: Dict):
230
  "Total Memory (GB)": "first", # For a given model, device, platform, mem should be the same.
231
  "CPU Cores": "first", # For a given model, device, platform, cpu cores should be the same.
232
  "Model Size": "first", # model size should be the same for all.
 
 
 
233
  }.items()
234
  if col not in grouping_cols
235
  }
@@ -283,6 +288,7 @@ def render_leaderboard_table(df: pd.DataFrame, filters: Dict):
283
  by=sort_cols, ascending=[False] + [True] * (len(sort_cols) - 1)
284
  )
285
 
 
286
  # Rename columns for display
287
  column_mapping = {
288
  "Prompt Processing (mean)": "PP Avg (t/s)",
@@ -304,6 +310,7 @@ def render_leaderboard_table(df: pd.DataFrame, filters: Dict):
304
  "n_context (first)": "n_context",
305
  "n_batch (first)": "n_batch",
306
  "n_ubatch (first)": "n_ubatch",
 
307
  }
308
  grouped_df = grouped_df.rename(columns=column_mapping)
309
 
 
55
 
56
  # Cache Type filters
57
  if filters["cache_type_k"] != "All":
58
+ filtered_df = filtered_df[
59
+ filtered_df["cache_type_k"] == filters["cache_type_k"]
60
+ ]
61
 
62
  if filters["cache_type_v"] != "All":
63
+ filtered_df = filtered_df[
64
+ filtered_df["cache_type_v"] == filters["cache_type_v"]
65
+ ]
66
 
67
  # Range filters
68
  pp_min, pp_max = filters["pp_range"]
 
75
  tg_values = filtered_df["TG Config"]
76
  filtered_df = filtered_df[(tg_values >= tg_min) & (tg_values <= tg_max)]
77
 
 
78
  n_threads_min, n_threads_max = filters["n_threads"]
79
 
80
  if n_threads_min is not None and n_threads_max is not None:
 
84
  ]
85
 
86
  # Version filter - handle multiple selections
87
+ if filters.get("Version") != "All" and filters.get("Version"):
88
+ filtered_df = filtered_df[filtered_df["Version"] == filters["Version"]]
 
89
 
90
  return filtered_df
91
 
 
232
  "Total Memory (GB)": "first", # For a given model, device, platform, mem should be the same.
233
  "CPU Cores": "first", # For a given model, device, platform, cpu cores should be the same.
234
  "Model Size": "first", # model size should be the same for all.
235
+ "Version": lambda x: ", ".join(
236
+ sorted(set(x))
237
+ ), # Concatenate unique versions
238
  }.items()
239
  if col not in grouping_cols
240
  }
 
288
  by=sort_cols, ascending=[False] + [True] * (len(sort_cols) - 1)
289
  )
290
 
291
+
292
  # Rename columns for display
293
  column_mapping = {
294
  "Prompt Processing (mean)": "PP Avg (t/s)",
 
310
  "n_context (first)": "n_context",
311
  "n_batch (first)": "n_batch",
312
  "n_ubatch (first)": "n_ubatch",
313
+ "Version (<lambda>)": "Version",
314
  }
315
  grouped_df = grouped_df.rename(columns=column_mapping)
316