Spaces:
Running
Running
BenchmarkBot
commited on
Commit
Β·
c3c27bd
1
Parent(s):
014409b
allow quantized models on plot
Browse files
app.py
CHANGED
@@ -82,6 +82,11 @@ def get_benchmark_df(benchmark="1xA100-80GB"):
|
|
82 |
lambda x: TRUE_WEIGHT_CLASSES[x] if x in TRUE_WEIGHT_CLASSES else x
|
83 |
)
|
84 |
|
|
|
|
|
|
|
|
|
|
|
85 |
# add optimizations
|
86 |
merged_df["optimizations"] = merged_df[
|
87 |
["backend.bettertransformer", "backend.load_in_8bit", "backend.load_in_4bit"]
|
@@ -101,6 +106,8 @@ def get_benchmark_df(benchmark="1xA100-80GB"):
|
|
101 |
axis=1,
|
102 |
)
|
103 |
|
|
|
|
|
104 |
# create composite score
|
105 |
score_distance = 100 - merged_df["best_score"]
|
106 |
# normalize latency between 0 and 100
|
@@ -108,19 +115,16 @@ def get_benchmark_df(benchmark="1xA100-80GB"):
|
|
108 |
merged_df["tradeoff"] = (score_distance**2 + latency_distance**2) ** 0.5
|
109 |
merged_df["tradeoff"] = merged_df["tradeoff"].round(2)
|
110 |
|
111 |
-
# add * to quantized models
|
112 |
-
merged_df.loc[
|
113 |
-
merged_df["optimizations"].str.contains("LLM.int8|LLM.fp4"), "best_score"
|
114 |
-
] = merged_df.loc[
|
115 |
-
merged_df["optimizations"].str.contains("LLM.int8|LLM.fp4"), "best_score"
|
116 |
-
].apply(
|
117 |
-
lambda x: f"{x}*"
|
118 |
-
)
|
119 |
-
|
120 |
return merged_df
|
121 |
|
122 |
|
123 |
def get_benchmark_table(bench_df):
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
# sort
|
125 |
bench_df.sort_values(by=SORTING_COLUMN, ascending=True, inplace=True)
|
126 |
# filter
|
@@ -132,6 +136,7 @@ def get_benchmark_table(bench_df):
|
|
132 |
bench_df["Best Scored Model π"] = bench_df["Best Scored Model π"].apply(
|
133 |
process_model_name
|
134 |
)
|
|
|
135 |
return bench_df
|
136 |
|
137 |
|
|
|
82 |
lambda x: TRUE_WEIGHT_CLASSES[x] if x in TRUE_WEIGHT_CLASSES else x
|
83 |
)
|
84 |
|
85 |
+
# convert peak memory to int
|
86 |
+
merged_df["forward.peak_memory(MB)"] = merged_df["forward.peak_memory(MB)"].apply(
|
87 |
+
lambda x: int(x)
|
88 |
+
)
|
89 |
+
|
90 |
# add optimizations
|
91 |
merged_df["optimizations"] = merged_df[
|
92 |
["backend.bettertransformer", "backend.load_in_8bit", "backend.load_in_4bit"]
|
|
|
106 |
axis=1,
|
107 |
)
|
108 |
|
109 |
+
merged_df["quantized"] = merged_df["optimizations"].str.contains("LLM.int8|LLM.fp4")
|
110 |
+
|
111 |
# create composite score
|
112 |
score_distance = 100 - merged_df["best_score"]
|
113 |
# normalize latency between 0 and 100
|
|
|
115 |
merged_df["tradeoff"] = (score_distance**2 + latency_distance**2) ** 0.5
|
116 |
merged_df["tradeoff"] = merged_df["tradeoff"].round(2)
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
return merged_df
|
119 |
|
120 |
|
121 |
def get_benchmark_table(bench_df):
|
122 |
+
# add * to quantized models score
|
123 |
+
bench_df["best_score"] = bench_df.apply(
|
124 |
+
lambda x: f"{x['best_score']}**" if x["quantized"] else x["best_score"],
|
125 |
+
axis=1,
|
126 |
+
)
|
127 |
+
|
128 |
# sort
|
129 |
bench_df.sort_values(by=SORTING_COLUMN, ascending=True, inplace=True)
|
130 |
# filter
|
|
|
136 |
bench_df["Best Scored Model π"] = bench_df["Best Scored Model π"].apply(
|
137 |
process_model_name
|
138 |
)
|
139 |
+
|
140 |
return bench_df
|
141 |
|
142 |
|