badaoui HF Staff commited on
Commit
c91f4d9
·
1 Parent(s): e6fd07c

filter failing models

Browse files
Files changed (2) hide show
  1. app.py +194 -34
  2. styles.css +42 -14
app.py CHANGED
@@ -62,6 +62,34 @@ def model_has_failures(model_name):
62
  nvidia_single_failures > 0,
63
  ])
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  # Function to get current description text
67
  def get_description_text():
@@ -128,14 +156,6 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
128
  interactive=True,
129
  elem_classes=["history-view-button"]
130
  )
131
-
132
- # Toggle to show only failing models
133
- show_only_failing = gr.Checkbox(
134
- label="Show only failing models",
135
- value=False,
136
- interactive=True,
137
- elem_classes=["failing-models-toggle"]
138
- )
139
 
140
 
141
  # Model selection header (clickable toggle)
@@ -147,21 +167,42 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
147
 
148
  # Model buttons container (collapsible) - start folded
149
  with gr.Column(elem_classes=["model-list", "model-list-hidden"]) as model_list_container:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  # Create individual buttons for each model
151
  model_buttons = []
152
  model_choices = [model.lower() for model in Ci_results.available_models] if Ci_results.available_models else ["auto", "bert", "clip", "llama"]
153
 
154
- # Separate failing and passing models
155
- failing_models = []
 
 
156
  passing_models = []
157
 
158
  print(f"Creating {len(model_choices)} model buttons: {model_choices}")
159
 
160
  for model_name in model_choices:
161
- # Check if model has failures to determine styling
162
- has_failures = model_has_failures(model_name)
163
- if has_failures:
164
- failing_models.append(model_name)
 
 
 
 
 
165
  else:
166
  passing_models.append(model_name)
167
 
@@ -181,17 +222,44 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
181
  )
182
  model_buttons.append(btn)
183
 
184
- # Container for failing models only (hidden by default)
185
- failing_buttons = []
186
- with gr.Column(visible=False, elem_classes=["failing-models-container"]) as failing_models_container:
187
- for model_name in failing_models:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  btn = gr.Button(
189
  model_name,
190
  variant="secondary",
191
  size="sm",
192
  elem_classes=["model-button", "model-button-failed"]
193
  )
194
- failing_buttons.append(btn)
195
 
196
  # CI job links at bottom of sidebar
197
  ci_links_display = gr.Markdown("🔗 **CI Jobs:** *Loading...*", elem_classes=["sidebar-links"])
@@ -317,20 +385,59 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
317
  elem_classes=["plot-container"]
318
  )
319
 
320
- # Failing models toggle functionality
321
- def toggle_failing_models_filter(show_failing_only):
322
- """Toggle between showing all models and only failing models."""
323
- if show_failing_only:
324
- # Show only failing models container
325
- return gr.update(visible=False), gr.update(visible=True)
326
- else:
 
 
 
 
327
  # Show all models container
328
- return gr.update(visible=True), gr.update(visible=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
 
330
- show_only_failing.change(
331
- fn=toggle_failing_models_filter,
332
- inputs=[show_only_failing],
333
- outputs=[all_models_container, failing_models_container]
 
 
 
 
 
 
334
  )
335
 
336
  # Model toggle functionality
@@ -668,9 +775,62 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css(), js=js_func)
668
  ],
669
  )
670
 
671
- # Wire up failing model buttons (same functionality)
672
- for i, btn in enumerate(failing_buttons):
673
- model_name = failing_models[i]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
674
  btn.click(
675
  fn=lambda history_mode, m=model_name: handle_model_click(m, history_mode),
676
  inputs=[history_view_button],
 
62
  nvidia_single_failures > 0,
63
  ])
64
 
65
+ def model_has_amd_failures(model_name):
66
+ """Check if a model has AMD failures."""
67
+ if Ci_results.df is None or Ci_results.df.empty:
68
+ return False
69
+
70
+ model_name_lower = model_name.lower()
71
+ if model_name_lower not in Ci_results.df.index:
72
+ return False
73
+ row = Ci_results.df.loc[model_name_lower]
74
+
75
+ amd_multi_failures = row.get('failed_multi_no_amd', 0)
76
+ amd_single_failures = row.get('failed_single_no_amd', 0)
77
+ return amd_multi_failures > 0 or amd_single_failures > 0
78
+
79
+ def model_has_nvidia_failures(model_name):
80
+ """Check if a model has NVIDIA failures."""
81
+ if Ci_results.df is None or Ci_results.df.empty:
82
+ return False
83
+
84
+ model_name_lower = model_name.lower()
85
+ if model_name_lower not in Ci_results.df.index:
86
+ return False
87
+ row = Ci_results.df.loc[model_name_lower]
88
+
89
+ nvidia_multi_failures = row.get('failed_multi_no_nvidia', 0)
90
+ nvidia_single_failures = row.get('failed_single_no_nvidia', 0)
91
+ return nvidia_multi_failures > 0 or nvidia_single_failures > 0
92
+
93
 
