CuPit-2 A Portable Parallel Programming Language for Artificial Neural Networks

  • 格式:pdf
  • 大小:40.48 KB
  • 文档页数:6

CuPit-2:APortableParallelProgrammingLanguage

forArtificialNeuralNetworks

HolgerHopp,LutzPrechelt(hoppprechelt@ira.uka.de)

Universit¨atKarlsruhe,Fakult¨atf¨urInformatik,76128Karlsruhe,Germany

ABSTRACT

CuPit-2isaprogramminglanguagespecificallydesignedtoexpressneuralnetworklearn-ingalgorithms.Itprovidesmostoftheflexibilityofgeneral-purposelanguageslikeC/C++,butresultsinmuchclearerandmoreelegantprogramsduetohigherexpressiveness,inparticularforalgorithmsthatchangethenetworktopologydynamically(constructivealgorithms,pruningalgorithms).Furthermore,CuPit-2programscanbecompiledintoefficientcodeforparallelma-chines;nochangesarerequiredinthesourceprogram.ThisarticlepresentsadescriptionofthelanguageconstructsandreportsperformanceresultsforanimplementationofCuPit-2onsym-metricmultiprocessors(SMPs).

INTRODUCTION

Forresearchersinneuralnetworklearningalgorithms,thereareusuallytwopossibilitieswhenit

comestoimplementingandrunninganalgorithm.Theycaneitheradaptorextendapreprogrammed

simulator(suchasSNNS[13],Xerion[10],NeuroGraph[12],NeuralWorks[8]etc.)oruseageneral-

purposeprogramminglanguage(suchasCorC++)tocreateacompleteimplementationbyhand.

Simulatorshavemorepowerfulinteractivefacilitiesthanhand-writtenimplementationsbutoftenlack

flexibilityandextensibility.Inparticular,mostsimulatorsdonotprovidegoodsupportforalgorithms

thatchangethenetworktopologyduringlearning.Hence,neuralnetworkresearchersoftenendup

withhand-implementations.SomewhatinbetweenthesetwoapproachesarelibrariessuchasMUME

[4]orSesame[7]thatprovideneuralnetworkbuildingblocksforC/C++.Justlikesimulators,such

librariesdonotseemtobewidelyusedinneuralnetworkresearch.

Onaparallelcomputerthingsbecomeevenworse.Afewparallelimplementationsofsimulatorsexist,

butmostareveryrestrictedorunreliable.Therearealsohigh-levelparallellanguages(e.g.Concurrent

Aggregates[2])inwhichahand-implementationwouldbeaboutaseasyasinplainC/C++,butthey

cannotyetbetranslatedintosufficientlyefficientparallelcode.Lowerlevelparallelprogramming

platformssuchasCorC++withamessage-passingorthreadslibraryrequiretheprogrammerto

implementdatadistributionandthreadmanagement.Suchprogramsarenon-portableanddifficult

todesign,todebug,tounderstand,tochange,andtooptimize.Parallelimplementationsofneural

networkbuildingblocksprovidesomekindofcompromisebetweenthesepropertiesbutinheritallof

therespectiveproblems.

Tosimplifytheimplementationofneuralnetworkalgorithmsforsequentialandparallelplatforms,

wepresenttheprogramminglanguageCuPit-2.CuPit-2describesnetworksinanobject-centered

wayusingspecialobjecttypes“connection”,“node”and“network”.Ithasspecialoperationsfor

manipulatingnetworktopologyandallowsforparalleloperationsbyparallelprocedurecallsatthe

network,nodegroup,andconnectionlevel.

Comparedtolow-levelparallelprogramminglanguages,CuPit-2hashigherexpressiveness,clarity,

andeaseofprogramming.

Comparedtohigh-levelparallellanguagesitwillalsoresultinmoreefficientcode.Duetoitsbuilt-in

domainmodel,aCuPit-2compilerknowsenoughaboutthebehavioroftheuserprogramstoapply

optimizationsunavailabletocompilersforgeneral-purposeparallellanguages.ComparedtosequentialC/C++,CuPit-2stillhastheadvantagesofhigherexpressivenessandclarity

butmayresultinlessefficientcode.CuPit-2programscanbeportedtoparallelmachineswithout

change,though.

Comparedtopre-programmedsimulators,CuPit-2ismoreflexible,whiletherelativeefficiencyde-

pendsontheapplication.

Toobtainsimilaradvantages,variousproposalshavebeenmadefornetworkdescriptionlanguages

[1,5,6,11].Mostofthesecoveronlystaticnetworktopologiesandarenotfullprogramminglan-

guages,thusstillexhibitmostoftheproblemsofhand-writtenimplementations.Eventhedescription

languagesthatrepresentorareintegratedwithafullprogramminglanguagedonotprovideconstructs

fordynamicchangesofnetworktopology.

IntheremainderofthisarticleweinformallydescribeCuPit-2languageconstructsandpresentper-

formanceresultsobtainedwithaparallelimplementationonsymmetricmultiprocessormachines

(SMPs).

LANGUAGEOVERVIEW

TheprogramminglanguageCuPit-2[3]isbasedontheobservationthatneuralalgorithmspredom-

inantlyexecutelocaloperations(onnodesorconnections),reductions(e.g.sumoverallweighted

incomingconnections)andbroadcasts(e.g.applyaglobalparametertoallnodes).Operationscanbe

describedonlocalobjects(connections,nodes,networkreplicates)andcanbeperformedgroupwise

(connectionsofanode,nodesofanodegroup,replicatesofanetwork,orsubsetsofanyofthese).

Thisleadstothreenestedlevelsofparallelism:connectionparallelism,nodeparallelismandexam-

pleparallelism.Thereisusuallynootherformofparallelisminneuralalgorithms,suchthatwecan

restrictparallelismtotheabovethreelevelswithoutlossofgenerality.

CuPit-2isaprocedural,object-centeredlanguage;thereareobjecttypesandassociatedoperations