ggcristian commited on
Commit
f2b1d62
·
1 Parent(s): 7b7fdcf

Add different column names for NST

Browse files
Files changed (5) hide show
  1. app.py +0 -1
  2. config/constants.py +14 -0
  3. data_processing.py +3 -3
  4. style/css_html_js.py +26 -0
  5. utils.py +48 -1
app.py CHANGED
@@ -80,7 +80,6 @@ def make_leaderboard_tab(state: Simulator, name: str, html: str=None):
80
  wrap=True,
81
  datatype=["html", "html"],
82
  interactive=False,
83
- column_widths=["7%", "28%", "13%", "10%", "13%", "10%", "14%"],
84
  elem_classes=elem_classes,
85
  )
86
 
 
80
  wrap=True,
81
  datatype=["html", "html"],
82
  interactive=False,
 
83
  elem_classes=elem_classes,
84
  )
85
 
config/constants.py CHANGED
@@ -48,6 +48,20 @@ COLUMN_ORDER = [
48
  "Post-Synthesis",
49
  ]
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  TYPE_COLORS = {"General": "green", "Coding": "yellow", "RTL-Specific": "blue"}
52
 
53
  Y_AXIS_LIMITS = {
 
48
  "Post-Synthesis",
49
  ]
50
 
51
+ NOTSOTINY_COLUMN_ORDER = [
52
+ "Type",
53
+ "Model",
54
+ "Parameters (B)",
55
+ "TT06",
56
+ "TT07",
57
+ "TT08",
58
+ "TT09",
59
+ "TT10 IHP 02",
60
+ "TT10 IHP 25a",
61
+ "TTSky25a",
62
+ "AVG",
63
+ ]
64
+
65
  TYPE_COLORS = {"General": "green", "Coding": "yellow", "RTL-Specific": "blue"}
66
 