94
  # Function to get current description text
95
  def get_description_text():
 
156
  interactive=True,
157
  elem_classes=["history-view-button"]
158
  )
 
 
 
 
 
 
 
 
159
 
160
 
161
  # Model selection header (clickable toggle)
 
167
 
168
  # Model buttons container (collapsible) - start folded
169
  with gr.Column(elem_classes=["model-list", "model-list-hidden"]) as model_list_container:
170
+ # Toggles for filtering failing models by device
171
+ with gr.Row(elem_classes=["failing-models-filter-row"]):
172
+ show_amd_failures = gr.Checkbox(
173
+ label="AMD failures",
174
+ value=False,
175
+ interactive=True,
176
+ elem_classes=["failing-models-toggle", "amd-toggle"]
177
+ )
178
+ show_nvidia_failures = gr.Checkbox(
179
+ label="NVIDIA failures",
180
+ value=False,
181
+ interactive=True,
182
+ elem_classes=["failing-models-toggle", "nvidia-toggle"]
183
+ )
184
  # Create individual buttons for each model
185
  model_buttons = []
186
  model_choices = [model.lower() for model in Ci_results.available_models] if Ci_results.available_models else ["auto", "bert", "clip", "llama"]
187
 
188
+ # Categorize models by failure type
189
+ amd_failing_models = []
190
+ nvidia_failing_models = []
191
+ both_failing_models = []
192
  passing_models = []
193
 
194
  print(f"Creating {len(model_choices)} model buttons: {model_choices}")
195
 
196
  for model_name in model_choices:
197
+ has_amd = model_has_amd_failures(model_name)
198
+ has_nvidia = model_has_nvidia_failures(model_name)
199
+
200
+ if has_amd and has_nvidia:
201
+ both_failing_models.append(model_name)
202
+ elif has_amd:
203
+ amd_failing_models.append(model_name)
204
+ elif has_nvidia:
205
+ nvidia_failing_models.append(model_name)
206
  else:
207
  passing_models.append(model_name)
208
 
 
222
  )
223
  model_buttons.append(btn)
224
 
225
+ # Container for AMD failures (hidden by default)
226
+ amd_buttons = []
227
+ with gr.Column(visible=False, elem_classes=["amd-failures-container"]) as amd_failures_container:
228
+ amd_models_to_show = amd_failing_models + both_failing_models
229
+ for model_name in sorted(amd_models_to_show):
230
+ btn = gr.Button(
231
+ model_name,
232
+ variant="secondary",
233
+ size="sm",
234
+ elem_classes=["model-button", "model-button-failed"]
235
+ )
236
+ amd_buttons.append(btn)
237
+
238
+ # Container for NVIDIA failures (hidden by default)
239
+ nvidia_buttons = []
240
+ with gr.Column(visible=False, elem_classes=["nvidia-failures-container"]) as nvidia_failures_container:
241
+ nvidia_models_to_show = nvidia_failing_models + both_failing_models
242
+ for model_name in sorted(nvidia_models_to_show):
243
+ btn = gr.Button(
244
+ model_name,
245
+ variant="secondary",
246
+ size="sm",
247
+ elem_classes=["model-button", "model-button-failed"]
248
+ )
249
+ nvidia_buttons.append(btn)
250
+
251
+ # Container for both AMD and NVIDIA failures (hidden by default)
252
+ both_buttons = []
253
+ with gr.Column(visible=False, elem_classes=["both-failures-container"]) as both_failures_container:
254
+ all_failing = list(set(amd_failing_models + nvidia_failing_models + both_failing_models))
255
+ for model_name in sorted(all_failing):
256
  btn = gr.Button(
257
  model_name,
258
  variant="secondary",
259
  size="sm",
260
  elem_classes=["model-button", "model-button-failed"]
261
  )
262
+ both_buttons.append(btn)
263
 
264
  # CI job links at bottom of sidebar
265
  ci_links_display = gr.Markdown("🔗 **CI Jobs:** *Loading...*", elem_classes=["sidebar-links"])
 
