Spaces:
Running
Running
evilfreelancer
commited on
Upload 3 files
Browse files- app.py +77 -0
- server_specs.csv +5 -0
- test.py +29 -0
app.py
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
from datasets import load_dataset
|
4 |
+
|
5 |
+
# Загрузка датасетов с Hugging Face
|
6 |
+
benchmark_dataset = load_dataset("evilfreelancer/msnp-tests", split="train")
|
7 |
+
# server_dataset = load_dataset("evilfreelancer/leaderboard-dataset", split="server")
|
8 |
+
|
9 |
+
# Преобразование в DataFrame
|
10 |
+
df_benchmark = pd.DataFrame(benchmark_dataset)
|
11 |
+
df_server = pd.read_csv('server_specs.csv')
|
12 |
+
|
13 |
+
# Объединение данных по названию сервера
|
14 |
+
df = pd.merge(df_benchmark, df_server, left_on="Server Name", right_on="Server Name", how="left")
|
15 |
+
|
16 |
+
st.title("Лидерборд производительности моделей")
|
17 |
+
|
18 |
+
# Фильтры в боковой панели
|
19 |
+
with st.sidebar:
|
20 |
+
st.header("Фильтры")
|
21 |
+
model_options = st.multiselect("Выберите модель:", options=df["Model"].unique())
|
22 |
+
gpu_options = st.multiselect("Выберите GPU:", options=df["GPUs"].unique())
|
23 |
+
quantization_options = st.multiselect("Квантование:", options=df["Quantization"].unique())
|
24 |
+
context_length_options = st.multiselect("Длина контекста:", options=sorted(df["Context Length"].unique()))
|
25 |
+
start_type_options = st.multiselect("Тип запуска:", options=df["Start Type"].unique())
|
26 |
+
power_options = st.multiselect("Макс. мощность GPU (Вт):", options=df["GPU Max Power (W)"].unique())
|
27 |
+
server_options = st.multiselect("Выберите сервер:", options=df["Server Name"].unique())
|
28 |
+
|
29 |
+
# Применение фильтров
|
30 |
+
filtered_df = df.copy()
|
31 |
+
if model_options:
|
32 |
+
filtered_df = filtered_df[filtered_df["Model"].isin(model_options)]
|
33 |
+
if gpu_options:
|
34 |
+
filtered_df = filtered_df[filtered_df["GPUs"].isin(gpu_options)]
|
35 |
+
if quantization_options:
|
36 |
+
filtered_df = filtered_df[filtered_df["Quantization"].isin(quantization_options)]
|
37 |
+
if context_length_options:
|
38 |
+
filtered_df = filtered_df[filtered_df["Context Length"].isin(context_length_options)]
|
39 |
+
if start_type_options:
|
40 |
+
filtered_df = filtered_df[filtered_df["Start Type"].isin(start_type_options)]
|
41 |
+
if power_options:
|
42 |
+
filtered_df = filtered_df[filtered_df["GPU Max Power (W)"].isin(power_options)]
|
43 |
+
if server_options:
|
44 |
+
filtered_df = filtered_df[filtered_df["Server Name"].isin(server_options)]
|
45 |
+
|
46 |
+
# Опции сортировки
|
47 |
+
st.header("Опции сортировки")
|
48 |
+
sort_by = st.selectbox(
|
49 |
+
"Сортировать по:",
|
50 |
+
options=filtered_df.columns,
|
51 |
+
index=filtered_df.columns.get_loc("Duration (sec)")
|
52 |
+
)
|
53 |
+
ascending = st.radio("Порядок:", ("Возрастание", "Убывание")) == "Возрастание"
|
54 |
+
|
55 |
+
# Отображение таблицы
|
56 |
+
st.dataframe(filtered_df.sort_values(by=sort_by, ascending=ascending).reset_index(drop=True))
|
57 |
+
|
58 |
+
# Добавление ссылок на тесты
|
59 |
+
st.markdown("## Примечания")
|
60 |
+
st.markdown("Нажмите на ссылки в колонке 'Test Link' для подробностей.")
|
61 |
+
|
62 |
+
# Отображение спецификаций сервера при выборе записи
|
63 |
+
if st.checkbox("Показать спецификации сервера"):
|
64 |
+
selected_index = st.number_input(
|
65 |
+
"Введите номер записи для просмотра спецификаций сервера:",
|
66 |
+
min_value=0,
|
67 |
+
max_value=len(filtered_df)-1,
|
68 |
+
value=0,
|
69 |
+
step=1
|
70 |
+
)
|
71 |
+
selected_server = filtered_df.iloc[selected_index]["Server Name"]
|
72 |
+
server_specs = df_server[df_server["Server Name"] == selected_server]
|
73 |
+
if not server_specs.empty:
|
74 |
+
st.subheader(f"Спецификации сервера: {selected_server}")
|
75 |
+
st.table(server_specs.drop(columns=["Server Name"]).transpose())
|
76 |
+
else:
|
77 |
+
st.write("Спецификации для выбранного сервера недоступны.")
|
server_specs.csv
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Server Name,CPU,RAM (GB),GPU(s),Storage,Motherboard,PSU (W)
|
2 |
+
NN,"2 x Xeon E5-2680 v4","6 x 64 = 384","AMD RX580 8GB, Tesla P40 24GB","2 x NVMe 2TB 970 EVO, 6 x SSD, 2 x HDD","Huananzhi X99 F8D Plus (C610)",1000
|
3 |
+
gpu01,"2 x Xeon E5-2690 v2",128,"1 x RTX 3050 8GB","-","-","-"
|
4 |
+
gpu02,"1 x Ryzen 9 5950X",128,"1 x RTX 4090 24GB","-","-","-"
|
5 |
+
pasha-lt,"1 x Intel i7",32,"1 x GTX 1050Ti 4GB","-","-","-"
|
test.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import json
|
3 |
+
import timeit
|
4 |
+
|
5 |
+
MODEL = "llama3.1:8b"
|
6 |
+
# MODEL = "llama3.1:8b-instruct-fp16"
|
7 |
+
# MODEL = "llama3.1:70b"
|
8 |
+
# MODEL = "aya:35b-23-q4_K_M"
|
9 |
+
|
10 |
+
# num_ctx = 200
|
11 |
+
num_ctx = 4000
|
12 |
+
|
13 |
+
start = timeit.default_timer()
|
14 |
+
prompt = "С какой периодичностью происходит ледниковый период"
|
15 |
+
result = requests.post('http://localhost:11434/api/generate', json={'model': MODEL, "options":{ "seed": 123,"num_predict":500,"temperature": 0,"num_ctx": 4000}, "keep_alive":"10m", "prompt":prompt, "stream": False}).content
|
16 |
+
a = json.loads(result)
|
17 |
+
|
18 |
+
print(a['response'])
|
19 |
+
print("Всего токенов: ", a['eval_count'])
|
20 |
+
|
21 |
+
nanoseconds = a['eval_duration'] # 5 billion nanoseconds
|
22 |
+
|
23 |
+
seconds = nanoseconds / 1_000_000_000
|
24 |
+
|
25 |
+
print("Длительность: ", seconds) # Output: 5.0
|
26 |
+
print("T/s - ", a['eval_count'] / seconds)
|
27 |
+
|
28 |
+
end = timeit.default_timer()
|
29 |
+
print(f"Time to retrieve response: {end - start}")
|