Multipath Execution on Chip Multiprocessors Enabled by Redundant Threads

  • 格式:pdf
  • 大小:106.90 KB
  • 文档页数:19

Multipath Execution on Chip Multiprocessors Enabled by Redundant ThreadsOctober 23, 20011Multipath Execution on Chip MultiprocessorsEnabled by Redundant Threads

Technical Report CESR-TR-01-2Karthik Sundaramoorthy, Zach Purser, Eric RotenbergCenter for Embedded System Research (CESR)Department of Electrical and Computer EngineeringNorth Carolina State University{ksundar,zrpurser,ericro}@ece.ncsu.edu

AbstractTheperformancepenaltyofmispredictedbranchescanbereducedbyfetching/executingbothpathsofunconfidentbranches.Executingbothpathsofabranchinvolvesforkinganewthreadcontextforthenon-predictedpath.Akeyrequirementistheabilitytoquicklycopyregisterandmemorystate,sothatnewthreadsareinitiatedquickly.Mostmultipatharchitecturesarebuiltontopofsimultaneousmultithreading(SMT),becauseasharedregisterfileandcacheenablesnewthreadstoinheritstatewithoutanyactualdatamovement.Multipathexecutiononchipmulti-processors(CMP)islargelyunexploredbecauseper-threadregisterfilesandlevel-1cachesarephysically separated, making it difficult to quickly copy state.Redundantexecutionisproposedasanenablingmechanismfordual-pathexecutiononaCMPwithtwoprocessingelements(PEs).Byalwaysexecutingtwoprograms,redundantstateismaintainedcontinuouslyinpreparationforforking.Thethreadsredundantlyandindependentlyidentifyunconfidentbranchesandexplorealternativepaths.Whenanunconfidentbranchresolves,oneofthethreadsfallsbehind.Thisisremediedbypassingcontrolflowanddataflowoutcomesfromtheleadingthreadtothelaggingthread.Theseareconsumedasidealbranch/valuepredictions,enablingthelaggingthreadtocatchup,ideallybeforethenextunconfidentbranch.Bybeingpro-activeinsteadofreactive,redundantexecutiondoesnotexhibitasmuchoverheadason-demand state copying.Acompletelydistributed,CMP-basedsolutionwillgenerallyunderperformSMT-basedsolu-tions,yetperformanceimprovementsashighas12%aremeasured.Latencyforcommunicatingpredictions between PEs affects performance significantly, but realistic latencies are tolerable.Multipath Execution on Chip Multiprocessors Enabled by Redundant ThreadsOctober 23, 20012

1. IntroductionMultipathexecutionisatechniqueforreducingtheperformancepenaltyofmispredictedbranches[1,4,8,17,18,19].Aconfidencemechanismdeterminesthelikelihoodthatbranchpredic-tionsarecorrect[5].Ifconfidenceinapredictionislow,amultipathprocessorwillfetchandexe-cutebothpathsfollowingthebranch.Aswithconventionalspeculation,thepredictedpathissquashedifthepredictionwasincorrect.Themispredictionpenaltyisreduced,however,becausepart of the correct path is already processed by the time the misprediction is detected.Multipathexecutiontypicallyrequiressupportforquicklyforkingnewregistercontexts.Simultaneousmultithreadedprocessors(SMT)[16,21]areidealbecausetheyprovidemultipleregistercontextsinasharedregisterfile,managedbyper-threadregistermaptables.Thepre-dictedpathispartofthecurrentthreadandusesthecurrentmaptable.Anewthreadisforkedforthenon-predictedpath,usingthemaptableofafreecontext.Initially,thenewthreadmustinheritregisterstateuptothepointofthebranch.Withasharedregisterfile,inheritingregisterstatedoesnotrequirecopyingregistervalues,onlypointerstothevalues.So,forkingonlyrequiresallocat-inganewmaptableandcopyingcurrentmappingstothenewmaptable.Furthermore,single-cycle copying of map tables is already supported for branch checkpointing (e.g., shadow maps).Thispaperproposesamethodforlimitedmultipathexecutiononchipmultiprocessors(CMP).ACMPhasmultiplethreadcontexts,too,buttheyaredistributedamongprocessingele-ments(PEs)[10].EachPEhasaprivateregisterfileandlevel-1(L1)cache.Physicallyseparatedregisterfilesandcachesmakeitdifficulttoquicklyforkstate.Whenanunconfidentbranchpre-dictionisencountered,thecontentsoftheactiveregisterfilehavetobecopiedtotheregisterfileofafreePE.Copyingisslow,partlybecauseofthedistancebetweenregisterfiles,butmainlybecauseoflimitedbandwidthintoandoutoftheregisterfiles.ForkingmemorystaterequiresasharingmechanismamongdistributedL1caches.Inanycase,theoverheadforcopyingstateissohigh that the non-predicted path may not even begin executing before the branch is resolved.Fortunately,thereisanalternativetocopyingstate.TheprogramcanbeexecutedredundantlyonmultiplePEs.ThisapproachmaintainsredundantcopiesofregisterfilesandL1cachescontin-uously.Inthispaper,multipathexecutionislimitedtotwopaths,sotwocopiesoftheprogramareexecutedredundantlyontwoPEs.Insteady-state,thePEsfetch/executenearlyinlock-stepandtheirstatematchesclosely.Becausetheirstatematches,thePEsarepreparedformultipathexecu-tion ahead of time, and forking is unnecessary.ThetwoPEsredundantlypredictbranchinstructionsandsimultaneouslyestimateconfi-dence.Whenanunconfidentpredictionisencountered,oneofthePEsfollowsthenot-takenpathandtheotherfollowsthetakenpath.WhenthebranchresolvesinbothPEs,thePEthatfollowedthecorrectpathcontinues,whiletheotherPEsquasheswrong-pathinstructionsandre-directsinstruction fetching to the correct path.Atthispoint,thethreadthatfollowedtheincorrectpathlagsbehindtheotherthread.Theleadingthreadpassesallofitscontrolflowanddataflowoutcomestothelaggingthreadviaacommunicationqueue.Outcomesareconsumedbythelaggingthreadasalways-correctbranchandvalue“predictions”[13,15].Assistingthelaggingthreadenablesittocatchupwiththelead-ing thread, materializing some of the performance potential of multipath execution.Communicatingpredictionsseemsequivalenttostatecopying.Whatevertheinterpretation,redundantexecutionassistedbypredictionsismoreeffectivethanon-demandcopying.On-demandcopyingisreactiveandincursahighlatencytostartthenon-predictedpath.Thepro-activeapproachofpassingpredictionstoalaggingthreadeventuallyre-synchronizesthethreads,often before multipath execution is needed again.