385
  elem_classes=["plot-container"]
386
  )
387
 
388
+ # Failing models filter functionality
389
+ def filter_failing_models(show_amd, show_nvidia):
390
+ """Filter models based on AMD and/or NVIDIA failures.
391
+
392
+ Logic:
393
+ - Neither checked: show all models
394
+ - AMD only: show models with AMD failures (including those with both)
395
+ - NVIDIA only: show models with NVIDIA failures (including those with both)
396
+ - Both checked: show all models with any failures
397
+ """
398
+ if not show_amd and not show_nvidia:
399
  # Show all models container
400
+ return (
401
+ gr.update(visible=True), # all_models_container
402
+ gr.update(visible=False), # amd_failures_container
403
+ gr.update(visible=False), # nvidia_failures_container
404
+ gr.update(visible=False), # both_failures_container
405
+ )
406
+ elif show_amd and not show_nvidia:
407
+ # Show AMD failures only
408
+ return (
409
+ gr.update(visible=False), # all_models_container
410
+ gr.update(visible=True), # amd_failures_container
411
+ gr.update(visible=False), # nvidia_failures_container
412
+ gr.update(visible=False), # both_failures_container
413
+ )
414
+ elif not show_amd and show_nvidia:
415
+ # Show NVIDIA failures only
416
+ return (
417
+ gr.update(visible=False), # all_models_container
418
+ gr.update(visible=False), # amd_failures_container
419
+ gr.update(visible=True), # nvidia_failures_container
420
+ gr.update(visible=False), # both_failures_container
421
+ )
422
+ else: # both checked
423
+ # Show all failures
424
+ return (
425
+ gr.update(visible=False), # all_models_container
426
+ gr.update(visible=False), # amd_failures_container
427
+ gr.update(visible=False), # nvidia_failures_container
428
+ gr.update(visible=True), # both_failures_container
429
+ )
430
 
431
+ # Connect both checkboxes to the filter function
432
+ show_amd_failures.change(
433
+ fn=filter_failing_models,
434
+ inputs=[show_amd_failures, show_nvidia_failures],
435
+ outputs=[all_models_container, amd_failures_container, nvidia_failures_container, both_failures_container]
436
+ )
437
+ show_nvidia_failures.change(
438
+ fn=filter_failing_models,
439
+ inputs=[show_amd_failures, show_nvidia_failures],
440
+ outputs=[all_models_container, amd_failures_container, nvidia_failures_container, both_failures_container]
441
  )
442
 
443
  # Model toggle functionality
 
775
  ],
776
  )
777
 
