Title: Benchmarking the Keras API on GPU: the use of tensorflow and CNTK libraries as back-end

Authors: Felipe Florencio; Edward David Moreno

Addresses: Programa de Pós-Graduação em Ciência da Computação, Universidade Federal de Sergipe (UFS), São Cristovão, SE, Brazil ' Departamento de Computação, Universidade Federal de Sergipe (UFS), São Cristóvão, SE, Brazil

Abstract: With the popularisation of convolutional neural networks (CNNs), many tools were developed to facilitate the development of models. One of the main tools developed is the Keras API, which is a high-level API for creating and training models. The Keras API acts as a high-level layer to facilitate the implementation of neural networks while other CNN libraries can run as backend. There is a demand for studies that compare the performance of a CNN implemented with the Keras API and the performance of CNNs implemented only with native methods to CNN libraries. To evaluate the impact of the Keras API on the performance of TensorFlow 1, TensorFlow 2 and CNTK libraries in relation to the execution time in GPUs, an experiment was conducted for measuring the execution time of the LeNet-5 model. It was implemented with the aid of the Keras API and implemented without it. Models implemented with Keras API methods showed longer execution times than models implemented only with native methods from CNTK libraries. The performance difference can be significant for some applications. The Keras API sacrifices library performance up to four times when compared to native methods.

Keywords: convolutional neural network; CNN; GPU; benchmarking; evaluation performance; Keras; tensorflow; CNTK.

DOI: 10.1504/IJHPCN.2021.120748

International Journal of High Performance Computing and Networking, 2021 Vol.17 No.1, pp.19 - 27

Received: 14 Dec 2020
Accepted: 06 Jul 2021

Published online: 07 Feb 2022 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article