Interoperability of tools for machine learning inference

No Thumbnail Available

URL

Journal Title

Journal ISSN

Volume Title

Perustieteiden korkeakoulu | Master's thesis

Date

2020-06-16

Department

Major/Subject

Machine learning and data science

Mcode

SCI3044

Degree programme

Master’s Programme in Computer, Communication and Information Sciences

Language

en

Pages

62

Series

Abstract

Deep learning is a machine learning method based on artificial neural networks. In recent years, deep learning models have seen great success in many fields such as computer vision and speech recognition. As the uses of deep learning have grown, the number of tools that help developers with their deep learning models has grown with it. These tools may help in neural network creation, training and inference, or simply make some aspects like inference easier and faster. In real-time use cases speed of inference is especially important. In recent years there have been several new tools released to make inference faster. However, the tools often use their own formats and implementation, which makes starting their use difficult. One solution to this problem is to convert a model from current framework to the target inference framework, enabling one to utilize the speed-ups these frameworks provide without the additional work of re-creating a model with them. The variety of tools creates a problem where converting from one tool to another gets more difficult, as every new inference framework would require its own converter for each source framework. One solution is to use an intermediary representation (IR) for neural networks. One such IR is ONNX (Open Neural Network eXchange). In this work, we study different inference optimization tools and their support for interoperability. This is achieved by performing experiments with many different neural network models using many different tools. We use a popular framework (PyTorch) as a base and convert to other tools. Convolutional neural networks are especially under study due to their wide amount of use cases that require quick inference, such as self-driving cars and security cameras. The results show that popular and simpler models were easily converted and run on target frameworks, but more complex models failed to convert or had difficulties. Custom neural network operators make it difficult to provide a common language for interoperability. However, all the studied frameworks use Python and NumPy which makes it easy to prototype and test them. Growing support of ONNX also enables conversions that otherwise most likely would not be possible. In terms of performance, the results show that it is possible to accelerate inference with relatively low effort by converting a model to an inference-focused framework as long as some conditions are met, such as having a specific CPU or GPU. On a GPU most models were able to achieve up to 50\% speed up compared to baseline. On a CPU The speed-ups were up to 10x more than baseline with smaller convolutional networks.

'Syväoppiminen' on koneoppimistekniikka, joka perustuu syviin neuroverkkoihin. Tekniikan käyttökohteet ovat yleistyneet ja sitä myöten myös työkalujen määrä jotka auttavat ohjelmoijia käyttämään neuroverkkomalleja on kasvanut. Nämä työkalut voivat auttaa esim. neuroverkkojen kouluttamisessa tai tehdä ennusteet nopeammaksi. Varsinkin reaaliajan käyttökohteissa ennusteiden nopeus on tärkeää. Työkalujen moninaisuus aiheuttaa ongelman, jossa mahdollisuus konvertoida työkalusta toiseen pienenee. Tämä johtaa tarpeeseen formaatille, jonka kautta voi konvertoida työkalusta toiseen. Yksi tällainen formaatti on ONNX (Open Neural Network eXchange). Tässä diplomityössä tutkitaan työkaluja, jotka tarjoavat ennusteen nopeuttamista. Tämä toteutetaan kokeilemalla monia eri neuroverkkoja monella eri työkalulla, ja konvertoimalla suositusta työkalusta (PyTorch) muihin. Fokuksena on nopeuden lisäksi työkalujen kyky pitää malli samanlaisena konversion jälkeen ja työkalujen tuki konversiolle. Varsinkin konvoluutioneuroverkot ovat kiinnostuksen kohteena niiden monien käyttökohteiden takia. Itseajavat autot ja valvontakamerat hyötyvät mahdollisesti paljon nopeista ennustuksista. Yleiset ja yksinkertaisemmat mallit konvertoituivat helposti kohdealustalle. Monimutkaisemmat ja erikoisemmat mallit eivät välttämättä kääntyneet lainkaan. Mukautetut neuraaliverkko-operaattorit tekevät yleisen yhteentoimivuusformaatin tekemisen vaikeaksi. Tulokset osoittavat, että ennustukset voi saada nopeammaksi pienellä vaivalla mikäli tietyt edellytykset, kuten tietty GPU tai CPU, toteutuvat. GPUlla useimmat mallit olivat n. 50\% nopeampia kuin alkuperäiset mallit. CPUlla tietyt mallit olivat jopa 10 kertaa nopeampia kuin alkuperäiset mallit.

Description

Supervisor

Hirvisalo, Vesa

Thesis advisor

Debner, Anton

Keywords

machine learning, inference, deep learning, interoperability, optimization

Other note

Citation