778
+ # Wire up AMD failing model buttons
779
+ amd_models_to_show = amd_failing_models + both_failing_models
780
+ for i, btn in enumerate(amd_buttons):
781
+ model_name = sorted(amd_models_to_show)[i]
782
+ btn.click(
783
+ fn=lambda history_mode, m=model_name: handle_model_click(m, history_mode),
784
+ inputs=[history_view_button],
785
+ outputs=[
786
+ plot_output,
787
+ amd_failed_tests_output,
788
+ nvidia_failed_tests_output,
789
+ current_view,
790
+ historical_view,
791
+ summary_display,
792
+ detail_view,
793
+ time_series_failure_rates,
794
+ time_series_amd_tests,
795
+ time_series_nvidia_tests,
796
+ time_series_amd_model_plot,
797
+ time_series_nvidia_model_plot,
798
+ time_series_detail_view,
799
+ selected_model_state,
800
+ in_model_view_state,
801
+ ],
802
+ )
803
+
804
+ # Wire up NVIDIA failing model buttons
805
+ nvidia_models_to_show = nvidia_failing_models + both_failing_models
806
+ for i, btn in enumerate(nvidia_buttons):
807
+ model_name = sorted(nvidia_models_to_show)[i]
808
+ btn.click(
809
+ fn=lambda history_mode, m=model_name: handle_model_click(m, history_mode),
810
+ inputs=[history_view_button],
811
+ outputs=[
812
+ plot_output,
813
+ amd_failed_tests_output,
814
+ nvidia_failed_tests_output,
815
+ current_view,
816
+ historical_view,
817
+ summary_display,
818
+ detail_view,
819
+ time_series_failure_rates,
820
+ time_series_amd_tests,
821
+ time_series_nvidia_tests,
822
+ time_series_amd_model_plot,
823
+ time_series_nvidia_model_plot,
824
+ time_series_detail_view,
825
+ selected_model_state,
826
+ in_model_view_state,
827
+ ],
828
+ )
829
+
830
+ # Wire up both failures model buttons
831
+ all_failing = list(set(amd_failing_models + nvidia_failing_models + both_failing_models))
832
+ for i, btn in enumerate(both_buttons):
833
+ model_name = sorted(all_failing)[i]
834
  btn.click(
835
  fn=lambda history_mode, m=model_name: handle_model_click(m, history_mode),
836
  inputs=[history_view_button],
styles.css CHANGED
@@ -194,45 +194,73 @@ div[data-testid="column"]:has(.sidebar) {
194
  transition: all 0.3s ease !important;
195
  }
196
 
197
- /* Failing models toggle styling */
198
- .failing-models-toggle {
199
  background: linear-gradient(145deg, #1a1a1a, #0f0f0f) !important;
200
  border: 1px solid #333 !important;
201
  border-radius: 6px !important;
202
- padding: 10px 12px !important;
203
- margin: 8px 0px 12px 0px !important;
204
- transition: all 0.3s ease !important;
 
 
 
 
 
 
 
 
 
205
  }
206
 
207
  .failing-models-toggle:hover {
208
- background: linear-gradient(145deg, #252525, #1a1a1a) !important;
209
- border-color: #444 !important;
210
  }
211
 
212
  .failing-models-toggle label {
213
- color: #E53E3E !important;
214
  font-family: monospace !important;
215
- font-size: 13px !important;
216
  font-weight: 600 !important;
217
  text-transform: uppercase !important;
218
  letter-spacing: 0.5px !important;
219
  cursor: pointer !important;
220
  display: flex !important;
221
  align-items: center !important;
 
 
 
 
 
 
 
 
 
222
  }
223
 
224
  .failing-models-toggle input[type="checkbox"] {
225
- accent-color: #E53E3E !important;
226
  cursor: pointer !important;
227
- width: 18px !important;
228
- height: 18px !important;
229
- margin-right: 8px !important;
230
  }
231
 
232
- .failing-models-toggle input[type="checkbox"]:checked {
233
  accent-color: #FF6B6B !important;
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
  /* Model button styling */
238
  .model-button {
 
194
  transition: all 0.3s ease !important;
195
  }
196
 
197
+ /* Failing models filter row */
198
+ .failing-models-filter-row {
199
  background: linear-gradient(145deg, #1a1a1a, #0f0f0f) !important;
200
  border: 1px solid #333 !important;
201
  border-radius: 6px !important;
202
+ padding: 8px 8px !important;
203
+ margin: 0px 0px 12px 0px !important;
204
+ gap: 8px !important;
205
+ }
206
+
207
+ /* Failing models toggle styling */
208
+ .failing-models-toggle {
209
+ background: transparent !important;
210
+ border: none !important;
211
+ padding: 4px 6px !important;
212
+ margin: 0 !important;
213
+ flex: 1 !important;
214
  }
215
 
216
  .failing-models-toggle:hover {
217
+ background: rgba(255, 255, 255, 0.05) !important;
218
+ border-radius: 4px !important;
219
  }
220
 
221
  .failing-models-toggle label {
 
222
  font-family: monospace !important;
223
+ font-size: 11px !important;
224
  font-weight: 600 !important;
225
  text-transform: uppercase !important;
226
  letter-spacing: 0.5px !important;
227
  cursor: pointer !important;
228
  display: flex !important;
229
  align-items: center !important;
230
+ white-space: nowrap !important;
231
+ }
232
+
233
+ .amd-toggle label {
234
+ color: #FF6B6B !important;
235
+ }
236
+
237
+ .nvidia-toggle label {
238
+ color: #76B900 !important;
239
  }
240
 
241
  .failing-models-toggle input[type="checkbox"] {
 
242
  cursor: pointer !important;
243
+ width: 16px !important;
244
+ height: 16px !important;
245
+ margin-right: 6px !important;
246
  }
247
 
248
+ .amd-toggle input[type="checkbox"] {
249
  accent-color: #FF6B6B !important;
250
  }
251
 
252
+ .nvidia-toggle input[type="checkbox"] {
253
+ accent-color: #76B900 !important;
254
+ }
255
+
256
+ .amd-toggle input[type="checkbox"]:checked {
257
+ accent-color: #FF8888 !important;
258
+ }
259
+
260
+ .nvidia-toggle input[type="checkbox"]:checked {
261
+ accent-color: #8BD918 !important;
262
+ }
263
+
264
 
265
  /* Model button styling */
266
  .model-button {