Commit 0c107ace by zhlj

first

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

import matplotlib.pyplot as plt
import numpy as np
# 数据
labels = ['4', '8', '12', '16']
methods = ['TGL', 'MSPipe', 'Ours']
data_lastfm_tgn = [
[0.7820, 0.8277, 0.7683, 0.8998], # 4
[None, 0.7846, 0.7419, 0.9329], # 8
[None, 0.770734,0.7713,None ], # 12
[None, 0.0, 0.0, 0.0, 0.0], # 16
]
data_wikitalk_tgn = [
[0.9632, 0.9552 ,0.9355,0.9765],
[None,0.9361,0.9301 ,0.9800] ,
[None,0.930091,0.9234,None],
[None,None,None,None,None]
]
data_stackoverflow_tgn = [
[0.9547 ,0.9548,0.9273,0.9760 ],
[None,0.9217 ,0.9328 , 0.9792 ],
[None, 0.911069,None,None],
[None,None,None,None,None]
]
data_gdelt_tgn = [
[0.977047,0.9832 ,0.9860 ,0.9866 ],
[None,0.9867 ,0.9860 ,0.9897 ],
[None, 986776,None,None],
[None,None,None,None,None]
]
data_lastfm_jodie = [
[0.6116 , 0.4998 , 0.6182 ],
[0 , 0.556566 ,0.6131 ],
[0 , 0.551095, 0],
[0 , 0, 0],
]
data_lastfm_apan = [
[0.5711 , 0.5975 , 0.6741 ],
[0.0000 , 0.5509 , 0.5657 ],
[0 ,0.528071 ,0.0000 ],
[0 , 0, 0],
]
data_wikitalk_jodie = [
[0.9506 , 0.9123 , 0.9541 ],
[0.0000 , 0.825151 ,0.9495 ],
[0 ,0.798259, 0],
[0 , 0, 0],
]
data_wikitalk_apan = [
[0.9136 , 0.9147 , 0.9298 ],
[0.0000 , 0.7030 , 0.9398 ],
[0.0000 ,0.640181, 0.0000 ],
[0 , 0, 0],
]
data_stackoverflow_jodie = [
[0.9512 , 0.8856 , 0.9612 ],
[0.0000 , 0.8054985, 0.9580 ],
[0 ,0.78055, 0],
[0,0,0]
]
data_stackoverflow_apan =[
[0.8886 ,0.8615 , 0.9400 ],
[0.0000 , 0.6824 ,0.9402 ],
[0, 0.633996 ,0.0000 ],
[0 , 0, 0],
]
data_gdelt_jodie = [
[0.9825 , 0.983089 ,0.9901 ],
[0.0000 , 0.9812035 ,0.9914 ],
[0 ,0.9811305, 0],
[0,0,0]
]
data_gdelt_apan = [
[0.9547 , 0.9361 , 0.9839 ],
[0.0000 , 0.7252, 0.9876 ],
[0 ,0.601204 ,0.0000 ],
[0,0,0]
]
datasets = ['LASTFM','WikiTalk','StackOverflow','GDELT']
models = ['apan','jodie']
# 设置柱状图参数
for dataset in datasets:
for model in models:
x = np.arange(len(labels)) # x轴位置
width = 0.15 # 每个柱的宽度
colormap = plt.get_cmap('Accent')
colors = colormap(np.linspace(0,1,5))
# 绘制柱状图
fig, ax = plt.subplots(figsize=(10, 6))
for i, method in enumerate(methods):
data = globals()['data_{}_{}'.format(dataset.lower(),model.lower())]
print(data)
method_data = [d[i] if d[i] is not None else 0 for d in data]
ax.bar(x + i * width, method_data, width, label=method,color=colors[3 if i==2 else i])
plt.ylim([0.45,1])
# 添加标签和标题
ax.set_xlabel('Number of GPUs')
ax.set_ylabel('Test AP')
ax.set_title('{}({})'.format(dataset,model))
ax.set_xticks(x + width * 2)
ax.set_xticklabels(labels)
ax.legend()
# 显示图形
plt.tight_layout()
plt.savefig('{}_{}_ap_number_of_gpus.png'.format(dataset,model))
plt.clf()
\ No newline at end of file
import matplotlib.pyplot as plt
import torch
# 数据
datasets = {
#"WIKI": [117195, 30114, 17527, 4142, 0],
"LASTFM": [768973, 350190, 230442, 66460, 0],
"WikiTalk": [6847641, 1148222, 643309, 144365, 0],
"StackOverflow": [94415023, 15062649, 8482896, 1948469, 0],
"GDELT": [98307910, 20454305, 11504991, 2722967, 0],}
#
#
# X轴标签
#x_labels = ["recent", r'0.1', r'0.05', r'0.01', r'0.00']
#
# datasets = {
# #"WIKI": [21603, 11919 , 4700 , 0],
# "LASTFM": [9471 ,8263 ,1889 , 0 ],
# "WikiTalk":[2561632 ,458949 , 192920,0],
# "StackOverflow": [28092533 , 5956559 , 577277,0],
# "GDELT": [28911769 , 1306950 , 85580,0],
# }
x_labels = ["recent", r'0.1', r'0.05', r'0.01', r'0.00']
#x_labels = ["recent",r'$\theta$=0.1',r'$\theta$=0.05',r'$\theta=0.01','$\theta=0']
#x_labels = ["all_update", r'0.3', r'0.7','local']
# 为每个数据集绘制柱状图
fig, axes = plt.subplots(2, 2, figsize=(10, 8), sharey=False)
for nid,(dataset, values) in enumerate(datasets.items()):
print(int(nid/2),int(nid%2))
ax = axes[int(nid/2)][int(nid%2)]
#fig, ax = plt.subplots()
v = torch.tensor(values) * (100*4) * 4 /1024/1024
hights = v / v[0]
bar_width = 0.5
bars = ax.bar(x_labels, v,width=bar_width )
print(hights)
for i,bar in enumerate(bars):
height = bar.get_height()
print(hights[i])
ax.text(
bar.get_x() + bar.get_width() / 2, # x位置
height, # y位置
f'{hights[i]:.2f} x', # 标注文本
ha='center', # 水平居中
va='bottom', # 垂直底部对齐,
fontsize=17
)
ax.set_title(f'{dataset} Dataset', fontsize=17)
ax.set_xlabel(r'boundary sample hyperparameter $\theta$', fontsize=17)
#ax.set_xlabel(r'synchronization hyperparameter $\alpha$', fontsize=17)
ax.set_ylabel('Communication Volume(MB)', fontsize=17)
ax.tick_params(axis='y', labelsize=17)
ax.tick_params(axis='x', labelsize=17)
ax.set_yscale('log') # 使用对数刻度
ax.set_ylim(0, max(v) * 2)
ax.grid(axis='y', linestyle='--', alpha=1)
#ax.set_show()
plt.subplots_adjust(left=0.1, right=0.96, top=0.9, bottom=0.1, wspace=0.5, hspace=0.5)
plt.tight_layout(rect=[0,0,0,0])
plt.savefig('historical_exp/boundary_sample_comm.png')
#plt.savefig('historical_exp/historical_comm.png')
This diff is collapsed. Click to expand it.
labels = ['4', '8', '12', '16']
methods = ['TGL', 'MSPipe','DistTGL','Ours']
table_label = ['TGL-1','TGL-4','MSPipe-4','DistTGL-4','Ours-4','MSPipe-8','DistTGL-8','Ours-8','MSPipe-12','DistTGL-12','Ours-12','MSPipe-16','DistTGL-16','Ours-16']
table_label_no = ['TGL-1','TGL-4','MSPipe-4','Ours-4','MSPipe-8','Ours-8','MSPipe-12','Ours-12','MSPipe-16','Ours-16']
dataset_label = ['WIKI','LASTFM','WikiTalk','StackOverflow','GDELT']
table_ap_tgn = [
[0.9827, 0.8023, 0.9611, 0.9574, 0.9837],#tgl-1
[0.9808, 0.7820, 0.9632, 0.9547, 0.9770],#tgl-4
[0.9709, 0.8277, 0.9552, 0.9548, 0.9832],#mspipe
[0.9682, 0.7683, 0.9355, 0.9273, 0.9860],#
[0.9770, 0.8998, 0.9765, 0.9760, 0.9866],
[0.9703, 0.7846, 0.9361, 0.9216, 0.9867],
[0.9648, 0.7419, 0.9301, 0.9328, 0.9860],
[0.9768, 0.9329, 0.9800, 0.9792, 0.9897],
[0.9698, 0.7707, 0.9301, 0.9111, 0.9868],
[0.9624, 0.7713, 0.9234, 0.9074, 0.9871],
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
[0.9699, 0.7868, 0.9257, 0.9090, 0.9870],
[0.9646, 0.6999, 0.8997, 0.9031, 0.9862],
[0.9659, 0.9498, 0.9816, 0.9830, 0.9916]
]
table_ap_jodie = [
[0.9080, 0.6202, 0.9578, 0.9620, 0.9831],#tgl-1
[0.8586, 0.6116, 0.9463 ,0.9494 , 0.9825],#tgl-4
[0.785868, 0.4998, 0.9123, 0.8856, 0.9831],
[0.9004, 0.6182, 0.9541, 0.9612, 0.9901],
[0.7735, 0.5566, 0.8252, 0.8055, 0.9812],
[0.8769, 0.6131, 0.9495, 0.9580, 0.9914],
[0.7747, 0.5511, 0.7983, 0.7806, 0.9811],
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
[0.7691, 0.5427, 0.7858, 0.7684, 0.9810],
[0.8548, 0.6044, 0.9418, 0.9540, 0.9908]
]
table_ap_apan = [
[0.9415, 0.5659, 0.9043, 0.8752, 0.9612],
[0.8834, 0.5711, 0.9136, 0.8886, 0.9547],
[0.9124, 0.5975, 0.9147, 0.8615, 0.9361],
[0.9190, 0.6741, 0.9298, 0.9400, 0.9839],
[0.6752, 0.5509, 0.7030, 0.6824, 0.7252],
[0.8982, 0.5657, 0.9398, 0.9402, 0.9876],
[0.6011, 0.5281, 0.6402, 0.6340, 0.6012],
[0.0000, 0.0000, 0.0000, 0.0000, 0.0000],
[0.5449, 0.5156, 0.6004, 0.5898, 0.6163],
[0.8658, 0.6682, 0.9419, 0.9522, 0.9880]
]
table_train_tgn =[
[1.7701 ,14.7205 ,88.1896 ,938.8964 , 2001.318524],
[0.6651 ,6.185821226 ,35.9636 , 328.1245 , 854.80837],
[0.8258 ,3.7705 ,15.3471 , 141.1648 ,465.2264 ],
[0.4001 ,3.5691 ,16.5933 , 167.2491 , 445.4328 ],
[0.6327 ,4.4322 ,14.7757 , 132.7098208, 537.1398258],
[0.7085 ,2.2837 ,8.6870 ,76.9830 ,250.0945 ],
[0.2992 ,2.0908 ,9.0872 ,97.8960 ,238.3315 ],
[0.2772 ,2.3960 ,7.1694 ,72.0319 ,251.7710 ],
[0.598028193 ,1.708853126 ,6.600371795 ,59.73907948 ,172.2328092],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
]
table_train_jodie =[
[0.7056 , 5.9280, 16.0147 , 134.6145 , 376.2186 ],
[0.2494 , 2.0697, 6.4145 ,52.0684 ,147.3938 ],
[0.5604 , 2.0900, 4.5566 ,33.3442 ,84.38458259],
[0.3246 , 2.5305, 5.7808 ,48.8147 ,148.8899 ],
[0.518362013, 1.148036031 ,2.871488156 ,19.42606455, 48.72649877],
[0.1708 , 1.3234 ,3.1610 ,26.3006 , 78.1362 ],
[0.495687011 ,0.929189181, 2.223804102 ,15.14540188, 36.91594124],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
]
table_train_apan =[
[1.5406, 13.5400, 118.8137, 1032.4779 , 1609.9425 ],
[0.6653, 5.6160 , 41.4232 , 368.6106 , 1045.6425 ],
[0.7319, 2.9211 , 25.9092 , 238.7242 , 643.3855 ],
[0.4428, 3.3608 , 11.3518 , 96.5700 , 244.8932 ],
[0.6765, 1.9470 , 14.0065 , 123.8830 , 331.8195 ],
[0.2521, 2.0037 , 8.5989 ,74.9677 , 139.2487 ],
[0.870823467, 2.671342006, 14.96090715, 99.97286532, 233.0780075],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
]
table_eval_tgn = [
[0.7499 ,4.8555 ,48.0304 ,505.1028 ,824.7955338],
[0.2636 ,2.09782438 ,15.9930 ,162.6785 ,412.4661068],
[0.5704 ,1.2416 ,6.4172 ,68.7693 ,117.9146 ],
[0.2692 ,2.0977 ,13.2586 ,163.4167 ,152.3379 ],
[0.1166 ,0.8080 ,3.0650 ,28.00140551, 115.4568481],
[0.5747 ,0.8989 ,4.0630 ,36.5432 ,61.79147074],
[0.2714 ,2.0767 ,11.6519 ,143.2905 ,145.8947 ],
[0.0627 ,0.6212 ,2.5015 ,23.1395 ,80.9373 ],
[0.5550 ,0.7799 ,3.3021 ,27.7136 ,42.9780 ],
[0.2738 ,2.0794 ,15.4595 ,152.1446 ,148.1033 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.7972 ,1.0099 ,2.7960 ,21.3148 ,35.1295 ],
[0.2733 ,2.0562 ,13.1791 ,162.9651 ,151.0929 ],
[0.0783 ,0.5772 ,1.8858 ,19.7090 ,64.9535 ],
]
table_eval_jodie =[
[0.2091 ,1.6959 ,5.9168 ,48.6228 ,129.0989 ],
[0.0719 ,0.6373 ,2.1611 ,18.0129 ,50.1390 ],
[0.5078 ,0.4018 ,2.7975 ,15.9332 ,28.17862575],
[0.0633 ,0.5023 ,1.1726 ,9.4948 ,42.8286 ],
[0.502160359 ,0.669311229 ,2.076292474 ,9.030235369, 16.12763978],
[0.0377 ,0.3370 ,1.2482 , 10.2044 ,34.6001 ],
[0.525156487 ,0.617744214, 1.698658919 ,6.896312807 ,12.20505439],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
]
table_eval_apan =[
[0.5907 , 4.8906 ,37.4472 ,332.8560, 516.5578 ],
[0.2405 , 1.9909 ,11.9007 ,105.6109, 298.5957 ],
[0.6249 , 1.4006 ,8.5734 ,66.5308 , 161.1591 ],
[0.0819 , 0.6588 ,2.2410 ,19.3600 , 100.0944 ],
[0.7001 , 1.1295 ,4.9139 ,38.4971 , 68.67845647],
[0.0709 , 0.8897 ,4.9156 ,41.6653 , 114.7303 ],
[0.860863774, 1.248189147 ,4.57928021 ,30.29166182, 69.67092261],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
]
def get_data(model,data,method,part,mode):
table = globals()['table_{}_{}'.format(mode,model.lower())]
index_name = method+'-{}'.format(part)
if model =='TGN':
index = table_label.index(index_name) if index_name in table_label else -1
if index == -1:
return None
else:
#print(index,dataset_label.index(data),method)
return table[index][dataset_label.index(data)]
else:
index = table_label_no.index(index_name) if index_name in table_label_no else -1
if index == -1:
return None
else:
return table[index][dataset_label.index(data)]
import matplotlib.pyplot as plt
import numpy as np
import torch
# 读取文件内容
import os
datasets = ['LASTFM', 'WikiTalk', 'StackOverflow', 'GDELT']
methods = ['DistTGL', 'Ours']
cards = ['4', '8', '16']
fig, axes = plt.subplots(1, len(datasets), figsize=(12, 3), sharey=False)
bar_width = 0.2
index = np.arange(len(cards))
handles, labels = [], []
for i, dataset in enumerate(datasets):
ax = axes[i]
# 绘制柱状图
for j, method in enumerate(methods):
eval_times = [get_data('TGN',dataset,method,k,'eval') for k in cards]
#print(times)
ax.bar(index + j * bar_width, eval_times, bar_width, label=f'{method} Time')
for h, l in zip(*ax.get_legend_handles_labels()):
if l not in labels:
handles.append(h)
labels.append(l)
ax.set_title(dataset, fontsize=14)
ax.set_xticks(index + bar_width)
ax.set_xticklabels(cards, fontsize=12)
ax.set_xlabel('Number of GPUs', fontsize=12)
#ax.set_ylim(0, max(eval_times)*4)
if i == 0:
ax.set_ylabel('Evaluation Time', fontsize=12)
fig.legend(handles, labels, loc='upper center', ncol=6, fontsize=10)
plt.tight_layout(rect=[0, 0, 1, 0.9])
plt.savefig('scalability/TGN_inference.png')
import matplotlib.pyplot as plt
import numpy as np
# 定义数据
datasets = ['LASTFM', 'WikiTalk', 'StackOverflow', 'GDELT']
methods = ['DistTGL', 'MSPipe', 'Ours']
cards = ['4', '8', '16']
# 每个数据集对应的训练时间和精度
train_time = {
'LASTFM': {
'DistTGL': [3.5691, 2.0908, 1.1308],
'MSPipe': [3.7705, 2.2837, 1.58013],
'Ours': [4.4322, 2.3960, 1.99681]
},
'WikiTalk': {
'DistTGL': [16.5933, 9.0872, 5.8111],
'MSPipe': [15.3471, 8.6870, 5.23049],
'Ours': [14.7757, 7.1694, 5.199244]
},
'StackOverflow': {
'DistTGL': [167.2491, 97.8960, 56.4550],
'MSPipe': [141.1648, 76.9830, 47.676975],
'Ours': [132.7098, 72.0319, 62.127397]
},
'GDELT': {
'DistTGL': [445.4328, 238.333, 145.6853],
'MSPipe': [465.2264, 250.0945, 134.19114],
'Ours': [537.13983, 251.7710, 138.56199]
}
}
accuracy = {
'LASTFM': {
'DistTGL': [0.7683, 0.7419, 0.6999],
'MSPipe': [0.8277, 0.7846, 0.78682],
'Ours': [0.8998, 0.9329, 0.94982]
},
'WikiTalk': {
'DistTGL': [0.9355, 0.9301, 0.8997],
'MSPipe': [0.9552, 0.9376, 0.92567],
'Ours': [0.9765, 0.9800, 0.98155]
},
'StackOverflow': {
'DistTGL': [0.9273, 0.9328, 0.9031],
'MSPipe': [0.9548, 0.9548, 0.908905],
'Ours': [0.9760, 0.9792, 0.983042]
},
'GDELT': {
'DistTGL': [0.9860, 0.9860, 0.9862],
'MSPipe': [0.9832, 0.9867, 0.9870182],
'Ours': [0.9866, 0.9897, 0.991622]
}
}
# 使用默认样式
fig, axes = plt.subplots(1, len(datasets), figsize=(12, 3), sharey=False)
bar_width = 0.2
index = np.arange(len(cards))
handles, labels = [], []
for i, dataset in enumerate(datasets):
ax = axes[i]
# 绘制柱状图
for j, method in enumerate(methods):
times = [train_time[dataset][method][k] for k in range(len(cards))]
ax.bar(index + j * bar_width, times, bar_width, label=f'{method} Time')
for h, l in zip(*ax.get_legend_handles_labels()):
if l not in labels:
handles.append(h)
labels.append(l)
ax.set_title(dataset, fontsize=14)
ax.set_xticks(index + bar_width)
ax.set_xticklabels(cards, fontsize=12)
ax.set_xlabel('Number of GPUs', fontsize=12)
ax.set_ylim(0, max(max(times) for times in train_time[dataset].values()) * 2)
if i == 0:
ax.set_ylabel('Training Time', fontsize=12)
# 创建双轴并绘制折线图
ax2 = ax.twinx()
for j, method in enumerate(methods):
acc = [accuracy[dataset][method][k] for k in range(len(cards))]
ax2.plot(index + bar_width, acc, marker='o', linestyle='--', label=f'{method} AP',markersize=5)
for h, l in zip(*ax2.get_legend_handles_labels()):
print(l)
if l not in labels:
handles.append(h)
labels.append(l)
if dataset == 'GDELT':
ax2.set_ylabel('Test AP', fontsize=12)
#axes[i].twinx().set_ylim(0.95, 1.0)
fig.legend(handles, labels, loc='upper center', ncol=6, fontsize=14)
plt.tight_layout(rect=[0, 0, 1, 0.9])
plt.savefig('scalability/TGN.png')
import matplotlib.pyplot as plt
# 数据
x_values = [0.02,0.04,0.06,0.08]
y_values = [0.310754, 0.19102, 0.117148, 0.075549]
# 创建折线图
plt.figure(figsize=(10, 6))
plt.plot(x_values,y_values, marker='o', linestyle='-', color='b', linewidth=2, markersize=8)
# 添加标题和标签
plt.title('Number of Cross Edge vs shared node ratio', fontsize=16)
plt.xlabel('The ratio of Cross Edge', fontsize=14)
plt.ylabel('shared nodes ratio', fontsize=14)
# 显示网格
plt.grid(True, linestyle='--', alpha=0.7)
# 显示图表
plt.show()
plt.savefig('shared_ratio.png')
import matplotlib.pyplot as plt
import numpy as np
# 数据
labels = ['4', '8', '12', '16']
methods = ['TGL', 'MSPipe','DistTGL','Ours']
table_label = ['TGL-1','TGL-4','MSPipe-4','DistTGL-4','Ours-4','MSPipe-8','DistTGL-8','Ours-8','MSPipe-12','DistTGL-12','Ours-12','MSPipe-16','DistTGL-16','Ours-16']
table_label_no = ['TGL-1','TGL-4','MSPipe-4','Ours-4','MSPipe-8','Ours-8','MSPipe-12','Ours-12','MSPipe-16','Ours-16']
dataset_label = ['WIKI','LASTFM','WikiTalk','StackOverflow','GDELT']
table_train_tgn =[
[1.7701 ,14.7205 ,88.1896 ,938.8964 , 2001.318524],
[0.6651 ,6.185821226 ,35.9636 , 328.1245 , 854.80837],
[0.8258 ,3.7705 ,15.3471 , 141.1648 ,465.2264 ],
[0.4001 ,3.5691 ,16.5933 , 167.2491 , 445.4328 ],
[0.6327 ,4.4322 ,14.7757 , 132.7098208, 537.1398258],
[0.7085 ,2.2837 ,8.6870 ,76.9830 ,250.0945 ],
[0.2992 ,2.0908 ,9.0872 ,97.8960 ,238.3315 ],
[0.2772 ,2.3960 ,7.1694 ,72.0319 ,251.7710 ],
[0.598028193 ,1.708853126 ,6.600371795 ,59.73907948 ,172.2328092],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 ,0.0000 ,0.0000 ,0.0000 ,0.0000 ],
]
table_train_jodie =[
[0.7056 , 5.9280, 16.0147 , 134.6145 , 376.2186 ],
[0.2494 , 2.0697, 6.4145 ,52.0684 ,147.3938 ],
[0.5604 , 2.0900, 4.5566 ,33.3442 ,84.38458259],
[0.3246 , 2.5305, 5.7808 ,48.8147 ,148.8899 ],
[0.518362013, 1.148036031 ,2.871488156 ,19.42606455, 48.72649877],
[0.1708 , 1.3234 ,3.1610 ,26.3006 , 78.1362 ],
[0.495687011 ,0.929189181, 2.223804102 ,15.14540188, 36.91594124],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
[0.0000, 0.0000 , 0.0000 ,0.0000 , 0.0000 ],
]
table_train_apan =[
[1.5406, 13.5400, 118.8137, 1032.4779 , 1609.9425 ],
[0.6653, 5.6160 , 41.4232 , 368.6106 , 1045.6425 ],
[0.7319, 2.9211 , 25.9092 , 238.7242 , 643.3855 ],
[0.4428, 3.3608 , 11.3518 , 96.5700 , 244.8932 ],
[0.6765, 1.9470 , 14.0065 , 123.8830 , 331.8195 ],
[0.2521, 2.0037 , 8.5989 ,74.9677 , 139.2487 ],
[0.870823467, 2.671342006, 14.96090715, 99.97286532, 233.0780075],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
[0.0000 ,0.0000 ,0.0000 , 0.0000 , 0.0000 ],
]
table_eval_tgn = [
[0.7499 ,4.8555 ,48.0304 ,505.1028 ,824.7955338],
[0.2636 ,2.09782438 ,15.9930 ,162.6785 ,412.4661068],
[0.5704 ,1.2416 ,6.4172 ,68.7693 ,117.9146 ],
[0.2692 ,2.0977 ,13.2586 ,163.4167 ,152.3379 ],
[0.1166 ,0.8080 ,3.0650 ,28.00140551, 115.4568481],
[0.5747 ,0.8989 ,4.0630 ,36.5432 ,61.79147074],
[0.2714 ,2.0767 ,11.6519 ,143.2905 ,145.8947 ],
[0.0627 ,0.6212 ,2.5015 ,23.1395 ,80.9373 ],
[0.555030217 ,0.779903646 ,3.302122216 ,27.71362416 ,42.97800901],
[0.0000 , 0.0000 ,0.0000 ,0.0000 , 0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 , 0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 , 0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 , 0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 , 0.0000 ],
]
table_eval_jodie =[
[0.2091 ,1.6959 ,5.9168 ,48.6228 ,129.0989 ],
[0.0719 ,0.6373 ,2.1611 ,18.0129 ,50.1390 ],
[0.5078 ,0.4018 ,2.7975 ,15.9332 ,28.17862575],
[0.0633 ,0.5023 ,1.1726 ,9.4948 ,42.8286 ],
[0.502160359 ,0.669311229 ,2.076292474 ,9.030235369, 16.12763978],
[0.0377 ,0.3370 ,1.2482 , 10.2044 ,34.6001 ],
[0.525156487 ,0.617744214, 1.698658919 ,6.896312807 ,12.20505439],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
[0.0000 ,0.0000 , 0.0000, 0.0000 , 0.0000 ],
]
table_eval_apan =[
[0.5907 , 4.8906 ,37.4472 ,332.8560, 516.5578 ],
[0.2405 , 1.9909 ,11.9007 ,105.6109, 298.5957 ],
[0.6249 , 1.4006 ,8.5734 ,66.5308 , 161.1591 ],
[0.0819 , 0.6588 ,2.2410 ,19.3600 , 100.0944 ],
[0.7001 , 1.1295 ,4.9139 ,38.4971 , 68.67845647],
[0.0709 , 0.8897 ,4.9156 ,41.6653 , 114.7303 ],
[0.860863774, 1.248189147 ,4.57928021 ,30.29166182, 69.67092261],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
[0.0000 , 0.0000 ,0.0000 ,0.0000 ,0.0000 ],
]
datasets = ['LASTFM','WikiTalk','StackOverflow','GDELT']
models = ['TGN','APAN','JODIE']
# 设置柱状图参数
for dataset in datasets:
for model in models:
x = np.arange(len(labels)) # x轴位置
width = 0.15 # 每个柱的宽度
colormap = plt.get_cmap('Accent')
colors = colormap(np.linspace(0,1,5))
# 绘制柱状图
fig, ax = plt.subplots(figsize=(10, 6))
for i, method in enumerate(methods):
if(method == 'DistTGL' and model !='TGN'):
continue
table = globals()['table_eval_{}'.format(model.lower())]
#data = globals()['data_{}_{}'.format(dataset.lower(),model.lower())]
#print(data)
method_data = []
for g in range(len(labels)):
num = int(labels[g])
index_name = method+'-{}'.format(num)
print(index_name)
if model =='TGN':
index = table_label.index(index_name) if index_name in table_label else -1
print(index)
if index == -1:
method_data.append(0)
else:
method_data.append(table[index][dataset_label.index(dataset)])
else:
index = table_label_no.index(index_name) if index_name in table_label_no else -1
print(index)
if index == -1:
method_data.append(0)
else:
method_data.append(table[index][dataset_label.index(dataset)])
if model == 'TGN':
ax.bar(x + i * width, method_data, width, label=method,color=colors[i] )
else:
ax.bar(x + min(i,2) * width, method_data, width, label=method,color=colors[i] )
# 添加标签和标题
ax.set_xlabel('Number of GPUs')
ax.set_ylabel('Time for test/s')
ax.set_title('{}({})'.format(dataset,model))
ax.set_xticks(x + width * 2)
ax.set_xticklabels(labels)
ax.legend()
# 显示图形
plt.tight_layout()
plt.savefig('{}_{}_eval_time_number_of_gpus.png'.format(dataset,model))
plt.clf()
\ No newline at end of file
import matplotlib.pyplot as plt
import numpy as np
# 数据
categories = ['recent', r'$\theta$=0.1', r'$\theta$=0.05', r'$\theta$=0.01', r'local']
forward_computation = [232.8508632, 207.6101028, 207.3353659, 205.5815726, 206.2297827]
memory_sync = [43.17275703, 15.06231188, 14.61119452, 13.68188678, 14.38758841]
others = [36.34391371, 69.00549863, 62.89710956, 69.09224575, 47.82174432]
memory_fetch = [542.8608579, 99.63405462, 69.2147035, 64.4748841, 48.06376967]
# 堆叠柱状图
fig, ax = plt.subplots(figsize=[4,4])
ax.bar(categories, forward_computation, label='Forward Computation')
ax.bar(categories, memory_sync, bottom=forward_computation, label='Memory Sync')
ax.bar(categories, others, bottom=np.array(forward_computation) + np.array(memory_sync), label='Others')
ax.bar(categories, memory_fetch, bottom=np.array(forward_computation) + np.array(memory_sync) + np.array(others), label='Memory Fetch')
# 添加标签和标题
ax.set_ylabel('Time/s',fontsize=14)
ax.legend()
plt.xticks(rotation=45,fontsize = 14)
plt.tight_layout()
plt.savefig('boundary_time.png')
probability is 0.1
probability is 0.1
probability is 0.1
probability is 0.1
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 3
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 1
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 2
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 0
LOCAL RANK 1, RANK5
LOCAL RANK 2, RANK6
LOCAL RANK 3, RANK7
LOCAL RANK 0, RANK4
in
in
in
in
local rank is 2 world_size is 8 memory group is 0 memory rank is 6 memory group size is 8
local rank is 3 world_size is 8 memory group is 0 memory rank is 7 memory group size is 8
local rank is 1 world_size is 8 memory group is 0 memory rank is 5 memory group size is 8
local rank is 0 world_size is 8 memory group is 0 memory rank is 4 memory group size is 8
[0, 1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
memory used is torch.Size([1980, 172]) torch.float32 0.0012686848640441895
dist rank is 4 after node feats defination:
dist rank is 6 after node feats defination:
dist rank is 5 after node feats defination:
dist rank is 7 after node feats defination:
dist rank is 4 after node feats defination:
probability is 0.1
probability is 0.1
probability is 0.1
probability is 0.1
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 2
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 1
rank 3
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 0
LOCAL RANK 2, RANK6
LOCAL RANK 1, RANK5
LOCAL RANK 3, RANK7
LOCAL RANK 0, RANK4
in
in
in
in
local rank is 2 world_size is 8 memory group is 0 memory rank is 6 memory group size is 8
local rank is 3 world_size is 8 memory group is 0 memory rank is 7 memory group size is 8
local rank is 1 world_size is 8 memory group is 0 memory rank is 5 memory group size is 8
[0, 1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
local rank is 0 world_size is 8 memory group is 0 memory rank is 4 memory group size is 8
[0, 1, 2, 3, 4, 5, 6, 7]
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
memory used is torch.Size([1980, 172]) torch.float32 0.0012686848640441895
dist rank is 4 after node feats defination:
dist rank is 6 after node feats defination:
dist rank is 4 after node feats defination:
dist rank is 5 after node feats defination:
dist rank is 7 after node feats defination:
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 3
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 0
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 2
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 1
LOCAL RANK 3, RANK3
LOCAL RANK 0, RANK0
LOCAL RANK 2, RANK2
LOCAL RANK 1, RANK1
in
in
in
in
local rank is 2 world_size is 12 memory group is 0 memory rank is 2 memory group size is 12
local rank is 3 world_size is 12 memory group is 0 memory rank is 3 memory group size is 12
local rank is 0 world_size is 12 memory group is 0 memory rank is 0 memory group size is 12
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
local rank is 1 world_size is 12 memory group is 0 memory rank is 1 memory group size is 12
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
../../SPEED/partition/divided_nodes_seed_starrygl/LASTFM/123457/LASTFM_12parts_top0.1/output2.txt
../../SPEED/partition/divided_nodes_seed_starrygl/LASTFM/123457/LASTFM_12parts_top0.1/output1.txt
../../SPEED/partition/divided_nodes_seed_starrygl/LASTFM/123457/LASTFM_12parts_top0.1/output3.txt
../../SPEED/partition/divided_nodes_seed_starrygl/LASTFM/123457/LASTFM_12parts_top0.1/output0.txt
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
tot edge 1293103 circ edge 154993 same edge 0
memory used is torch.Size([1980, 172]) torch.float32 0.0012686848640441895
dist rank is 0 after node feats defination:
dist rank is 0 after node feats defination:
dist rank is 1 after node feats defination:
dist rank is 2 after node feats defination:
dist rank is 3 after node feats defination:
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 2
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 3
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 1
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 0
LOCAL RANK 3, RANK7
LOCAL RANK 1, RANK5
LOCAL RANK 0, RANK4
LOCAL RANK 2, RANK6
in
in
in
in
local rank is 2 world_size is 8 memory group is 0 memory rank is 6 memory group size is 8
local rank is 3 world_size is 8 memory group is 0 memory rank is 7 memory group size is 8
local rank is 1 world_size is 8 memory group is 0 memory rank is 5 memory group size is 8
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7]
local rank is 0 world_size is 8 memory group is 0 memory rank is 4 memory group size is 8
[0, 1, 2, 3, 4, 5, 6, 7]
probability is 0.66
probability is 0.66
probability is 0.66
probability is 0.66
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 2
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 0
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 1
Network interfaces with prefix '('ens4f1np1', 'ens6f0np0')': ['ens4f1np1']
rank 3
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment