Skip to content
Snippets Groups Projects
Commit fee3e0d5 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Adding more DNN times info

parent 5ddef3a1
No related branches found
No related tags found
No related merge requests found
......@@ -8,14 +8,16 @@ class Benchmark:
def __init__(self):
self.binary_path = ""
self.binary_time = 0
self.batch_time = 0
self.num_layers = 0
self.data_size = 0
self.num_classes = 0
self.batch_size = 50
ResNet50 = Benchmark()
ResNet50.binary_path = "resnet_imagenet"
#ResNet50.binary_time = 5.1 * 60 # 5.1 mins * 60 secs/min
ResNet50.binary_time = 3.85 * 100 # 50 images * 100 batches
ResNet50.batch_time = 3.85 # Time for batch with 50 images
ResNet50.num_layers = 53
......@@ -25,6 +27,18 @@ ResNet50.batch_size = 50
ResNet18 = Benchmark()
ResNet18.binary_path = "resnet18_cifar10"
#ResNet50.binary_time = 5.1 * 60 # 5.1 mins * 60 secs/min
ResNet18.binary_time = 12.9 # 50 images * 100 batches
ResNet18.batch_time = 12.9 / 50 # Time for batch with 50 images
ResNet18.num_layers = 21
ResNet18.data_size = 50 * 3 * 32 * 32 * 4 # *4 for Float32 Data
ResNet18.num_classes = 10
ResNet18.batch_size = 50
VGG16_ImageNet = Benchmark()
VGG16_ImageNet.binary_path = "vgg16_imagenet"
#VGG16_ImageNet.binary_time = 10.6 * 60 # 5.1 mins * 60 secs/min
......@@ -36,6 +50,27 @@ VGG16_ImageNet.num_classes = 1000
VGG16_ImageNet.batch_size = 50
VGG16_CIFAR10 = Benchmark()
VGG16_CIFAR10.binary_path = "vgg16_cifar10"
VGG16_CIFAR10.binary_time = 19.0 # 50 images * 100 batches
VGG16_CIFAR10.batch_time = 19.0 /50
VGG16_CIFAR10.num_layers = 15
VGG16_CIFAR10.data_size = 50 * 3 * 32 * 32 * 4
VGG16_CIFAR10.num_classes = 10
VGG16_CIFAR10.batch_size = 50
VGG16_CIFAR100 = Benchmark()
VGG16_CIFAR100.binary_path = "vgg16_cifar10"
VGG16_CIFAR100.binary_time = 19.0 # 50 images * 100 batches
VGG16_CIFAR100.batch_time = 19.0 /50
VGG16_CIFAR100.num_layers = 15
VGG16_CIFAR100.data_size = 50 * 3 * 32 * 32 * 4
VGG16_CIFAR100.num_classes = 100
VGG16_CIFAR100.batch_size = 50
AlexNet_ImageNet = Benchmark()
AlexNet_ImageNet.binary_path = "alexnet_imagenet"
AlexNet_ImageNet.binary_time = 0.66 * 100
......@@ -47,6 +82,40 @@ AlexNet_ImageNet.batch_size = 50
AlexNet_CIFAR10 = Benchmark()
AlexNet_CIFAR10.binary_path = "alexnet_cifar10"
AlexNet_CIFAR10.binary_time = 13.52
AlexNet_CIFAR10.batch_time = 13.52 / 50
AlexNet_CIFAR10.num_layers = 6
AlexNet_CIFAR10.data_size = 50 * 3 * 32 * 32 * 4
AlexNet_CIFAR10.num_classes = 10
AlexNet_CIFAR10.batch_size = 50
AlexNet2_CIFAR10 = Benchmark()
AlexNet2_CIFAR10.binary_path = "alexnet2_cifar10"
AlexNet2_CIFAR10.binary_time = 5.6
AlexNet2_CIFAR10.batch_time = 5.6 / 50
AlexNet2_CIFAR10.num_layers = 7
AlexNet2_CIFAR10.data_size = 50 * 3 * 32 * 32 * 4
AlexNet2_CIFAR10.num_classes = 10
AlexNet2_CIFAR10.batch_size = 50
LeNet_CIFAR10 = Benchmark()
LeNet_CIFAR10.binary_path = "lenet_keras"
LeNet_CIFAR10.binary_time = 1.21
LeNet_CIFAR10.batch_time = 1.21 / 50
LeNet_CIFAR10.num_layers = 4
LeNet_CIFAR10.data_size = 50 * 3 * 32 * 32 * 4
LeNet_CIFAR10.num_classes = 10
LeNet_CIFAR10.batch_size = 50
# 100 batches with batch size of 50 each
batch_count = 100
......@@ -96,17 +165,21 @@ def getConfTime(Bench):
def getNetworkTime(Bench):
# Calibration Download Time
download_data_MB = Bench.data_size / 1000000
download_data_MB = Bench.data_size * 1.0 / 1000000
download_data_time = download_data_MB * download_time_per_1MB
# Profile Uploading (to Cloud Server) Time
total_knobs = (promise_knobs + 1) * Bench.num_layers
profile_size = total_knobs * Bench.batch_size * Bench.num_classes * 4 # *4 for FP32 data
profile_size_MB = profile_size / 1000000
print (" ")
print ("--- profile_size = ", profile_size)
profile_size_MB = profile_size * 1.0 / 1000000
upload_data_time = profile_size_MB * upload_time_per_1MB
network_time = download_data_time + upload_data_time
print( "network_time = ", download_data_time, upload_data_time, network_time)
return network_time
......@@ -130,15 +203,28 @@ if __name__ == "__main__":
resnet50_time = getTimeOnEdge(ResNet50)
print ("*** ResNet50 time (mins) = ", resnet50_time)
vgg16_img_time = getTimeOnEdge(VGG16_ImageNet)
resnet18_time = getTimeOnEdge(ResNet18)
print ("*** ResNet18 time (mins) = ", resnet18_time)
vgg16_img_time = getTimeOnEdge(VGG16_ImageNet)
print ("*** VGG16-Imagenet time (mins) = ", vgg16_img_time)
vgg16_cifar10_time = getTimeOnEdge(VGG16_CIFAR10)
print ("*** VGG16-CIFAR10 time (mins) = ", vgg16_cifar10_time)
alexnet_img_time = getTimeOnEdge(AlexNet_ImageNet)
vgg16_cifar100_time = getTimeOnEdge(VGG16_CIFAR100)
print ("*** VGG16-CIFAR100 time (mins) = ", vgg16_cifar100_time)
alexnet_img_time = getTimeOnEdge(AlexNet_ImageNet)
print ("*** AlexNet-Imagenet time (mins) = ", alexnet_img_time)
alexnet_cifar10_time = getTimeOnEdge(AlexNet_CIFAR10)
print ("*** AlexNet-CIFAR10 time (mins) = ", alexnet_cifar10_time)
alexnet2_cifar10_time = getTimeOnEdge(AlexNet2_CIFAR10)
print ("*** AlexNet2-CIFAR10 time (mins) = ", alexnet2_cifar10_time)
lenet_cifar10_time = getTimeOnEdge(LeNet_CIFAR10)
print ("*** LeNet-CIFAR10 time (mins) = ", lenet_cifar10_time)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment