AppleSwing
commited on
Commit
•
60d9c33
1
Parent(s):
b2a2a5b
Add GPU types
Browse files- app.py +45 -34
- src/display/utils.py +18 -0
app.py
CHANGED
@@ -36,6 +36,7 @@ from src.display.utils import (
|
|
36 |
fields,
|
37 |
WeightType,
|
38 |
Precision,
|
|
|
39 |
)
|
40 |
|
41 |
from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, H4_TOKEN, IS_PUBLIC, \
|
@@ -155,47 +156,47 @@ shown_columns = None
|
|
155 |
dataset_df, original_df, finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = init_space()
|
156 |
leaderboard_df = original_df.copy()
|
157 |
|
158 |
-
def update_leaderboard_table():
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
|
167 |
|
168 |
-
def update_hidden_leaderboard_table():
|
169 |
-
|
170 |
-
|
171 |
|
172 |
-
def update_dataset_table():
|
173 |
-
|
174 |
-
|
175 |
|
176 |
-
def update_finish_table():
|
177 |
-
|
178 |
-
|
179 |
|
180 |
-
def update_running_table():
|
181 |
-
|
182 |
-
|
183 |
|
184 |
-
def update_pending_table():
|
185 |
-
|
186 |
-
|
187 |
|
188 |
-
def update_finish_num():
|
189 |
-
|
190 |
-
|
191 |
|
192 |
-
def update_running_num():
|
193 |
-
|
194 |
-
|
195 |
|
196 |
-
def update_pending_num():
|
197 |
-
|
198 |
-
|
199 |
|
200 |
# triggered only once at startup => read query parameter if it exists
|
201 |
def load_query(request: gr.Request):
|
@@ -377,6 +378,15 @@ with demo:
|
|
377 |
value=None,
|
378 |
interactive=True,
|
379 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
|
381 |
with gr.Row():
|
382 |
with gr.Column():
|
@@ -412,6 +422,7 @@ with demo:
|
|
412 |
|
413 |
submit_button = gr.Button("Submit Eval")
|
414 |
submission_result = gr.Markdown()
|
|
|
415 |
submit_button.click(
|
416 |
add_new_eval,
|
417 |
[
|
@@ -448,9 +459,9 @@ def launch_backend():
|
|
448 |
if DEVICE not in {"cpu"}:
|
449 |
_ = subprocess.run(["python", "backend-cli.py"])
|
450 |
|
451 |
-
Thread(target=periodic_init, daemon=True).start()
|
452 |
# scheduler.add_job(launch_backend, "interval", seconds=120)
|
453 |
if __name__ == "__main__":
|
454 |
scheduler.start()
|
455 |
-
|
456 |
|
|
|
36 |
fields,
|
37 |
WeightType,
|
38 |
Precision,
|
39 |
+
GPUType
|
40 |
)
|
41 |
|
42 |
from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, H4_TOKEN, IS_PUBLIC, \
|
|
|
156 |
dataset_df, original_df, finished_eval_queue_df, running_eval_queue_df, pending_eval_queue_df = init_space()
|
157 |
leaderboard_df = original_df.copy()
|
158 |
|
159 |
+
# def update_leaderboard_table():
|
160 |
+
# global leaderboard_df, shown_columns
|
161 |
+
# print("Updating leaderboard table")
|
162 |
+
# return leaderboard_df[
|
163 |
+
# [c.name for c in fields(AutoEvalColumn) if c.never_hidden]
|
164 |
+
# + shown_columns.value
|
165 |
+
# + [AutoEvalColumn.dummy.name]
|
166 |
+
# ] if not leaderboard_df.empty else leaderboard_df
|
167 |
|
168 |
|
169 |
+
# def update_hidden_leaderboard_table():
|
170 |
+
# global original_df
|
171 |
+
# return original_df[COLS] if original_df.empty is False else original_df
|
172 |
|
173 |
+
# def update_dataset_table():
|
174 |
+
# global dataset_df
|
175 |
+
# return dataset_df
|
176 |
|
177 |
+
# def update_finish_table():
|
178 |
+
# global finished_eval_queue_df
|
179 |
+
# return finished_eval_queue_df
|
180 |
|
181 |
+
# def update_running_table():
|
182 |
+
# global running_eval_queue_df
|
183 |
+
# return running_eval_queue_df
|
184 |
|
185 |
+
# def update_pending_table():
|
186 |
+
# global pending_eval_queue_df
|
187 |
+
# return pending_eval_queue_df
|
188 |
|
189 |
+
# def update_finish_num():
|
190 |
+
# global finished_eval_queue_df
|
191 |
+
# return len(finished_eval_queue_df)
|
192 |
|
193 |
+
# def update_running_num():
|
194 |
+
# global running_eval_queue_df
|
195 |
+
# return len(running_eval_queue_df)
|
196 |
|
197 |
+
# def update_pending_num():
|
198 |
+
# global pending_eval_queue_df
|
199 |
+
# return len(pending_eval_queue_df)
|
200 |
|
201 |
# triggered only once at startup => read query parameter if it exists
|
202 |
def load_query(request: gr.Request):
|
|
|
378 |
value=None,
|
379 |
interactive=True,
|
380 |
)
|
381 |
+
|
382 |
+
gpu_type = gr.Dropdown(
|
383 |
+
choices=[t.to_str() for t in GPUType],
|
384 |
+
label="GPU type",
|
385 |
+
multiselect=False,
|
386 |
+
value=None,
|
387 |
+
interactive=True,
|
388 |
+
)
|
389 |
+
|
390 |
|
391 |
with gr.Row():
|
392 |
with gr.Column():
|
|
|
422 |
|
423 |
submit_button = gr.Button("Submit Eval")
|
424 |
submission_result = gr.Markdown()
|
425 |
+
debug = gr.Textbox(label=args.debug, placeholder="main", visible=False)
|
426 |
submit_button.click(
|
427 |
add_new_eval,
|
428 |
[
|
|
|
459 |
if DEVICE not in {"cpu"}:
|
460 |
_ = subprocess.run(["python", "backend-cli.py"])
|
461 |
|
462 |
+
# Thread(target=periodic_init, daemon=True).start()
|
463 |
# scheduler.add_job(launch_backend, "interval", seconds=120)
|
464 |
if __name__ == "__main__":
|
465 |
scheduler.start()
|
466 |
+
demo.queue(default_concurrency_limit=40).launch()
|
467 |
|
src/display/utils.py
CHANGED
@@ -190,7 +190,25 @@ class InferenceFramework(Enum):
|
|
190 |
return InferenceFramework.HF_Chat
|
191 |
return InferenceFramework.Unknown
|
192 |
|
|
|
|
|
|
|
|
|
|
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
class WeightType(Enum):
|
195 |
Adapter = ModelDetails("Adapter")
|
196 |
Original = ModelDetails("Original")
|
|
|
190 |
return InferenceFramework.HF_Chat
|
191 |
return InferenceFramework.Unknown
|
192 |
|
193 |
+
class GPUType(Enum):
|
194 |
+
H100_pcie = ModelDetails("NVIDIA H100 PCIe")
|
195 |
+
A100_pcie = ModelDetails("NVIDIA A100 PCIe")
|
196 |
+
A5000 = ModelDetails("NVIDIA A5000")
|
197 |
+
Unknown = ModelDetails("?")
|
198 |
|
199 |
+
def to_str(self):
|
200 |
+
return self.value.name
|
201 |
+
|
202 |
+
@staticmethod
|
203 |
+
def from_str(gpu_type: str):
|
204 |
+
if gpu_type in ["NVIDIA A100 PCIe"]:
|
205 |
+
return GPUType.A100_pcie
|
206 |
+
if gpu_type in ["NVIDIA H100 PCIe"]:
|
207 |
+
return GPUType.H100_pcie
|
208 |
+
if gpu_type in ["NVIDIA A5000"]:
|
209 |
+
return GPUType.A5000
|
210 |
+
return GPUType.Unknown
|
211 |
+
|
212 |
class WeightType(Enum):
|
213 |
Adapter = ModelDetails("Adapter")
|
214 |
Original = ModelDetails("Original")
|