67
  Y_AXIS_LIMITS = {
data_processing.py CHANGED
@@ -13,7 +13,7 @@ from config.constants import (
13
  Y_AXIS_LIMITS,
14
  DISCARDED_MODELS,
15
  )
16
- from utils import filter_bench, filter_bench_all, filter_RTLRepo, handle_special_cases
17
 
18
 
19
  # this is just a simple class to load the correct data depending on which sim we are at
@@ -93,6 +93,8 @@ def filter_leaderboard(task, benchmark, model_type, search_query, max_params, st
93
  return filter_RTLRepo(subset, name=name)
94
  elif benchmark == "RTL-Repo":
95
  return filter_RTLRepo(subset, name=name)
 
 
96
  else:
97
  agg_column = None
98
  if benchmark == "VerilogEval S2R":
@@ -103,8 +105,6 @@ def filter_leaderboard(task, benchmark, model_type, search_query, max_params, st
103
  agg_column = "Agg RTLLM"
104
  elif benchmark == "VeriGen":
105
  agg_column = "Agg VeriGen"
106
- elif benchmark == "NotSoTiny":
107
- agg_column = "Agg NotSoTiny"
108
 
109
  return filter_bench(subset, state.get_current_agg(), agg_column, name=name)
110
 
 
13
  Y_AXIS_LIMITS,
14
  DISCARDED_MODELS,
15
  )
16
+ from utils import filter_bench, filter_bench_all, filter_NotSoTiny, filter_RTLRepo, handle_special_cases
17
 
18
 
19
  # this is just a simple class to load the correct data depending on which sim we are at
 
93
  return filter_RTLRepo(subset, name=name)
94
  elif benchmark == "RTL-Repo":
95
  return filter_RTLRepo(subset, name=name)
96
+ elif benchmark == "NotSoTiny":
97
+ return filter_NotSoTiny(subset, name=name)
98
  else:
99
  agg_column = None
100
  if benchmark == "VerilogEval S2R":
 
105
  agg_column = "Agg RTLLM"
106
  elif benchmark == "VeriGen":
107
  agg_column = "Agg VeriGen"
 
 
108
 
109
  return filter_bench(subset, state.get_current_agg(), agg_column, name=name)
110
 
style/css_html_js.py CHANGED
@@ -123,12 +123,37 @@ input[role="listbox"] {
123
  .metrics-page p {
124
  text-align: left !important;
125
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  .dataframe-leaderboard td,
127
  .dataframe-leaderboard th {
128
  text-align: center !important;
129
  vertical-align: middle !important;
 
 
130
  }
131
 
 
132
  .dataframe-leaderboard th .cell-wrap,
133
  .dataframe-leaderboard th .header-content,
134
  .dataframe-leaderboard th .header-button,
@@ -140,6 +165,7 @@ input[role="listbox"] {
140
  text-align: center !important;
141
  }
142
 
 
143
  .dataframe-leaderboard tbody td:nth-child(3),
144
  .dataframe-leaderboard tbody td:nth-child(4) {
145
  text-align: left !important;
 
123
  .metrics-page p {
124
  text-align: left !important;
125
  }
126
+ /* Enable horizontal scrolling for tables with many columns (e.g., NotSoTiny) */
127
+ .dataframe-leaderboard,
128
+ .dataframe-other-models {
129
+ overflow-x: auto !important;
130
+ display: block !important;
131
+ max-width: 100% !important;
132
+ }
133
+
134
+ .dataframe-leaderboard .table-wrap,
135
+ .dataframe-leaderboard .wrap,
136
+ .dataframe-leaderboard > div,
137
+ .dataframe-leaderboard table,
138
+ .dataframe-other-models .table-wrap,
139
+ .dataframe-other-models .wrap,
140
+ .dataframe-other-models > div,
141
+ .dataframe-other-models table {
142
+ overflow-x: auto !important;
143
+ max-width: 100% !important;
144
+ width: max-content !important;
145
+ }
146
+
147
+ /* Default cell styling - centered with no wrapping */
148
  .dataframe-leaderboard td,
149
  .dataframe-leaderboard th {
150
  text-align: center !important;
151
  vertical-align: middle !important;
152
+ white-space: nowrap !important;
153
+ min-width: 80px !important;
154
  }
155
 
156
+ /* Center-align all table headers by default */
157
  .dataframe-leaderboard th .cell-wrap,
158
  .dataframe-leaderboard th .header-content,
159
  .dataframe-leaderboard th .header-button,
 
165
  text-align: center !important;
166
  }
167
 
168
+ /* Left-align Type and Model columns in main leaderboard */
169
  .dataframe-leaderboard tbody td:nth-child(3),
170
  .dataframe-leaderboard tbody td:nth-child(4) {
171
  text-align: left !important;
utils.py CHANGED
@@ -7,7 +7,7 @@ import plotly.express as px
7
  import plotly.graph_objects as go
8
  import re
9
 
10
- from config.constants import COLUMN_MAPPINGS, COLUMN_ORDER, TYPE_EMOJI, DISCARDED_MODELS
11
 
12
 
13
  def model_hyperlink(link, model_name, release, thinking=False):
@@ -81,6 +81,53 @@ def filter_RTLRepo(subset: pd.DataFrame, name=str) -> pd.DataFrame:
81
  return filtered_df
82
 
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  def filter_bench(subset: pd.DataFrame, df_agg=None, agg_column=None, name=str) -> pd.DataFrame:
85
  if subset.empty:
86
  return pd.DataFrame(columns=COLUMN_ORDER)
 
7
  import plotly.graph_objects as go
8
  import re
9
 
10
+ from config.constants import COLUMN_MAPPINGS, COLUMN_ORDER, NOTSOTINY_COLUMN_ORDER, TYPE_EMOJI, DISCARDED_MODELS
11
 
12
 
13
  def model_hyperlink(link, model_name, release, thinking=False):
 
81
  return filtered_df
82
 
83
 
84
+ def filter_NotSoTiny(subset: pd.DataFrame, name=str) -> pd.DataFrame:
85
+ if subset.empty:
86
+ return pd.DataFrame(columns=NOTSOTINY_COLUMN_ORDER)
87
+
88
+ subset = subset.drop(subset[subset["Score"] < 0.0].index)
89
+
90
+ if subset.empty:
91
+ return pd.DataFrame(columns=NOTSOTINY_COLUMN_ORDER)
92
+
93
+ details = subset[["Model", "Model URL", "Model Type", "Params", "Release", "Thinking"]].drop_duplicates(
94
+ "Model"
95
+ )
96
+
97
+ pivot_df = subset.pivot_table(index="Model", columns="Metric", values="Score").reset_index().round(2)
98
+
99
+ # AVG of TT cols...
100
+ tt_columns = ["TT06", "TT07", "TT08", "TT09", "TT10 IHP 02", "TT10 IHP 25a", "TTSky25a"]
101
+ available_tt_columns = [col for col in tt_columns if col in pivot_df.columns]
102
+ if available_tt_columns:
103
+ pivot_df["AVG"] = pivot_df[available_tt_columns].mean(axis=1).round(2)
104
+
105
+ pivot_df = pd.merge(pivot_df, details, on="Model", how="left")
106
+ pivot_df["Model"] = pivot_df.apply(
107
+ lambda row: model_hyperlink(
108
+ row["Model URL"],
109
+ row["Model"],
110
+ row["Release"],
111
+ row["Thinking"],
112
+ ),
113
+ axis=1,
114
+ )
115
+ pivot_df["Type"] = pivot_df["Model Type"].map(lambda x: TYPE_EMOJI.get(x, ""))
116
+ pivot_df.rename(columns={"Params": "Parameters (B)"}, inplace=True)
117
+
118
+ pivot_df = pivot_df[[col for col in NOTSOTINY_COLUMN_ORDER if col in pivot_df.columns]]
119
+
120
+ if "AVG" in pivot_df.columns:
121
+ pivot_df = pivot_df.sort_values(by="AVG", ascending=False).reset_index(drop=True)
122
+
123
+ if name == "Other Models":
124
+ pivot_df["Date Discarded"] = pivot_df["Model"].apply(lambda x: DISCARDED_MODELS.get(extract_name_from_link(x), "N/A"))
125
+ cols = ["Type", "Model", "Parameters (B)", "Date Discarded"] + tt_columns + ["AVG"]
126
+ pivot_df = pivot_df[[c for c in cols if c in pivot_df.columns]]
127
+
128
+ return pivot_df
129
+
130
+
131
  def filter_bench(subset: pd.DataFrame, df_agg=None, agg_column=None, name=str) -> pd.DataFrame:
132
  if subset.empty:
133
  return pd.DataFrame(columns=COLUMN_ORDER)