Skip to content

Commit 2f9f759

Browse files
authored
Add num_trainable_params column to gradio app (#2819)
While memory usage correlates with the number of trainable params, having this number directly makes it easier to see that methods are using similar numbers of trainable params and outliers can be inspected easily.
1 parent 2410f45 commit 2f9f759

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

method_comparison/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"file_size": "lower",
3434
"test_accuracy": "higher",
3535
"train_loss": "lower",
36+
"num_trainable_params": "lower",
3637
}
3738

3839

method_comparison/processing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def preprocess(rows, task_name: str, print_fn=print):
5151
"total_time": run_info["total_time"],
5252
"train_time": train_info["train_time"],
5353
"file_size": train_info["file_size"],
54+
"num_trainable_params": train_info["num_trainable_params"],
5455
"test_accuracy": train_metrics["test accuracy"],
5556
"train_loss": train_metrics["train loss"],
5657
"train_samples": train_metrics["train samples"],
@@ -103,6 +104,7 @@ def load_df(path, task_name, print_fn=print):
103104
"train_loss": float,
104105
"train_samples": int,
105106
"train_total_tokens": int,
107+
"num_trainable_params": int,
106108
"peft_version": "string",
107109
"peft_branch": "string",
108110
"transformers_version": "string",
@@ -131,14 +133,14 @@ def load_df(path, task_name, print_fn=print):
131133
"accelerator_memory_max",
132134
"accelerator_memory_reserved_99th",
133135
"accelerator_memory_reserved_avg",
136+
"num_trainable_params",
134137
"file_size",
135138
"created_at",
136139
"task_name",
137140
]
138141
other_columns = [col for col in df if col not in important_columns]
139142
df = df[important_columns + other_columns]
140143

141-
size_before_drop_dups = len(df)
142144
columns = ["experiment_name", "model_id", "peft_type", "created_at"]
143145
# we want to keep only the most recent run for each experiment
144146
df = df.sort_values("created_at").drop_duplicates(columns, keep="last")

0 commit comments

Comments
 (0)