Spaces:
Running
Running
Commit
Β·
4b40065
1
Parent(s):
2732b14
test multiple hardware
Browse files- app.py +52 -74
- src/assets/css_html_js.py +7 -7
app.py
CHANGED
|
@@ -20,7 +20,7 @@ from src.utils import (
|
|
| 20 |
process_model_type,
|
| 21 |
)
|
| 22 |
|
| 23 |
-
|
| 24 |
LLM_PERF_LEADERBOARD_REPO = "optimum/llm-perf-leaderboard"
|
| 25 |
LLM_PERF_DATASET_REPO = "optimum/llm-perf-dataset"
|
| 26 |
OPTIMUM_TOKEN = os.environ.get("OPTIMUM_TOKEN", None)
|
|
@@ -180,7 +180,7 @@ def filter_query(
|
|
| 180 |
quantization_scheme,
|
| 181 |
score,
|
| 182 |
memory,
|
| 183 |
-
benchmark
|
| 184 |
):
|
| 185 |
raw_df = get_benchmark_df(benchmark=benchmark)
|
| 186 |
filtered_df = raw_df[
|
|
@@ -217,11 +217,6 @@ def filter_query(
|
|
| 217 |
return filtered_table, filtered_plot
|
| 218 |
|
| 219 |
|
| 220 |
-
# Dataframes
|
| 221 |
-
A100_df = get_benchmark_df(benchmark="Succeeded-1xA100-80GB")
|
| 222 |
-
A100_table = get_benchmark_table(A100_df)
|
| 223 |
-
A100_plot = get_benchmark_plot(A100_df)
|
| 224 |
-
|
| 225 |
# Demo interface
|
| 226 |
demo = gr.Blocks(css=custom_css)
|
| 227 |
with demo:
|
|
@@ -230,38 +225,48 @@ with demo:
|
|
| 230 |
# introduction text
|
| 231 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="descriptive-text")
|
| 232 |
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
)
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
|
|
|
|
| 259 |
with gr.TabItem("Control Panel ποΈ", id=2):
|
| 260 |
gr.HTML(
|
| 261 |
-
"Use this control panel to filter the leaderboard's table and plot.",
|
| 262 |
elem_id="descriptive-text",
|
| 263 |
)
|
| 264 |
-
# control panel interface
|
| 265 |
with gr.Row():
|
| 266 |
with gr.Column(scale=1):
|
| 267 |
search_bar = gr.Textbox(
|
|
@@ -325,43 +330,16 @@ with demo:
|
|
| 325 |
value="Filter π",
|
| 326 |
elem_id="filter-button",
|
| 327 |
)
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
score_slider,
|
| 342 |
-
memory_slider,
|
| 343 |
-
],
|
| 344 |
-
[A100_leaderboard, A100_plotly],
|
| 345 |
-
)
|
| 346 |
-
|
| 347 |
-
with gr.Row():
|
| 348 |
-
with gr.Accordion("π Citation", open=False):
|
| 349 |
-
citation_button = gr.Textbox(
|
| 350 |
-
value=CITATION_BUTTON_TEXT,
|
| 351 |
-
label=CITATION_BUTTON_LABEL,
|
| 352 |
-
elem_id="citation-button",
|
| 353 |
-
).style(show_copy_button=True)
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
# Restart space every hour
|
| 357 |
-
scheduler = BackgroundScheduler()
|
| 358 |
-
scheduler.add_job(
|
| 359 |
-
restart_space,
|
| 360 |
-
"interval",
|
| 361 |
-
seconds=3600,
|
| 362 |
-
args=[LLM_PERF_LEADERBOARD_REPO, OPTIMUM_TOKEN],
|
| 363 |
-
)
|
| 364 |
-
scheduler.start()
|
| 365 |
-
|
| 366 |
-
# Launch demo
|
| 367 |
-
demo.queue(concurrency_count=40).launch()
|
|
|
|
| 20 |
process_model_type,
|
| 21 |
)
|
| 22 |
|
| 23 |
+
HARDWARES = ["A100-80GB", "RTX4090-24GB"]
|
| 24 |
LLM_PERF_LEADERBOARD_REPO = "optimum/llm-perf-leaderboard"
|
| 25 |
LLM_PERF_DATASET_REPO = "optimum/llm-perf-dataset"
|
| 26 |
OPTIMUM_TOKEN = os.environ.get("OPTIMUM_TOKEN", None)
|
|
|
|
| 180 |
quantization_scheme,
|
| 181 |
score,
|
| 182 |
memory,
|
| 183 |
+
benchmark,
|
| 184 |
):
|
| 185 |
raw_df = get_benchmark_df(benchmark=benchmark)
|
| 186 |
filtered_df = raw_df[
|
|
|
|
| 217 |
return filtered_table, filtered_plot
|
| 218 |
|
| 219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
# Demo interface
|
| 221 |
demo = gr.Blocks(css=custom_css)
|
| 222 |
with demo:
|
|
|
|
| 225 |
# introduction text
|
| 226 |
gr.Markdown(INTRODUCTION_TEXT, elem_classes="descriptive-text")
|
| 227 |
|
| 228 |
+
with gr.Tabs(elem_classes="leaderboard-tabs"):
|
| 229 |
+
hardware_plots = {}
|
| 230 |
+
hardware_learboards = {}
|
| 231 |
+
####################### HARDWARE TABS #######################
|
| 232 |
+
for hardware in ["A100-80GB", "RTX4090-24GB"]:
|
| 233 |
+
hardware_df = get_benchmark_df(benchmark=f"Succeeded-1x{hardware}")
|
| 234 |
+
hardware_learboards[hardware] = get_benchmark_table(hardware_df)
|
| 235 |
+
hardware_plots[hardware] = get_benchmark_plot(hardware_df)
|
| 236 |
+
del hardware_df
|
| 237 |
+
with gr.TabItem(f"{hardware} π₯οΈ", id=hardware):
|
| 238 |
+
with gr.Tabs(elem_classes="hardware-tabs"):
|
| 239 |
+
with gr.TabItem("Leaderboard π
", id=0):
|
| 240 |
+
gr.HTML(
|
| 241 |
+
"π Scroll to the right π for additional columns.",
|
| 242 |
+
elem_id="descriptive-text",
|
| 243 |
+
)
|
| 244 |
+
# Original leaderboard table
|
| 245 |
+
hardware_leaderboard = gr.components.Dataframe(
|
| 246 |
+
value=hardware_learboards[hardware],
|
| 247 |
+
headers=list(ALL_COLUMNS_MAPPING.values()),
|
| 248 |
+
datatype=ALL_COLUMNS_DATATYPES,
|
| 249 |
+
elem_id="hardware-leaderboard",
|
| 250 |
+
# show_label=False,
|
| 251 |
+
)
|
| 252 |
+
with gr.TabItem("Plot π", id=1):
|
| 253 |
+
gr.HTML(
|
| 254 |
+
"π Hover over the points π for additional information.",
|
| 255 |
+
elem_id="descriptive-text",
|
| 256 |
+
)
|
| 257 |
+
# Original leaderboard plot
|
| 258 |
+
hardware_plotly = gr.components.Plot(
|
| 259 |
+
value=hardware_plots[hardware],
|
| 260 |
+
elem_id="hardware-plot",
|
| 261 |
+
show_label=False,
|
| 262 |
+
)
|
| 263 |
|
| 264 |
+
####################### CONTROL PANEL #######################
|
| 265 |
with gr.TabItem("Control Panel ποΈ", id=2):
|
| 266 |
gr.HTML(
|
| 267 |
+
"Use this control panel to filter the leaderboard's table and plot.", # noqa: E501
|
| 268 |
elem_id="descriptive-text",
|
| 269 |
)
|
|
|
|
| 270 |
with gr.Row():
|
| 271 |
with gr.Column(scale=1):
|
| 272 |
search_bar = gr.Textbox(
|
|
|
|
| 330 |
value="Filter π",
|
| 331 |
elem_id="filter-button",
|
| 332 |
)
|
| 333 |
+
for hardware in HARDWARES:
|
| 334 |
+
filter_button.click(
|
| 335 |
+
filter_query,
|
| 336 |
+
[
|
| 337 |
+
search_bar,
|
| 338 |
+
backend_checkboxes,
|
| 339 |
+
datatype_checkboxes,
|
| 340 |
+
optimizations_checkboxes,
|
| 341 |
+
quantization_checkboxes,
|
| 342 |
+
score_slider,
|
| 343 |
+
memory_slider,
|
| 344 |
+
],
|
| 345 |
+
[hardware_learbo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/assets/css_html_js.py
CHANGED
|
@@ -3,6 +3,13 @@ custom_css = """
|
|
| 3 |
font-size: 16px !important;
|
| 4 |
}
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
#citation-button span {
|
| 7 |
font-size: 16px !important;
|
| 8 |
}
|
|
@@ -15,11 +22,4 @@ custom_css = """
|
|
| 15 |
margin: 6px;
|
| 16 |
transform: scale(1.3);
|
| 17 |
}
|
| 18 |
-
|
| 19 |
-
.hardware-tabs button {
|
| 20 |
-
font-size: 20px;
|
| 21 |
-
}
|
| 22 |
-
.A100-tabs button {
|
| 23 |
-
font-size: 20px;
|
| 24 |
-
}
|
| 25 |
"""
|
|
|
|
| 3 |
font-size: 16px !important;
|
| 4 |
}
|
| 5 |
|
| 6 |
+
.leaderboard-tabs button {
|
| 7 |
+
font-size: 20px;
|
| 8 |
+
}
|
| 9 |
+
.hardware-tabs button {
|
| 10 |
+
font-size: 20px;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
#citation-button span {
|
| 14 |
font-size: 16px !important;
|
| 15 |
}
|
|
|
|
| 22 |
margin: 6px;
|
| 23 |
transform: scale(1.3);
|
| 24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
"""
|