368 lines
12 KiB
Julia
368 lines
12 KiB
Julia
|
###########################################################################
|
||
|
# #
|
||
|
# FLOPS Computations #
|
||
|
# #
|
||
|
###########################################################################
|
||
|
using PlotlyJS
|
||
|
using PlotlyJS: savefig
|
||
|
|
||
|
flops_bcnn_100_mnist =
|
||
|
[5.5e11 * 100, 5.5e11 * 200, 5.5e11 * 300, 5.5e11 * 400, 5.5e11 * 500]
|
||
|
flops_freq_100_mnist =
|
||
|
[2.58e11 * 100, 2.58e11 * 200, 2.58e11 * 300, 2.58e11 * 400, 2.58e11 * 500]
|
||
|
|
||
|
flops_bcnn_est_mnist =
|
||
|
[5.5e11 * 65, 5.5e11 * 21 * 2, 5.5e11 * 37 * 3, 5.5e11 * 53 * 4, 5.5e11 * 65 * 5]
|
||
|
flops_freq_est_mnist =
|
||
|
[2.58e11 * 16, 2.58e11 * 12 * 2, 2.58e11 * 56 * 3, 2.58e11 * 28 * 4, 2.58e11 * 20 * 5]
|
||
|
|
||
|
flops_bcnn_wat_mnist =
|
||
|
[5.5e11 * 19, 5.5e11 * 2 * 13, 5.5e11 * 3 * 10, 5.5e11 * 4 * 8, 5.5e11 * 5 * 6]
|
||
|
flops_freq_wat_mnist =
|
||
|
[2.58e11 * 43, 2.58e11 * 2 * 39, 2.58e11 * 3 * 27, 2.58e11 * 4 * 23, 2.58e11 * 5 * 21]
|
||
|
|
||
|
flops_bcnn_acc_mnist =
|
||
|
[5.5e11 * 72, 5.5e11 * 2 * 69, 5.5e11 * 3 * 69, 5.5e11 * 4 * 77, 5.5e11 * 5 * 80]
|
||
|
flops_freq_acc_mnist =
|
||
|
[2.58e11 * 12, 2.58e11 * 2 * 8, 2.58e11 * 3 * 6, 2.58e11 * 4 * 6, 2.58e11 * 5 * 4]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
flops_bcnn_100_cifar = [
|
||
|
5.5e11 * 100 * 16.3,
|
||
|
5.5e11 * 200 * 16.3,
|
||
|
5.5e11 * 300 * 16.3,
|
||
|
5.5e11 * 400 * 16.3,
|
||
|
5.5e11 * 500 * 16.3,
|
||
|
]
|
||
|
flops_freq_100_cifar = [
|
||
|
2.58e11 * 100 * 16.3,
|
||
|
2.58e11 * 200 * 16.3,
|
||
|
2.58e11 * 300 * 16.3,
|
||
|
2.58e11 * 400 * 16.3,
|
||
|
2.58e11 * 500 * 16.3,
|
||
|
]
|
||
|
|
||
|
flops_bcnn_est_cifar = [
|
||
|
5.5e11 * 61 * 16.3,
|
||
|
5.5e11 * 2 * 41 * 16.3,
|
||
|
5.5e11 * 3 * 41 * 16.3,
|
||
|
5.5e11 * 4 * 21 * 16.3,
|
||
|
5.5e11 * 5 * 81 * 16.3,
|
||
|
]
|
||
|
flops_freq_est_cifar = [
|
||
|
2.58e11 * 56 * 16.3,
|
||
|
2.58e11 * 2 * 40 * 16.3,
|
||
|
2.58e11 * 3 * 24 * 16.3,
|
||
|
2.58e11 * 4 * 24 * 16.3,
|
||
|
2.58e11 * 5 * 28 * 16.3,
|
||
|
]
|
||
|
|
||
|
flops_bcnn_wat_cifar = [
|
||
|
5.5e11 * 16.3 * 19,
|
||
|
5.5e11 * 2 * 16.3 * 14,
|
||
|
5.5e11 * 3 * 16.3 * 11,
|
||
|
5.5e11 * 4 * 16.3 * 9,
|
||
|
5.5e11 * 5 * 16.3 * 7,
|
||
|
]
|
||
|
flops_freq_wat_cifar = [
|
||
|
2.58e11 * 16.3 * 39,
|
||
|
2.58e11 * 2 * 16.3 * 36,
|
||
|
2.58e11 * 3 * 16.3 * 32,
|
||
|
2.58e11 * 4 * 16.3 * 25,
|
||
|
2.58e11 * 5 * 16.3 * 21,
|
||
|
]
|
||
|
|
||
|
flops_bcnn_acc_cifar = [
|
||
|
5.5e11 * 16.3 * 51,
|
||
|
5.5e11 * 2 * 16.3 * 37,
|
||
|
5.5e11 * 3 * 16.3 * 30,
|
||
|
5.5e11 * 4 * 16.3 * 36,
|
||
|
5.5e11 * 5 * 16.3 * 33,
|
||
|
]
|
||
|
flops_freq_acc_cifar = [
|
||
|
2.58e11 * 16.3 * 7,
|
||
|
2.58e11 * 2 * 16.3 * 4,
|
||
|
2.58e11 * 3 * 16.3 * 4,
|
||
|
2.58e11 * 4 * 16.3 * 3,
|
||
|
2.58e11 * 5 * 16.3 * 3,
|
||
|
]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#=
|
||
|
println("MNIST BCNN 100 FLOPS $(flops_bcnn_100_mnist)")
|
||
|
println("MNIST FREQ 100 FLOPS $(flops_freq_100_mnist)")
|
||
|
|
||
|
println("MNIST BCNN est FLOPS $(flops_bcnn_est_mnist)")
|
||
|
println("MNIST FREQ est FLOPS $(flops_freq_est_mnist)")
|
||
|
|
||
|
println("MNIST BCNN wat FLOPS $(flops_bcnn_wat_mnist)")
|
||
|
println("MNIST FREQ wat FLOPS $(flops_freq_wat_mnist)")
|
||
|
|
||
|
println("MNIST BCNN acc FLOPS $(flops_bcnn_acc_mnist)")
|
||
|
println("MNIST FREQ acc FLOPS $(flops_freq_acc_mnist)")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
println("CIFAR BCNN 100 FLOPS $(flops_bcnn_100_cifar)")
|
||
|
println("CIFAR FREQ 100 FLOPS $(flops_freq_100_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN est FLOPS $(flops_bcnn_est_cifar)")
|
||
|
println("CIFAR FREQ est FLOPS $(flops_freq_est_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN wat FLOPS $(flops_bcnn_wat_cifar)")
|
||
|
println("CIFAR FREQ wat FLOPS $(flops_freq_wat_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN acc FLOPS $(flops_bcnn_acc_cifar)")
|
||
|
println("CIFAR FREQ acc FLOPS $(flops_freq_acc_cifar)")
|
||
|
=#
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
watts_bcnn_100_mnist = [384367.0, 354604.0, 578490.0, 598499.0, 659321.0]
|
||
|
watts_freq_100_mnist = [818766.0, 1.639863e6, 1.826163e6, 1.961074e6, 2.018758e6]
|
||
|
|
||
|
watts_bcnn_est_mnist = [75998.0, 167339.0, 92658.0, 118200.0, 157475.0]
|
||
|
watts_freq_est_mnist = [919386.0, 368970.0, 466917.0, 294907.0, 1.068331e6]
|
||
|
|
||
|
watts_bcnn_wat_mnist = [116516.0, 115347.0, 116225.0, 117989.0, 175601.0]
|
||
|
watts_freq_wat_mnist = [146912.0, 136441.0, 114160.0, 131887.0, 119364.0]
|
||
|
|
||
|
watts_bcnn_acc_mnist = [57569.0, 37169.0, 43488.0, 390792.0, 50428.0]
|
||
|
watts_freq_acc_mnist = [1.332701e6, 498486.0, 532690.0, 1.344363e6, 832005.0]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
watts_bcnn_100_cifar = [310789.0, 332406.0, 354631.0, 390792.0, 545941.0]
|
||
|
watts_freq_100_cifar = [1.128901e6, 1.213355e6, 1.29992e6, 1.344363e6, 1.35644e6]
|
||
|
|
||
|
watts_bcnn_est_cifar = [164841.0, 167339.0, 92658.0, 118200.0, 157475.0]
|
||
|
watts_freq_est_cifar = [358373.0, 368970.0, 466917.0, 294907.0, 1.068331e6]
|
||
|
|
||
|
watts_bcnn_wat_cifar = [118621.0, 115347.0, 116225.0, 117989.0, 175601.0]
|
||
|
watts_freq_wat_cifar = [149356.0, 136441.0, 114160.0, 131887.0, 119364.0]
|
||
|
|
||
|
watts_bcnn_acc_cifar = [60415.0, 37169.0, 43488.0, 390792.0, 50428.0]
|
||
|
watts_freq_acc_cifar = [578846.0, 498486.0, 532690.0, 1.344363e6, 832005.0]
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#=
|
||
|
println("MNIST BCNN 100 WATTS $(watts_bcnn_100_mnist)")
|
||
|
println("MNIST FREQ 100 WATTS $(watts_freq_100_mnist)")
|
||
|
|
||
|
println("MNIST BCNN est WATTS $(watts_bcnn_est_mnist)")
|
||
|
println("MNIST FREQ est WATTS $(watts_freq_est_mnist)")
|
||
|
|
||
|
println("MNIST BCNN wat WATTS $(watts_bcnn_wat_mnist)")
|
||
|
println("MNIST FREQ wat WATTS $(watts_freq_wat_mnist)")
|
||
|
|
||
|
println("MNIST BCNN acc WATTS $(watts_bcnn_acc_mnist)")
|
||
|
println("MNIST FREQ acc WATTS $(watts_freq_acc_mnist)")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
println("CIFAR BCNN 100 WATTS $(watts_bcnn_100_cifar)")
|
||
|
println("CIFAR FREQ 100 WATTS $(watts_freq_100_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN est WATTS $(watts_bcnn_est_cifar)")
|
||
|
println("CIFAR FREQ est WATTS $(watts_freq_est_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN wat WATTS $(watts_bcnn_wat_cifar)")
|
||
|
println("CIFAR FREQ wat WATTS $(watts_freq_wat_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN acc WATTS $(watts_bcnn_acc_cifar)")
|
||
|
println("CIFAR FREQ acc WATTS $(watts_freq_acc_cifar)")
|
||
|
=#
|
||
|
|
||
|
println("MNIST BCNN 100 FLOPS/W $(flops_bcnn_100_mnist ./ watts_bcnn_100_mnist)")
|
||
|
println("MNIST FREQ 100 FLOPS/W $(flops_freq_100_mnist ./ watts_freq_100_mnist)")
|
||
|
|
||
|
println("MNIST BCNN est FLOPS/W $(flops_bcnn_est_mnist ./ watts_bcnn_est_mnist)")
|
||
|
println("MNIST FREQ est FLOPS/W $(flops_freq_est_mnist ./ watts_freq_est_mnist)")
|
||
|
|
||
|
println("MNIST BCNN wat FLOPS/W $(flops_bcnn_wat_mnist ./ watts_bcnn_wat_mnist)")
|
||
|
println("MNIST FREQ wat FLOPS/W $(flops_freq_wat_mnist ./ watts_freq_wat_mnist)")
|
||
|
|
||
|
println("MNIST BCNN acc FLOPS/W $(flops_bcnn_acc_mnist ./ watts_bcnn_acc_mnist)")
|
||
|
println("MNIST FREQ acc FLOPS/W $(flops_freq_acc_mnist ./ watts_freq_acc_mnist)")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
println("CIFAR BCNN 100 FLOPS/W $(flops_bcnn_100_cifar ./ watts_bcnn_100_cifar)")
|
||
|
println("CIFAR FREQ 100 FLOPS/W $(flops_freq_100_cifar ./ watts_freq_100_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN est FLOPS/W $(flops_bcnn_est_cifar ./ watts_bcnn_est_cifar)")
|
||
|
println("CIFAR FREQ est FLOPS/W $(flops_freq_est_cifar ./ watts_freq_est_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN wat FLOPS/W $(flops_bcnn_wat_cifar ./ watts_bcnn_wat_cifar)")
|
||
|
println("CIFAR FREQ wat FLOPS/W $(flops_freq_wat_cifar ./ watts_freq_wat_cifar)")
|
||
|
|
||
|
println("CIFAR BCNN acc FLOPS/W $(flops_bcnn_acc_cifar ./ watts_bcnn_acc_cifar)")
|
||
|
println("CIFAR FREQ acc FLOPS/W $(flops_freq_acc_cifar ./ watts_freq_acc_cifar)")
|
||
|
|
||
|
|
||
|
flops_w_bcnn_100_mnist = flops_bcnn_100_mnist ./ watts_bcnn_100_mnist
|
||
|
flops_w_freq_100_mnist = flops_freq_100_mnist ./ watts_freq_100_mnist
|
||
|
|
||
|
flops_w_bcnn_est_mnist = flops_bcnn_est_mnist ./ watts_bcnn_est_mnist
|
||
|
flops_w_freq_est_mnist = flops_freq_est_mnist ./ watts_freq_est_mnist
|
||
|
|
||
|
flops_w_bcnn_wat_mnist = flops_bcnn_wat_mnist ./ watts_bcnn_wat_mnist
|
||
|
flops_w_freq_wat_mnist = flops_freq_wat_mnist ./ watts_freq_wat_mnist
|
||
|
|
||
|
flops_w_bcnn_acc_mnist = flops_bcnn_acc_mnist ./ watts_bcnn_acc_mnist
|
||
|
flops_w_freq_acc_mnist = flops_freq_acc_mnist ./ watts_freq_acc_mnist
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
flops_w_bcnn_100_cifar = flops_bcnn_100_cifar ./ watts_bcnn_100_cifar
|
||
|
flops_w_freq_100_cifar = flops_freq_100_cifar ./ watts_freq_100_cifar
|
||
|
|
||
|
flops_w_bcnn_est_cifar = flops_bcnn_est_cifar ./ watts_bcnn_est_cifar
|
||
|
flops_w_freq_est_cifar = flops_freq_est_cifar ./ watts_freq_est_cifar
|
||
|
|
||
|
flops_w_bcnn_wat_cifar = flops_bcnn_wat_cifar ./ watts_bcnn_wat_cifar
|
||
|
flops_w_freq_wat_cifar = flops_freq_wat_cifar ./ watts_freq_wat_cifar
|
||
|
|
||
|
flops_w_bcnn_acc_cifar = flops_bcnn_acc_cifar ./ watts_bcnn_acc_cifar
|
||
|
flops_w_freq_acc_cifar = flops_freq_acc_cifar ./ watts_freq_acc_cifar
|
||
|
|
||
|
|
||
|
en_plot = plot(
|
||
|
[
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_100_mnist,
|
||
|
name = "LeNet Exp 1",
|
||
|
marker = attr(symbol = 4, color = "rgb(211,120,000)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_est_mnist,
|
||
|
name = "LeNet Exp 2",
|
||
|
marker = attr(symbol = 17, color = "rgb(255,170,017)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_wat_mnist,
|
||
|
name = "LeNet Exp 3",
|
||
|
marker = attr(symbol = 2, color = "rgb(255,187,034)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_acc_mnist,
|
||
|
name = "LeNet Exp 4",
|
||
|
marker = attr(symbol = 0, color = "rgb(255,204,051)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_100_mnist,
|
||
|
name = "BCNN Exp 1",
|
||
|
marker = attr(symbol = 4, color = "rgb(055,033,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_est_mnist,
|
||
|
name = "BCNN Exp 2",
|
||
|
marker = attr(symbol = 17, color = "rgb(033,081,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_wat_mnist,
|
||
|
name = "BCNN Exp 3",
|
||
|
marker = attr(symbol = 2, color = "rgb(033,115,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_acc_mnist,
|
||
|
name = "BCNN Exp 4",
|
||
|
marker = attr(symbol = 0, color = "rgb(151,177,255)", line_width = 1.0),
|
||
|
),
|
||
|
],
|
||
|
Layout(
|
||
|
mode = "overlay",
|
||
|
xaxis_tickangle = -45,
|
||
|
yaxis_title_text = "FLOPS/W",
|
||
|
xaxis_title_text = "Size";
|
||
|
xaxis_range = [-1, 5],
|
||
|
xaxis_type = "category",
|
||
|
),
|
||
|
)
|
||
|
savefig(en_plot, "mnist_f_w_exp.png")
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
en_plot = plot(
|
||
|
[
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_100_cifar,
|
||
|
name = "LeNet Exp 1",
|
||
|
marker = attr(symbol = 4, color = "rgb(211,120,000)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_est_cifar,
|
||
|
name = "LeNet Exp 2",
|
||
|
marker = attr(symbol = 17, color = "rgb(255,170,017)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_wat_cifar,
|
||
|
name = "LeNet Exp 3",
|
||
|
marker = attr(symbol = 2, color = "rgb(255,187,034)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_freq_acc_cifar,
|
||
|
name = "LeNet Exp 4",
|
||
|
marker = attr(symbol = 0, color = "rgb(255,204,051)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_100_cifar,
|
||
|
name = "BCNN Exp 1",
|
||
|
marker = attr(symbol = 4, color = "rgb(055,033,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_est_cifar,
|
||
|
name = "BCNN Exp 2",
|
||
|
marker = attr(symbol = 17, color = "rgb(033,081,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_wat_cifar,
|
||
|
name = "BCNN Exp 3",
|
||
|
marker = attr(symbol = 2, color = "rgb(033,115,240)", line_width = 1.0),
|
||
|
),
|
||
|
scatter(
|
||
|
x = ["1", "2", "3", "4", "5"],
|
||
|
y = flops_w_bcnn_acc_cifar,
|
||
|
name = "BCNN Exp 4",
|
||
|
marker = attr(symbol = 0, color = "rgb(151,177,255)", line_width = 1.0),
|
||
|
),
|
||
|
],
|
||
|
Layout(
|
||
|
mode = "overlay",
|
||
|
xaxis_tickangle = -45,
|
||
|
yaxis_title_text = "FLOPS/W",
|
||
|
xaxis_title_text = "Size";
|
||
|
xaxis_range = [-1, 5],
|
||
|
xaxis_type = "category",
|
||
|
),
|
||
|
)
|
||
|
savefig(en_plot, "cifar_f_w_exp.png")
|