mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-10-29 06:04:23 +08:00
20 lines
543 B
Python
20 lines
543 B
Python
import pandas as pd
|
|
import matplotlib.pyplot as plt
|
|
import seaborn as sns
|
|
|
|
# 读取数据
|
|
file_path = 'data.txt' # 替换为你的文件路径
|
|
df = pd.read_csv(file_path, sep=r'\s+', names=['m', 'n', 'tflops'])
|
|
|
|
# 创建数据透视表,行为 m,列为 n,值为 tflops
|
|
pivot_table = df.pivot_table(index='m', columns='n', values='tflops')
|
|
|
|
# 画热力图
|
|
plt.figure(figsize=(10, 8))
|
|
sns.heatmap(pivot_table, annot=True, fmt=".2f", cmap='viridis')
|
|
plt.title('TFLOPS Heatmap')
|
|
plt.xlabel('n')
|
|
plt.ylabel('m')
|
|
plt.tight_layout()
|
|
plt.show()
|