-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCase2_FPGA_number.py
103 lines (87 loc) · 4.18 KB
/
Case2_FPGA_number.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# setups:
# 1.(CPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD
# 2.(GPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD + 1x Nvidia V100
# 3.(GPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD + 1x Xilinx ZCU102
# 4.(GPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD + 2x Xilinx ZCU102
# 5.(GPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD + 4x Xilinx ZCU102
# 6.(GPU server) DellR740 + 2x Intel Xeon 8180 CPU + 64GB DRAM + 1000GB HDD + 8x Xilinx ZCU102
# Units:
# 1. DellR740 Carbon footprint report(no CPU part name reported, 32 GB DRAM, 1600 GB HDD): https://i.dell.com/sites/csdocuments/CorpComm_Docs/en/carbon-footprint-poweredge-r740.pdf
# 2. Intel Xeon 8180 CPU: 28 CPU cores, 698 mm2 die size, 14 nm, power: 10(statistic)-250(TDP) W
# 3. Intel Xeon 8375 CPU: 32 CPU cores, 660 mm2 die size, 12 nm, power: 10(statistic)-300(TDP) W
# 4. Nvidia V100: 815 mm2 die size, 12 nm, power: 39(statistic)-250(task) W
# 5. Xilinx ZCU102: 245 mm2 die size, 16 nm, power: 0.83(statistic)-25(task) W
# performance metric:
# 1 V100 has the throughput of 11.05x ZCU102, or 1.32 CPU
# --> compare 1.32x server 1 with 1x server 2, 11.05x server 3, 5,52x server 4, 2.76x server 5 and 1.38x server 6
# all systems running at 100% utilization
# operational carbon
# system2 running at 0.62 utilization
# kWh to KgCO2e: TX: 0.438, AZ: 0.395, CA: 0.234, NY: 0.188 KgCO2e/Kwh
#----------------------------------------------use SCARIF to estimate system cost-----------------------------------------------#
#######
# get system carbon w/o Acc.
#######
import SCARIF_class
r740 = SCARIF_class.Dell_predictor()
r740.setup(2*28,64,0,1000,2017)
r740_no_acc_carbon = r740.carbon
print("----- system carbon cost w/o Acc. -----")
print("r740 server carbon w/o acc:",r740_no_acc_carbon," KgCO2e")
gpu_pred = SCARIF_class.acc_preditor()
fpga_pred = SCARIF_class.acc_preditor()
gpu_pred.setup(14,815)
fpga_pred.setup(14,245)
#######
# get system carbon w/o Acc.
#######
gpu_carbon = gpu_pred.acc_system_carbon
fpga_carbon = fpga_pred.acc_system_carbon
print("----- system-level Acc. carbon cost -----")
# print(sys1.CPU_cost,sys2.CPU_cost)
print("v100 in system 1:",gpu_carbon," KgCO2e\nzcu102 in system 1:",fpga_carbon," KgCO2e")
#######
# get system carbon w/ Acc.
#######
cpu_total_carbon = r740_no_acc_carbon
gpu_total_carbon = r740_no_acc_carbon + gpu_carbon
fpga_total_carbons = []
for i in range(4):
fpga_total_carbons.append(r740_no_acc_carbon + fpga_carbon*(2**i))
print("----- system carbon cost w/ Acc. -----")
print("system 1:",cpu_total_carbon,"\nsystem 2:",gpu_total_carbon,"\nsystem 3-6:", fpga_total_carbons)
#######
# normalization by performance
#######
cpu_norm_carbon = cpu_total_carbon* 1.315
gpu_norm_carbon = gpu_total_carbon* 1
fpga_norm_carbons = []
for i in range(4):
fpga_norm_carbons.append(fpga_total_carbons[i]*(11.0541/(2**i)))
print("----- normalized system carbon cost w/ Acc. -----")
print("system 1:",cpu_norm_carbon,"\nsystem 2:",gpu_norm_carbon,"\nsystem 3-6:", fpga_norm_carbons)
#---------------------------------------------- operational costs-----------------------------------------------#
#######
# normailized yearly carbon cost
# using carbon intensity of AZ
#######
carbon_intensity = 0.395
cpu_op_cost = 205*2 /1000*365*24 * 1.315 * carbon_intensity #power *time * normalization_coef
gpu_op_cost = (2*10+250) /1000*365*24 * 1 * carbon_intensity
fpga_op_cost = []
for i in range(4):
fpga_op_cost.append( (2*10+(2**i)*25) /1000*365*24 * (11.0541/(2**i)) * carbon_intensity)
print("----- yearly operational carbon cost -----")
print("system 1:",cpu_op_cost,"\nsystem 2:",gpu_op_cost,"\nsystem 3-6:", fpga_op_cost)
years = [1,4, 7,10,20]
print("----- total carbon summary -----")
print("years\tsys1\tsys2\tsys3\tsys4\tsys5\tsys6\t")
for year in years:
print(year,"\t",
cpu_norm_carbon + year* cpu_op_cost, '\t',
gpu_norm_carbon + year* gpu_op_cost, '\t',
fpga_norm_carbons[0] +year* fpga_op_cost[0],"\t",
fpga_norm_carbons[1] +year* fpga_op_cost[1],"\t",
fpga_norm_carbons[2] +year* fpga_op_cost[2],"\t",
fpga_norm_carbons[3] +year* fpga_op_cost[3],"\t",
)