diff --git a/benchmark_after_cuda.md b/benchmark_after_cuda.md deleted file mode 100644 index 5cb959a5..00000000 --- a/benchmark_after_cuda.md +++ /dev/null @@ -1,368 +0,0 @@ -## sum, backward=False - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00110| 0.00588| 0.01085| 0.01935| 0.03480| 0.07306| 0.14795| -|**SCA1_COL**| 0.00108| 0.00612| 0.01211| 0.02271| 0.04739| 0.10304| 0.21481| -|**SCA2_ROW**| 0.00100| 0.00585| 0.01085| 0.01936| 0.03479| 0.07310| 0.14802| -|**SCA2_COL**| 0.00116| 0.00612| 0.01211| 0.02270| 0.04740| 0.10305| 0.21477| -|**SEG_CSR**| 0.00781| 0.00600| 0.00828| 0.01330| 0.02255| 0.04273| 0.08302| -|**DENSE1**| 0.00062| **0.00273**| **0.00514**| **0.01000**| **0.01954**| **0.03927**| **0.07839**| -|**DENSE2**| **0.00057**| 0.00752| 0.01489| 0.02937| 0.05311| 0.10620| 0.21238| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00094| 0.00544| 0.01013| 0.01758| 0.03414| 0.06838| 0.13869| -|**SCA1_COL**| 0.00096| 0.00580| 0.01155| 0.02266| 0.04860| 0.10546| 0.21871| -|**SCA2_ROW**| 0.00089| 0.00543| 0.01012| 0.01759| 0.03415| 0.06838| 0.13868| -|**SCA2_COL**| 0.00096| 0.00580| 0.01155| 0.02266| 0.04862| 0.10549| 0.21866| -|**SEG_CSR**| 0.00733| 0.00377| 0.00606| 0.01119| 0.02104| 0.04174| 0.08292| -|**DENSE1**| 0.00055| **0.00283**| **0.00533**| **0.01042**| **0.02051**| **0.04121**| **0.08230**| -|**DENSE2**| **0.00053**| 0.00709| 0.01404| 0.02795| 0.05577| 0.11150| 0.22291| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00878| 0.05195| 0.08276| 0.15160| 0.29473| 0.57794| **inf**| -|**SCA1_COL**| 0.00920| 0.07938| 0.12911| 0.25014| 0.49864| 1.01963| inf| -|**SCA2_ROW**| 0.00871| 0.04780| 0.08282| 0.15158| 0.29483| 0.57803| inf| -|**SCA2_COL**| 0.00920| 0.07545| 0.12914| 0.25015| 0.49871| 1.01967| inf| -|**SEG_CSR**| 0.06233| 0.02315| 0.04441| 0.08778| 0.17400| 0.34956| inf| -|**DENSE1**| 0.00310| **0.02285**| **0.04346**| **0.08536**| **0.17119**| **0.34241**| inf| -|**DENSE2**| **0.00307**| 0.03690| 0.07383| 0.14771| 0.29515| 0.59029| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.03857| 0.08816| 0.16278| 0.30480| 0.59523| **inf**| **inf**| -|**SCA1_COL**| 0.01866| 0.13881| 0.24880| 0.49032| 0.98508| inf| inf| -|**SCA2_ROW**| 0.03847| 0.08821| 0.16288| 0.30488| 0.59535| inf| inf| -|**SCA2_COL**| 0.01870| 0.13880| 0.24885| 0.49038| 0.98514| inf| inf| -|**SEG_CSR**| 0.04138| 0.04364| 0.08337| 0.16544| 0.32617| inf| inf| -|**DENSE1**| 0.00756| **0.04219**| **0.08071**| **0.15786**| **0.32207**| inf| inf| -|**DENSE2**| **0.00633**| 0.09919| 0.19836| 0.39666| 0.79332| inf| inf| - -## mean, backward=False - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00232| 0.01415| 0.02758| 0.05056| 0.09806| 0.20264| 0.41091| -|**SCA1_COL**| 0.00242| 0.01456| 0.03020| 0.05878| 0.12322| 0.26286| 0.54355| -|**SCA2_ROW**| 0.00248| 0.01716| 0.03329| 0.06246| 0.12032| 0.25055| 0.50337| -|**SCA2_COL**| 0.00358| 0.01753| 0.03596| 0.06950| 0.14386| 0.30408| 0.62580| -|**SEG_CSR**| 0.00721| 0.00625| 0.00899| 0.01501| 0.02689| 0.05102| 0.09937| -|**DENSE1**| 0.00061| **0.00272**| **0.00510**| **0.00995**| **0.01956**| **0.03929**| **0.07842**| -|**DENSE2**| **0.00051**| 0.00678| 0.01342| 0.02670| 0.05326| 0.10649| 0.21296| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00224| 0.01405| 0.02760| 0.04968| 0.09728| 0.19356| 0.39220| -|**SCA1_COL**| 0.00243| 0.01473| 0.03052| 0.05996| 0.12623| 0.26482| 0.55131| -|**SCA2_ROW**| 0.00243| 0.01707| 0.03323| 0.06033| 0.11811| 0.23515| 0.47688| -|**SCA2_COL**| 0.00360| 0.01771| 0.03631| 0.07067| 0.14685| 0.30592| 0.63345| -|**SEG_CSR**| 0.00755| 0.00435| 0.00719| 0.01341| 0.02552| 0.05044| 0.10011| -|**DENSE1**| 0.00054| **0.00284**| **0.00535**| **0.01043**| **0.02050**| **0.04118**| **0.08214**| -|**DENSE2**| **0.00053**| 0.00711| 0.01408| 0.02803| 0.05591| 0.11179| 0.22357| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.01911| 0.11605| 0.21813| 0.40815| 0.79956| inf| **inf**| -|**SCA1_COL**| 0.02006| 0.17731| 0.31089| 0.60559| 1.20721| inf| inf| -|**SCA2_ROW**| 0.02202| 0.14232| 0.26779| 0.50213| 0.98637| inf| inf| -|**SCA2_COL**| 0.03240| 0.21521| 0.36606| 0.70386| 1.39679| inf| inf| -|**SEG_CSR**| 0.05584| 0.02622| 0.04985| 0.09893| 0.19617| 0.39400| inf| -|**DENSE1**| 0.00249| **0.02286**| **0.04343**| **0.08533**| **0.17768**| **0.34995**| inf| -|**DENSE2**| **0.00245**| 0.03697| 0.07395| 0.14788| 0.29587| 0.59158| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.07927| 0.21701| 0.40750| 0.77376| inf| **inf**| **inf**| -|**SCA1_COL**| 0.03992| 0.31855| 0.57958| 1.14446| inf| inf| inf| -|**SCA2_ROW**| 0.08473| 0.26883| 0.50826| 0.98934| inf| inf| inf| -|**SCA2_COL**| 0.05657| 0.38307| 0.68999| 1.34296| inf| inf| inf| -|**SEG_CSR**| 0.03406| 0.04540| 0.08698| 0.17249| 0.34037| inf| inf| -|**DENSE1**| 0.00637| **0.04220**| **0.08071**| **0.15787**| **0.31549**| inf| inf| -|**DENSE2**| **0.00633**| 0.09930| 0.19856| 0.39734| 0.79447| inf| inf| - -## min, backward=False - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00318| 0.03379| 0.08014| 0.17392| 0.33243| 0.71169| 1.69953| -|**SCA1_COL**| 0.00514| 0.00823| 0.01559| 0.02886| 0.05673| 0.11800| 0.24044| -|**SCA2_ROW**| 0.00384| 0.04065| 0.08686| 0.18546| 0.36068| 0.76988| 1.81981| -|**SCA2_COL**| 0.00650| 0.01125| 0.02136| 0.03974| 0.07730| 0.15915| 0.32261| -|**SEG_CSR**| 0.00822| 0.01632| 0.01912| 0.02701| 0.04033| 0.06996| 0.12869| -|**DENSE1**| 0.00108| **0.00352**| **0.00646**| **0.01267**| **0.02465**| **0.04966**| **0.09897**| -|**DENSE2**| **0.00097**| 0.01384| 0.02753| 0.05493| 0.10965| 0.30231| 0.60401| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00312| 0.02521| 0.05707| 0.11955| 0.23681| 0.50597| 1.38877| -|**SCA1_COL**| 0.00478| 0.00812| 0.01550| 0.02898| 0.05724| 0.11810| 0.24223| -|**SCA2_ROW**| 0.00374| 0.03158| 0.06360| 0.13080| 0.26257| 0.55423| 1.48980| -|**SCA2_COL**| 0.00607| 0.01116| 0.02131| 0.03962| 0.07788| 0.15924| 0.32436| -|**SEG_CSR**| 0.00864| 0.00826| 0.01128| 0.01947| 0.03359| 0.06446| 0.12648| -|**DENSE1**| 0.00103| **0.00366**| **0.00674**| **0.01326**| **0.02585**| **0.05218**| **0.10400**| -|**DENSE2**| **0.00101**| 0.01452| 0.02890| 0.05764| 0.11514| 0.31709| 0.63409| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.03719| 0.21318| 0.36200| 0.68868| 1.34538| 3.04241| **inf**| -|**SCA1_COL**| 0.03030| 0.08940| 0.15244| 0.28945| 0.56434| 1.12598| inf| -|**SCA2_ROW**| 0.04381| 0.26247| 0.40852| 0.75209| 1.50440| 3.41731| inf| -|**SCA2_COL**| 0.03934| 0.12736| 0.20756| 0.38784| 0.75398| 1.50087| inf| -|**SEG_CSR**| 0.06810| 0.03796| 0.06509| 0.12553| 0.24460| 0.48779| inf| -|**DENSE1**| 0.00568| **0.02489**| **0.04995**| **0.10009**| **0.20183**| **0.40893**| inf| -|**DENSE2**| **0.00565**| 0.07459| 0.20621| 0.41239| 0.82474| 1.64938| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.17363| 0.85304| 1.80010| 3.61245| 7.75350| **inf**| **inf**| -|**SCA1_COL**| 0.05308| 0.17072| 0.29914| 0.57243| 1.12134| inf| inf| -|**SCA2_ROW**| 0.16287| 1.02983| 1.98873| 3.95534| 8.45721| inf| inf| -|**SCA2_COL**| 0.07248| 0.23536| 0.40952| 0.77109| 1.50457| inf| inf| -|**SEG_CSR**| 0.04402| 0.07476| 0.11573| 0.22217| 0.43097| inf| inf| -|**DENSE1**| 0.01415| **0.04610**| **0.08827**| **0.17337**| **0.34693**| inf| inf| -|**DENSE2**| **0.01412**| 0.29638| 0.59272| 1.18533| 2.37087| inf| inf| - -## max, backward=False - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00322| 0.03391| 0.08020| 0.17427| 0.33190| 0.71418| 1.69869| -|**SCA1_COL**| 0.00514| 0.00820| 0.01557| 0.02888| 0.05667| 0.11790| 0.24038| -|**SCA2_ROW**| 0.00384| 0.04032| 0.08635| 0.18684| 0.35902| 0.77115| 1.81673| -|**SCA2_COL**| 0.00650| 0.01120| 0.02134| 0.03956| 0.07733| 0.15907| 0.32260| -|**SEG_CSR**| 0.00822| 0.00516| 0.00790| 0.01393| 0.02581| 0.05032| 0.09964| -|**DENSE1**| 0.00110| **0.00351**| **0.00645**| **0.01263**| **0.02463**| **0.04964**| **0.09901**| -|**DENSE2**| **0.00097**| 0.01384| 0.02752| 0.05490| 0.10963| 0.30203| 0.60399| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00309| 0.02529| 0.05705| 0.11873| 0.23529| 0.50457| 1.39490| -|**SCA1_COL**| 0.00477| 0.00813| 0.01552| 0.02888| 0.05723| 0.11817| 0.24211| -|**SCA2_ROW**| 0.00377| 0.03162| 0.06361| 0.12996| 0.26066| 0.55240| 1.49604| -|**SCA2_COL**| 0.00608| 0.01113| 0.02133| 0.03962| 0.07790| 0.15920| 0.32426| -|**SEG_CSR**| 0.00862| 0.00424| 0.00698| 0.01332| **0.02544**| **0.05053**| **0.10069**| -|**DENSE1**| 0.00103| **0.00366**| **0.00675**| **0.01325**| 0.02587| 0.05218| 0.10395| -|**DENSE2**| **0.00101**| 0.01452| 0.02889| 0.05764| 0.11511| 0.31711| 0.63406| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.03721| 0.20818| 0.36200| 0.68848| 1.34571| 3.04280| **inf**| -|**SCA1_COL**| 0.03037| 0.08941| 0.15241| 0.28942| 0.56430| 1.12582| inf| -|**SCA2_ROW**| 0.04174| 0.26252| 0.40823| 0.75182| 1.50414| 3.41565| inf| -|**SCA2_COL**| 0.03369| 0.12728| 0.20759| 0.38784| 0.75387| 1.50070| inf| -|**SEG_CSR**| 0.06030| 0.02728| 0.05091| 0.10045| **0.19841**| **0.39893**| inf| -|**DENSE1**| 0.00490| **0.02489**| **0.04997**| **0.10006**| 0.20186| 0.41342| inf| -|**DENSE2**| **0.00486**| 0.07458| 0.20620| 0.41227| 0.82474| 1.64850| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.15764| 0.85176| 1.79899| 3.61350| 7.74847| **inf**| **inf**| -|**SCA1_COL**| 0.05312| 0.17076| 0.29913| 0.57243| 1.12143| inf| inf| -|**SCA2_ROW**| 0.16301| 1.02865| 1.98746| 3.95586| 8.45005| inf| inf| -|**SCA2_COL**| 0.07255| 0.23536| 0.40956| 0.77106| 1.50457| inf| inf| -|**SEG_CSR**| 0.04157| **0.04425**| **0.08635**| **0.17148**| **0.34060**| inf| inf| -|**DENSE1**| 0.01414| 0.04604| 0.08824| 0.17339| 0.34948| inf| inf| -|**DENSE2**| **0.01412**| 0.29623| 0.59243| 1.18467| 2.36927| inf| inf| - -## sum, backward=True - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00286| 0.01043| 0.01912| 0.03313| 0.06254| 0.13251| 0.28310| -|**SCA1_COL**| 0.00202| 0.01182| 0.02315| 0.04349| 0.08994| 0.19076| 0.39327| -|**SCA2_ROW**| 0.00322| 0.01042| 0.01923| 0.03316| 0.06264| 0.13259| 0.28318| -|**SCA2_COL**| 0.00200| 0.01181| 0.02314| 0.04348| 0.08999| 0.19078| 0.39332| -|**SEG_CSR**| 0.00927| 0.01161| 0.01814| 0.03201| 0.05945| 0.11526| 0.22728| -|**DENSE1**| 0.00118| **0.00274**| **0.00512**| **0.00996**| **0.01955**| **0.03931**| **0.07841**| -|**DENSE2**| **0.00094**| 0.00677| 0.01340| 0.02665| 0.05314| 0.10629| 0.21234| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00238| 0.01040| 0.01910| 0.03265| 0.06206| 0.12767| 0.27420| -|**SCA1_COL**| 0.00204| 0.01197| 0.02327| 0.04412| 0.09180| 0.19151| 0.39848| -|**SCA2_ROW**| 0.00201| 0.01040| 0.01915| 0.03269| 0.06216| 0.12776| 0.27424| -|**SCA2_COL**| 0.00199| 0.01194| 0.02326| 0.04417| 0.09183| 0.19152| 0.39852| -|**SEG_CSR**| 0.00922| 0.00945| 0.01610| 0.03028| 0.05797| 0.11438| 0.22605| -|**DENSE1**| 0.00134| **0.00284**| **0.00535**| **0.01043**| **0.02051**| **0.04118**| **0.08228**| -|**DENSE2**| **0.00097**| 0.00710| 0.01404| 0.02796| 0.05577| 0.11150| 0.22298| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.01323| 0.09439| 0.15191| 0.27534| 0.53432| inf| **inf**| -|**SCA1_COL**| 0.01616| 0.13818| 0.23711| 0.45437| 0.89758| inf| inf| -|**SCA2_ROW**| 0.01318| 0.08611| 0.15197| 0.27539| 0.53451| inf| inf| -|**SCA2_COL**| 0.01615| 0.13819| 0.23711| 0.45440| 0.89766| inf| inf| -|**SEG_CSR**| 0.07444| 0.06406| 0.12482| 0.24673| 0.49066| inf| inf| -|**DENSE1**| 0.00318| **0.02287**| **0.04345**| **0.08534**| **0.17122**| **0.34386**| inf| -|**DENSE2**| **0.00308**| 0.03694| 0.07382| 0.14760| 0.29508| 0.59012| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.04650| 0.16195| 0.29072| 0.53369| inf| **inf**| **inf**| -|**SCA1_COL**| 0.03227| 0.25778| 0.45697| 0.88471| inf| inf| inf| -|**SCA2_ROW**| 0.04649| 0.16199| 0.29083| 0.53384| inf| inf| inf| -|**SCA2_COL**| 0.03224| 0.25778| 0.45701| 0.88474| inf| inf| inf| -|**SEG_CSR**| 0.07453| 0.12043| 0.23661| 0.46801| inf| inf| inf| -|**DENSE1**| 0.00638| **0.04222**| **0.08070**| **0.15789**| **0.32434**| inf| inf| -|**DENSE2**| **0.00634**| 0.09922| 0.19832| 0.39657| 0.79287| inf| inf| - -## mean, backward=True - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00540| 0.03956| 0.07587| 0.13891| 0.26873| 0.55598| 1.14763| -|**SCA1_COL**| 0.00588| 0.04242| 0.08504| 0.16379| 0.33646| 0.70273| 1.43595| -|**SCA2_ROW**| 0.00579| 0.04629| 0.08856| 0.16476| 0.31777| 0.66030| 1.34676| -|**SCA2_COL**| 0.00848| 0.04893| 0.09779| 0.18736| 0.38194| 0.79331| 1.61672| -|**SEG_CSR**| 0.00946| 0.01309| 0.02246| 0.04136| 0.07852| 0.15359| 0.30405| -|**DENSE1**| 0.00154| **0.00587**| **0.01091**| **0.02099**| **0.04116**| **0.09255**| **0.18668**| -|**DENSE2**| **0.00118**| 0.00978| 0.01935| 0.03845| 0.07662| 0.15346| 0.30685| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00524| 0.03965| 0.07617| 0.13793| 0.26822| 0.54477| 1.12739| -|**SCA1_COL**| 0.00580| 0.04298| 0.08599| 0.16629| 0.34244| 0.71293| 1.45630| -|**SCA2_ROW**| 0.00575| 0.04645| 0.08873| 0.16152| 0.31437| 0.63890| 1.31550| -|**SCA2_COL**| 0.00829| 0.04957| 0.09881| 0.18996| 0.38816| 0.80402| 1.63797| -|**SEG_CSR**| 0.00995| 0.01126| 0.02085| 0.04003| 0.07780| 0.15418| **0.30644**| -|**DENSE1**| 0.00172| **0.00611**| **0.01143**| **0.02201**| **0.04320**| **0.09712**| 0.66614| -|**DENSE2**| **0.00122**| 0.01027| 0.02030| 0.04034| 0.08046| 0.16109| 0.32241| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.04234| 0.32879| 0.60987| 1.14896| inf| **inf**| **inf**| -|**SCA1_COL**| 0.04861| 0.46374| 0.82678| 1.60537| inf| inf| inf| -|**SCA2_ROW**| 0.04855| 0.38430| 0.71519| 1.34857| inf| inf| inf| -|**SCA2_COL**| 0.07366| 0.54254| 0.94299| 1.81341| inf| inf| inf| -|**SEG_CSR**| 0.06480| 0.07851| 0.15177| 0.30117| 0.60680| inf| inf| -|**DENSE1**| 0.00424| **0.04836**| **0.09289**| **0.18244**| **0.37492**| inf| inf| -|**DENSE2**| **0.00413**| 0.06191| 0.12363| 0.24758| 0.49523| inf| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.14401| 0.61386| 1.14721| inf| **inf**| **inf**| **inf**| -|**SCA1_COL**| 0.09054| 0.85608| 1.56567| inf| inf| inf| inf| -|**SCA2_ROW**| 0.13297| 0.71932| 1.35238| inf| inf| inf| inf| -|**SCA2_COL**| 0.11625| 0.98704| 1.79015| inf| inf| inf| inf| -|**SEG_CSR**| 0.06324| 0.13121| 0.25712| 0.51952| inf| inf| inf| -|**DENSE1**| 0.00922| **0.08864**| **0.17238**| **0.35913**| inf| inf| inf| -|**DENSE2**| **0.00918**| 0.14295| 0.28590| 0.57169| inf| inf| inf| - -## min, backward=True - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00765| 0.07106| 0.15221| 0.31048| 0.59100| 1.24425| 2.73877| -|**SCA1_COL**| 0.00971| 0.04814| 0.09315| 0.17818| 0.35722| 0.73203| 1.48116| -|**SCA2_ROW**| 0.00841| 0.08152| 0.16575| 0.33612| 0.64548| 1.35968| 2.96977| -|**SCA2_COL**| 0.01236| 0.05463| 0.10581| 0.20180| 0.40274| 0.82281| 1.66203| -|**SEG_CSR**| 0.01316| 0.04607| 0.05930| 0.09290| 0.14939| 0.26560| 0.51035| -|**DENSE1**| 0.00178| **0.00944**| **0.01805**| **0.03568**| **0.07010**| **0.14263**| **0.49876**| -|**DENSE2**| **0.00139**| 0.02029| 0.04032| 0.08034| 0.16009| 0.40308| 0.80778| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00753| 0.06292| 0.12867| 0.25061| 0.49432| 1.04952| 2.47662| -|**SCA1_COL**| 0.00940| 0.04848| 0.09380| 0.17981| 0.36110| 0.73840| 1.49534| -|**SCA2_ROW**| 0.00831| 0.07294| 0.14173| 0.27439| 0.54460| 1.14948| 2.68909| -|**SCA2_COL**| 0.01197| 0.05498| 0.10655| 0.20343| 0.40684| 0.82937| 1.67700| -|**SEG_CSR**| 0.01120| 0.03000| 0.04426| 0.07945| 0.13904| 0.26017| 0.51455| -|**DENSE1**| 0.00155| **0.00985**| **0.01887**| **0.03721**| **0.07360**| **0.14956**| **0.30227**| -|**DENSE2**| **0.00142**| 0.02129| 0.04224| 0.08423| 0.16810| 0.42316| 0.84625| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.06757| 0.51597| 0.94471| 1.81101| inf| **inf**| **inf**| -|**SCA1_COL**| 0.06613| 0.47110| 0.85902| 1.67105| inf| inf| inf| -|**SCA2_ROW**| 0.07460| 0.59993| 1.04658| 1.97962| inf| inf| inf| -|**SCA2_COL**| 0.07352| 0.54973| 0.97516| 1.87916| inf| inf| inf| -|**SEG_CSR**| 0.06638| 0.14827| 0.26664| 0.52100| 1.52409| inf| inf| -|**DENSE1**| 0.00791| **0.07010**| **0.13996**| **0.28220**| **1.17779**| inf| inf| -|**DENSE2**| **0.00786**| 0.12191| 0.30085| 0.60156| 1.20278| inf| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.24134| 1.43410| 2.91067| inf| **inf**| **inf**| **inf**| -|**SCA1_COL**| 0.11074| 0.89373| 1.65614| inf| inf| inf| inf| -|**SCA2_ROW**| 0.23734| 1.66433| 3.20359| inf| inf| inf| inf| -|**SCA2_COL**| 0.14980| 1.02477| 1.88063| inf| inf| inf| inf| -|**SEG_CSR**| 0.05450| 0.25664| 0.44328| 0.86298| inf| inf| inf| -|**DENSE1**| 0.01904| **0.11569**| **0.22693**| **0.46899**| inf| inf| inf| -|**DENSE2**| **0.01903**| 0.37306| 0.74630| 1.49233| inf| inf| inf| - -## max, backward=True - -**DIMACS10/citationCiteseer** (avg row length: 8.62): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00765| 0.07148| 0.15241| 0.30967| 0.59106| 1.24380| 2.73550| -|**SCA1_COL**| 0.00977| 0.04815| 0.09316| 0.17818| 0.35731| 0.73195| 1.48138| -|**SCA2_ROW**| 0.00833| 0.08160| 0.16613| 0.33639| 0.64592| 1.35866| 2.96562| -|**SCA2_COL**| 0.01240| 0.05463| 0.10580| 0.20173| 0.40274| 0.82270| 1.66211| -|**SEG_CSR**| 0.01318| 0.03482| 0.04828| 0.07984| 0.13464| 0.24586| **0.48113**| -|**DENSE1**| 0.00222| **0.00934**| **0.01800**| **0.03562**| **0.07002**| **0.14267**| 0.49659| -|**DENSE2**| **0.00144**| 0.02028| 0.04027| 0.08032| 0.16005| 0.40324| 0.80801| - -**SNAP/web-Stanford** (avg row length: 8.20): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.00750| 0.06307| 0.12870| 0.25055| 0.49469| 1.05014| 2.47402| -|**SCA1_COL**| 0.00939| 0.04843| 0.09382| 0.17980| 0.36105| 0.73840| 1.49567| -|**SCA2_ROW**| 0.00829| 0.07301| 0.14194| 0.27451| 0.54474| 1.14885| 2.68654| -|**SCA2_COL**| 0.01198| 0.05504| 0.10654| 0.20345| 0.40680| 0.82942| 1.67726| -|**SEG_CSR**| 0.01120| 0.02612| 0.03999| 0.07325| 0.13080| 0.24632| 0.48903| -|**DENSE1**| 0.00184| **0.00984**| **0.01883**| **0.03721**| **0.07349**| **0.14958**| **0.30217**| -|**DENSE2**| **0.00138**| 0.02129| 0.04229| 0.08419| 0.16802| 0.42316| 0.84617| - -**Janna/StocF-1465** (avg row length: 14.34): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.06759| 0.51606| 0.94457| 1.81107| inf| **inf**| **inf**| -|**SCA1_COL**| 0.06615| 0.47105| 0.85906| 1.67103| inf| inf| inf| -|**SCA2_ROW**| 0.07131| 0.59995| 1.04638| 1.97970| inf| inf| inf| -|**SCA2_COL**| 0.07324| 0.54975| 0.97519| 1.87910| inf| inf| inf| -|**SEG_CSR**| 0.06647| 0.13758| 0.25232| 0.49576| 1.47707| inf| inf| -|**DENSE1**| 0.00793| **0.06982**| **0.13994**| **0.28189**| **1.16653**| inf| inf| -|**DENSE2**| **0.00790**| 0.12188| 0.30100| 0.60154| 1.20260| inf| inf| - -**GHS_psdef/ldoor** (avg row length: 44.63): -| | 1| 16| 32| 64| 128| 256| 512| -|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| -|**SCA1_ROW**| 0.23854| 1.43468| 2.91056| inf| **inf**| **inf**| **inf**| -|**SCA1_COL**| 0.11398| 0.89365| 1.65617| inf| inf| inf| inf| -|**SCA2_ROW**| 0.23762| 1.66377| 3.20615| inf| inf| inf| inf| -|**SCA2_COL**| 0.14982| 1.02472| 1.88074| inf| inf| inf| inf| -|**SEG_CSR**| 0.05450| 0.22603| 0.41379| 0.81105| inf| inf| inf| -|**DENSE1**| 0.01905| **0.11564**| **0.22684**| **0.46919**| inf| inf| inf| -|**DENSE2**| **0.01902**| 0.37309| 0.74603| 1.49170| inf| inf| inf| - diff --git a/benchmark_after_cuda.npy b/benchmark_after_cuda.npy deleted file mode 100644 index 08c8a966..00000000 Binary files a/benchmark_after_cuda.npy and /dev/null differ diff --git a/benchmark_after_cuda_index.md b/benchmark_after_cuda_index.md new file mode 100644 index 00000000..fcc48bd5 --- /dev/null +++ b/benchmark_after_cuda_index.md @@ -0,0 +1,368 @@ +## sum, backward=False + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00127| 0.00724| 0.01040| 0.01847| 0.03480| 0.07304| 0.14785| +|**SCA1_COL**| 0.00108| 0.00587| 0.01164| 0.02234| 0.04741| 0.10291| 0.21477| +|**SCA2_ROW**| 0.00118| 0.01063| 0.02035| 0.03900| 0.07524| 0.14866| 0.30178| +|**SCA2_COL**| 0.00108| 0.01094| 0.02167| 0.04180| 0.08241| 0.16557| 0.34200| +|**SEG_CSR**| 0.00721| 0.00582| 0.00805| 0.01294| 0.02256| 0.04275| 0.08303| +|**DENSE1**| 0.00059| **0.00273**| **0.00513**| **0.00995**| **0.01955**| **0.03928**| **0.07841**| +|**DENSE2**| **0.00053**| 0.00697| 0.01380| 0.02661| 0.05308| 0.10623| 0.21500| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00111| 0.00545| 0.01014| 0.01757| 0.03412| 0.06838| 0.13859| +|**SCA1_COL**| 0.00106| 0.00581| 0.01157| 0.02265| 0.04860| 0.10549| 0.21859| +|**SCA2_ROW**| 0.00108| 0.01038| 0.01991| 0.03870| 0.07541| 0.14905| 0.30373| +|**SCA2_COL**| 0.00106| 0.01073| 0.02128| 0.04200| 0.08277| 0.16597| 0.34411| +|**SEG_CSR**| 0.00732| 0.00379| 0.00608| 0.01120| 0.02108| 0.04178| 0.08290| +|**DENSE1**| 0.00055| **0.00282**| **0.00534**| **0.01043**| **0.02051**| **0.04122**| **0.08228**| +|**DENSE2**| **0.00053**| 0.00709| 0.01405| 0.02795| 0.05577| 0.11149| 0.22289| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.01038| 0.04664| 0.08265| 0.15158| 0.29468| 0.57781| **inf**| +|**SCA1_COL**| 0.00988| 0.07543| 0.12908| 0.25014| 0.49861| 1.01973| inf| +|**SCA2_ROW**| 0.01027| 0.09049| 0.17562| 0.34531| 0.93268| 2.01673| inf| +|**SCA2_COL**| 0.00987| 0.10923| 0.20165| 0.39199| 0.99477| 2.12157| inf| +|**SEG_CSR**| 0.06226| 0.02313| 0.04441| 0.08781| 0.17394| 0.34959| inf| +|**DENSE1**| 0.00313| **0.02286**| **0.04343**| **0.08536**| **0.17121**| **0.34247**| inf| +|**DENSE2**| **0.00307**| 0.03690| 0.07380| 0.14761| 0.29503| 0.59027| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.02732| 0.09339| 0.16275| 0.30472| 0.59525| **inf**| **inf**| +|**SCA1_COL**| 0.01968| 0.13879| 0.24882| 0.49024| 0.98520| inf| inf| +|**SCA2_ROW**| 0.02742| 0.17867| 0.34748| 0.93574| 1.99605| inf| inf| +|**SCA2_COL**| 0.01968| 0.21438| 0.40352| 1.00679| 2.11451| inf| inf| +|**SEG_CSR**| 0.04124| 0.04366| 0.08340| 0.16542| 0.32633| inf| inf| +|**DENSE1**| 0.00811| **0.04221**| **0.08069**| **0.15790**| **0.32190**| inf| inf| +|**DENSE2**| **0.00808**| 0.09920| 0.19946| 0.39658| 0.79295| inf| inf| + +## mean, backward=False + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00292| 0.01413| 0.02759| 0.05059| 0.09797| 0.20257| 0.41122| +|**SCA1_COL**| 0.00256| 0.01457| 0.03018| 0.05881| 0.12330| 0.26310| 0.54378| +|**SCA2_ROW**| 0.00314| 0.02716| 0.05337| 0.10471| 0.20404| 0.40741| 0.82409| +|**SCA2_COL**| 0.00378| 0.02775| 0.05610| 0.11016| 0.21727| 0.43564| 0.89395| +|**SEG_CSR**| 0.00721| 0.00626| 0.00903| 0.01501| 0.02686| 0.05104| 0.09937| +|**DENSE1**| 0.00061| **0.00272**| **0.00512**| **0.00995**| **0.01955**| **0.03929**| **0.07840**| +|**DENSE2**| **0.00051**| 0.00678| 0.01342| 0.02670| 0.05326| 0.10650| 0.21295| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00280| 0.01406| 0.02761| 0.04967| 0.09728| 0.19358| 0.39207| +|**SCA1_COL**| 0.00265| 0.01476| 0.03050| 0.05994| 0.12634| 0.26491| 0.55116| +|**SCA2_ROW**| 0.00304| 0.02726| 0.05332| 0.10399| 0.20383| 0.40379| 0.82036| +|**SCA2_COL**| 0.00383| 0.02802| 0.05632| 0.11085| 0.21893| 0.43678| 0.89562| +|**SEG_CSR**| 0.00755| 0.00436| 0.00717| 0.01344| 0.02554| 0.05040| 0.10021| +|**DENSE1**| 0.00055| **0.00284**| **0.00534**| **0.01043**| **0.02050**| **0.04117**| **0.08218**| +|**DENSE2**| **0.00053**| 0.00711| 0.01407| 0.02802| 0.05591| 0.11180| 0.22356| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.02249| 0.11607| 0.21808| 0.40817| 0.79944| inf| **inf**| +|**SCA1_COL**| 0.02166| 0.17732| 0.31090| 0.60557| 1.20724| inf| inf| +|**SCA2_ROW**| 0.02544| 0.23552| 0.45927| 0.90410| 2.29395| inf| inf| +|**SCA2_COL**| 0.03392| 0.28312| 0.51485| 1.00021| 2.41976| inf| inf| +|**SEG_CSR**| 0.05534| 0.02627| 0.04987| 0.09889| 0.19610| 0.39397| inf| +|**DENSE1**| 0.00249| **0.02287**| **0.04343**| **0.08534**| **0.17869**| **0.35000**| inf| +|**DENSE2**| **0.00245**| 0.03698| 0.07397| 0.14790| 0.29590| 0.59133| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.05741| 0.21710| 0.40755| 0.77377| inf| **inf**| **inf**| +|**SCA1_COL**| 0.04221| 0.31866| 0.57948| 1.14422| inf| inf| inf| +|**SCA2_ROW**| 0.06299| 0.45453| 0.88750| 2.27212| inf| inf| inf| +|**SCA2_COL**| 0.05859| 0.53556| 1.00387| 2.40081| inf| inf| inf| +|**SEG_CSR**| 0.03404| 0.04539| 0.08697| 0.17254| 0.34035| inf| inf| +|**DENSE1**| 0.00636| **0.04221**| **0.08071**| **0.15789**| **0.31510**| inf| inf| +|**DENSE2**| **0.00634**| 0.09930| 0.19856| 0.39700| 0.79380| inf| inf| + +## min, backward=False + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00372| 0.03383| 0.07989| 0.17097| 0.32949| 0.71268| 1.70445| +|**SCA1_COL**| 0.00530| 0.00819| 0.01556| 0.02884| 0.05691| 0.11791| 0.24051| +|**SCA2_ROW**| 0.00439| 0.04514| 0.09402| 0.17775| 0.30970| 0.57108| 1.11626| +|**SCA2_COL**| 0.00660| 0.01978| 0.03747| 0.07327| 0.14560| 0.29588| 0.60124| +|**SEG_CSR**| 0.00822| 0.01631| 0.01898| 0.02681| 0.04042| 0.06986| 0.12871| +|**DENSE1**| 0.00109| **0.00355**| **0.00646**| **0.01265**| **0.02467**| **0.04965**| **0.09903**| +|**DENSE2**| **0.00097**| 0.01384| 0.02751| 0.05489| 0.10961| 0.30193| 0.60380| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00353| 0.02517| 0.05700| 0.11884| 0.23460| 0.50666| 1.39541| +|**SCA1_COL**| 0.00523| 0.00812| 0.01553| 0.02888| 0.05720| 0.11804| 0.24224| +|**SCA2_ROW**| 0.00415| 0.03354| 0.07837| 0.15168| 0.28767| 0.57393| 1.07267| +|**SCA2_COL**| 0.00652| 0.01929| 0.03696| 0.07273| 0.14462| 0.29505| 0.59287| +|**SEG_CSR**| 0.00863| 0.00827| 0.01124| 0.01941| 0.03363| 0.06445| 0.12650| +|**DENSE1**| 0.00104| **0.00369**| **0.00676**| **0.01325**| **0.02586**| **0.05218**| **0.10393**| +|**DENSE2**| **0.00101**| 0.01452| 0.02888| 0.05761| 0.11511| 0.31700| 0.63394| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.03609| 0.20774| 0.36167| 0.68834| 1.34545| 3.04293| **inf**| +|**SCA1_COL**| 0.03267| 0.08947| 0.15238| 0.28943| 0.56441| 1.12595| inf| +|**SCA2_ROW**| 0.04009| 0.26911| 0.62420| 1.25542| 2.53326| 5.04008| inf| +|**SCA2_COL**| 0.04513| 0.19330| 0.34249| 0.66847| 1.48314| 3.07073| inf| +|**SEG_CSR**| 0.06164| 0.03807| 0.06510| 0.12546| 0.24469| 0.48781| inf| +|**DENSE1**| 0.00484| **0.02491**| **0.04997**| **0.10010**| **0.20187**| **0.40960**| inf| +|**DENSE2**| **0.00481**| 0.07462| 0.20624| 0.41245| 0.82462| 1.64937| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.09931| 0.85160| 1.80004| 3.61275| 7.75329| **inf**| **inf**| +|**SCA1_COL**| 0.07357| 0.17071| 0.29911| 0.57245| 1.12151| inf| inf| +|**SCA2_ROW**| 0.09108| 0.68627| 1.39397| 2.65124| 5.24729| inf| inf| +|**SCA2_COL**| 0.07690| 0.39631| 0.71627| 1.52913| 3.12993| inf| inf| +|**SEG_CSR**| 0.04158| 0.07477| 0.11572| 0.22220| 0.43095| inf| inf| +|**DENSE1**| 0.01415| **0.04607**| **0.08826**| **0.17337**| **0.34944**| inf| inf| +|**DENSE2**| **0.01411**| 0.29633| 0.59246| 1.18521| 2.37084| inf| inf| + +## max, backward=False + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00371| 0.03457| 0.07980| 0.17336| 0.33335| 0.71227| 1.70237| +|**SCA1_COL**| 0.00527| 0.00820| 0.01557| 0.02884| 0.05665| 0.11795| 0.24043| +|**SCA2_ROW**| 0.00437| 0.04202| 0.10077| 0.17632| 0.31042| 0.58281| 1.11431| +|**SCA2_COL**| 0.00658| 0.01984| 0.03732| 0.07337| 0.14574| 0.29552| 0.60163| +|**SEG_CSR**| 0.00822| 0.00514| 0.00795| 0.01396| 0.02583| 0.05032| 0.09963| +|**DENSE1**| 0.00108| **0.00351**| **0.00645**| **0.01265**| **0.02465**| **0.04963**| **0.09896**| +|**DENSE2**| **0.00097**| 0.01383| 0.02753| 0.05490| 0.10966| 0.30207| 0.60388| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00351| 0.02518| 0.05706| 0.11859| 0.23504| 0.50630| 1.38951| +|**SCA1_COL**| 0.00522| 0.00816| 0.01551| 0.02889| 0.05725| 0.11811| 0.24220| +|**SCA2_ROW**| 0.00416| 0.03326| 0.07673| 0.14954| 0.28799| 0.56037| 1.06043| +|**SCA2_COL**| 0.00651| 0.01930| 0.03692| 0.07282| 0.14426| 0.29384| 0.59290| +|**SEG_CSR**| 0.00863| 0.00425| 0.00702| 0.01330| **0.02544**| **0.05054**| **0.10068**| +|**DENSE1**| 0.00104| **0.00365**| **0.00676**| **0.01324**| 0.02585| 0.05218| 0.10398| +|**DENSE2**| **0.00102**| 0.01453| 0.02889| 0.05764| 0.11512| 0.31713| 0.63423| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.03575| 0.21292| 0.36175| 0.68883| 1.34581| 3.04269| **inf**| +|**SCA1_COL**| 0.03269| 0.08940| 0.15239| 0.28938| 0.56433| 1.12581| inf| +|**SCA2_ROW**| 0.03810| 0.27089| 0.62445| 1.24935| 2.55054| 5.05718| inf| +|**SCA2_COL**| 0.04262| 0.19314| 0.34273| 0.66740| 1.48159| 3.06852| inf| +|**SEG_CSR**| 0.06964| 0.02725| 0.05092| 0.10042| **0.19846**| **0.39896**| inf| +|**DENSE1**| 0.00582| **0.02489**| **0.04998**| **0.10007**| 0.20182| 0.40776| inf| +|**DENSE2**| **0.00579**| 0.07475| 0.20621| 0.41238| 0.82472| 1.64940| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.09810| 0.85276| 1.79866| 3.61314| 7.75439| **inf**| **inf**| +|**SCA1_COL**| 0.07350| 0.17079| 0.29922| 0.57240| 1.12150| inf| inf| +|**SCA2_ROW**| 0.09495| 0.66375| 1.39291| 2.64954| 5.22501| inf| inf| +|**SCA2_COL**| 0.07684| 0.39567| 0.71722| 1.52847| 3.12236| inf| inf| +|**SEG_CSR**| 0.04160| **0.04427**| **0.08637**| **0.17152**| **0.34062**| inf| inf| +|**DENSE1**| 0.01415| 0.04605| 0.08827| 0.17344| 0.34702| inf| inf| +|**DENSE2**| **0.01413**| 0.29637| 0.59274| 1.18536| 2.37043| inf| inf| + +## sum, backward=True + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.01882| 0.01048| 0.01915| 0.03310| 0.06251| 0.13246| 0.28331| +|**SCA1_COL**| 0.00182| 0.01185| 0.02308| 0.04348| 0.08995| 0.19082| 0.39335| +|**SCA2_ROW**| 0.00185| 0.02045| 0.03919| 0.07538| 0.14654| 0.28871| 0.59849| +|**SCA2_COL**| 0.00181| 0.02127| 0.04135| 0.08123| 0.15975| 0.32267| 0.66253| +|**SEG_CSR**| 0.00928| 0.01163| 0.01810| 0.03204| 0.05948| 0.11523| 0.22733| +|**DENSE1**| 0.00129| **0.00278**| **0.00510**| **0.00996**| **0.01956**| **0.03931**| **0.07843**| +|**DENSE2**| **0.00093**| 0.00677| 0.01340| 0.02663| 0.05313| 0.10625| 0.21241| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00204| 0.01043| 0.01916| 0.03267| 0.06206| 0.12768| 0.27419| +|**SCA1_COL**| 0.00187| 0.01195| 0.02327| 0.04417| 0.09183| 0.19142| 0.39814| +|**SCA2_ROW**| 0.00178| 0.02047| 0.03914| 0.07545| 0.14692| 0.28995| 0.59788| +|**SCA2_COL**| 0.00187| 0.02132| 0.04144| 0.08154| 0.16043| 0.32249| 0.66545| +|**SEG_CSR**| 0.00924| 0.00950| 0.01615| 0.03030| 0.05800| 0.11446| 0.22604| +|**DENSE1**| 0.00133| **0.00284**| **0.00534**| **0.01044**| **0.02053**| **0.04118**| **0.08228**| +|**DENSE2**| **0.00095**| 0.00710| 0.01405| 0.02797| 0.05577| 0.11151| 0.22298| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.01715| 0.09516| 0.15191| 0.27549| 0.53439| inf| **inf**| +|**SCA1_COL**| 0.01780| 0.13815| 0.23708| 0.45431| 0.89760| inf| inf| +|**SCA2_ROW**| 0.01714| 0.18095| 0.34869| 0.67877| 1.83237| inf| inf| +|**SCA2_COL**| 0.01780| 0.21029| 0.39164| 0.76347| 1.97096| inf| inf| +|**SEG_CSR**| 0.07452| 0.06404| 0.12482| 0.24670| 0.49062| inf| inf| +|**DENSE1**| 0.00318| **0.02287**| **0.04344**| **0.08534**| **0.17117**| **0.34393**| inf| +|**DENSE2**| **0.00308**| 0.03691| 0.07382| 0.14760| 0.29517| 0.59046| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.04050| 0.16200| 0.29073| 0.53375| inf| **inf**| **inf**| +|**SCA1_COL**| 0.03551| 0.25777| 0.45696| 0.88461| inf| inf| inf| +|**SCA2_ROW**| 0.04037| 0.35779| 0.69329| 1.84012| inf| inf| inf| +|**SCA2_COL**| 0.03553| 0.41716| 0.78621| 2.00115| inf| inf| inf| +|**SEG_CSR**| 0.08123| 0.12036| 0.23681| 0.46831| inf| inf| inf| +|**DENSE1**| 0.00638| **0.04223**| **0.08071**| **0.15789**| **0.32439**| inf| inf| +|**DENSE2**| **0.00633**| 0.09920| 0.19834| 0.39663| 0.79322| inf| inf| + +## mean, backward=True + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00674| 0.03962| 0.07591| 0.13891| 0.26880| 0.55576| 1.14758| +|**SCA1_COL**| 0.00624| 0.04247| 0.08512| 0.16385| 0.33641| 0.70280| 1.43626| +|**SCA2_ROW**| 0.00729| 0.07260| 0.14202| 0.27688| 0.54054| 1.07618| 2.18764| +|**SCA2_COL**| 0.00885| 0.07433| 0.14772| 0.29006| 0.57178| 1.15109| 2.34357| +|**SEG_CSR**| 0.00951| 0.01314| 0.02251| 0.04140| 0.07855| 0.15355| 0.30412| +|**DENSE1**| 0.00169| **0.00587**| **0.01092**| **0.02098**| **0.04117**| **0.09255**| **0.18670**| +|**DENSE2**| **0.00119**| 0.00980| 0.01935| 0.03844| 0.07663| 0.15345| 0.30685| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00649| 0.03965| 0.07622| 0.13800| 0.26826| 0.54474| 1.12739| +|**SCA1_COL**| 0.00615| 0.04295| 0.08603| 0.16632| 0.34261| 0.71280| 1.45600| +|**SCA2_ROW**| 0.00709| 0.07289| 0.14237| 0.27607| 0.54071| 1.07245| 2.18516| +|**SCA2_COL**| 0.00873| 0.07489| 0.14867| 0.29186| 0.57513| 1.15655| 2.36022| +|**SEG_CSR**| 0.00997| 0.01132| 0.02087| 0.04002| 0.07782| 0.15420| **0.30647**| +|**DENSE1**| 0.00161| **0.00613**| **0.01143**| **0.02200**| **0.04318**| **0.09720**| 0.66931| +|**DENSE2**| **0.00120**| 0.01027| 0.02030| 0.04034| 0.08043| 0.16114| 0.32245| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.05265| 0.32883| 0.60995| 1.14906| inf| **inf**| **inf**| +|**SCA1_COL**| 0.05270| 0.46375| 0.82683| 1.60533| inf| inf| inf| +|**SCA2_ROW**| 0.05085| 0.62981| 1.22411| 2.39647| inf| inf| inf| +|**SCA2_COL**| 0.06375| 0.72703| 1.34407| 2.62124| inf| inf| inf| +|**SEG_CSR**| 0.06204| 0.07852| 0.15176| 0.30120| 0.60680| inf| inf| +|**DENSE1**| 0.00419| **0.04838**| **0.09287**| **0.18246**| **0.37647**| inf| inf| +|**DENSE2**| **0.00414**| 0.06195| 0.12360| 0.24759| 0.49527| inf| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.12109| 0.61369| 1.14724| inf| **inf**| **inf**| **inf**| +|**SCA1_COL**| 0.08857| 0.85609| 1.56570| inf| inf| inf| inf| +|**SCA2_ROW**| 0.11422| 1.21549| 2.36800| inf| inf| inf| inf| +|**SCA2_COL**| 0.12491| 1.38752| 2.62269| inf| inf| inf| inf| +|**SEG_CSR**| 0.06308| 0.13130| 0.25723| 0.51953| inf| inf| inf| +|**DENSE1**| 0.00919| **0.08868**| **0.17236**| **0.35933**| inf| inf| inf| +|**DENSE2**| **0.00917**| 0.14296| 0.28586| 0.57170| inf| inf| inf| + +## min, backward=True + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00860| 0.07125| 0.15181| 0.30817| 0.59333| 1.24443| 2.73463| +|**SCA1_COL**| 0.00962| 0.04815| 0.09318| 0.17823| 0.35728| 0.73191| 1.48121| +|**SCA2_ROW**| 0.00911| 0.09598| 0.20782| 0.37699| 0.71144| 1.36771| 2.71041| +|**SCA2_COL**| 0.01214| 0.07398| 0.14340| 0.28159| 0.55606| 1.12340| 2.27677| +|**SEG_CSR**| 0.01314| 0.04612| 0.05948| 0.09264| 0.14940| 0.26563| 0.51036| +|**DENSE1**| 0.00190| **0.00940**| **0.01804**| **0.03560**| **0.07006**| **0.14255**| **0.49988**| +|**DENSE2**| **0.00184**| 0.02028| 0.04034| 0.08033| 0.16007| 0.40314| 0.80797| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00832| 0.06290| 0.12862| 0.25047| 0.49389| 1.04924| 2.47406| +|**SCA1_COL**| 0.00940| 0.04851| 0.09382| 0.17981| 0.36113| 0.73843| 1.49549| +|**SCA2_ROW**| 0.00885| 0.08690| 0.18107| 0.35173| 0.68949| 1.33827| 2.65366| +|**SCA2_COL**| 0.01201| 0.07386| 0.14365| 0.28212| 0.55785| 1.12303| 2.27992| +|**SEG_CSR**| 0.01121| 0.03005| 0.04429| 0.07947| 0.13907| 0.26026| 0.51461| +|**DENSE1**| 0.00163| **0.00987**| **0.01884**| **0.03723**| **0.07357**| **0.14962**| **0.30240**| +|**DENSE2**| **0.00143**| 0.02131| 0.04226| 0.08416| 0.16801| 0.42330| 0.84645| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.07058| 0.51607| 0.94460| 1.81087| inf| **inf**| **inf**| +|**SCA1_COL**| 0.06889| 0.47110| 0.85907| 1.67112| inf| inf| inf| +|**SCA2_ROW**| 0.07780| 0.72530| 1.51128| 2.99008| inf| inf| inf| +|**SCA2_COL**| 0.07667| 0.69826| 1.29356| 2.53346| inf| inf| inf| +|**SEG_CSR**| 0.06789| 0.14826| 0.26665| 0.52100| 1.52074| inf| inf| +|**DENSE1**| 0.00792| **0.06994**| **0.13991**| **0.28214**| **1.17725**| inf| inf| +|**DENSE2**| **0.00791**| 0.12188| 0.30087| 0.60160| 1.20277| inf| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.16106| 1.43453| 2.91065| inf| **inf**| **inf**| **inf**| +|**SCA1_COL**| 0.11757| 0.89370| 1.65629| inf| inf| inf| inf| +|**SCA2_ROW**| 0.15739| 1.55862| 3.11013| inf| inf| inf| inf| +|**SCA2_COL**| 0.15656| 1.36669| 2.57346| inf| inf| inf| inf| +|**SEG_CSR**| 0.05442| 0.25663| 0.44334| 0.86310| inf| inf| inf| +|**DENSE1**| **0.01902**| **0.11558**| **0.22682**| **0.46970**| inf| inf| inf| +|**DENSE2**| 0.01903| 0.37302| 0.74589| 1.49163| inf| inf| inf| + +## max, backward=True + +**DIMACS10/citationCiteseer** (avg row length: 8.62): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00854| 0.07134| 0.15168| 0.30787| 0.59340| 1.24411| 2.73868| +|**SCA1_COL**| 0.00965| 0.04815| 0.09316| 0.17821| 0.35723| 0.73183| 1.48105| +|**SCA2_ROW**| 0.00914| 0.09604| 0.20604| 0.36823| 0.70829| 1.36097| 2.68157| +|**SCA2_COL**| 0.01214| 0.07398| 0.14339| 0.28154| 0.55636| 1.12338| 2.27652| +|**SEG_CSR**| 0.01321| 0.03479| 0.04825| 0.07982| 0.13467| 0.24589| **0.48117**| +|**DENSE1**| 0.00195| **0.00935**| **0.01799**| **0.03563**| **0.07003**| **0.14252**| 0.49873| +|**DENSE2**| **0.00139**| 0.02028| 0.04032| 0.08035| 0.16006| 0.40313| 0.80770| + +**SNAP/web-Stanford** (avg row length: 8.20): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.00829| 0.06299| 0.12871| 0.25042| 0.49393| 1.05182| 2.47680| +|**SCA1_COL**| 0.00941| 0.04845| 0.09381| 0.17982| 0.36107| 0.73856| 1.49565| +|**SCA2_ROW**| 0.00884| 0.08686| 0.17952| 0.34915| 0.68363| 1.32981| 2.67216| +|**SCA2_COL**| 0.01196| 0.07381| 0.14354| 0.28207| 0.55761| 1.12502| 2.28171| +|**SEG_CSR**| 0.01119| 0.02801| 0.03999| 0.07327| 0.13080| 0.24636| 0.48922| +|**DENSE1**| 0.00181| **0.00983**| **0.01881**| **0.03724**| **0.07359**| **0.14965**| **0.30267**| +|**DENSE2**| **0.00139**| 0.02129| 0.04224| 0.08421| 0.16805| 0.42323| 0.84623| + +**Janna/StocF-1465** (avg row length: 14.34): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.07059| 0.51592| 0.94449| 1.81066| inf| **inf**| **inf**| +|**SCA1_COL**| 0.06890| 0.47106| 0.85903| 1.67105| inf| inf| inf| +|**SCA2_ROW**| 0.07450| 0.72413| 1.51120| 2.99127| inf| inf| inf| +|**SCA2_COL**| 0.07604| 0.69826| 1.29339| 2.53278| inf| inf| inf| +|**SEG_CSR**| 0.06646| 0.13756| 0.25231| 0.49584| 1.47966| inf| inf| +|**DENSE1**| **0.00790**| **0.06993**| **0.14000**| **0.28213**| **1.17037**| inf| inf| +|**DENSE2**| 0.00790| 0.12184| 0.30090| 0.60149| 1.20258| inf| inf| + +**GHS_psdef/ldoor** (avg row length: 44.63): +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.17114| 1.43458| 2.90995| inf| **inf**| **inf**| **inf**| +|**SCA1_COL**| 0.12085| 0.89365| 1.65624| inf| inf| inf| inf| +|**SCA2_ROW**| 0.15638| 1.55672| 3.11766| inf| inf| inf| inf| +|**SCA2_COL**| 0.15656| 1.36659| 2.57285| inf| inf| inf| inf| +|**SEG_CSR**| 0.05431| 0.22604| 0.41380| 0.81107| inf| inf| inf| +|**DENSE1**| 0.01902| **0.11569**| **0.22679**| **0.46961**| inf| inf| inf| +|**DENSE2**| **0.01900**| 0.37301| 0.74616| 1.49346| inf| inf| inf| + diff --git a/benchmark_after_cuda_index.npy b/benchmark_after_cuda_index.npy new file mode 100644 index 00000000..cbade044 Binary files /dev/null and b/benchmark_after_cuda_index.npy differ diff --git a/comparison_index.md b/comparison_index.md new file mode 100644 index 00000000..b986c92f --- /dev/null +++ b/comparison_index.md @@ -0,0 +1,304 @@ +## sum, backward=False + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.98566| 0.88141| 1.13327| 1.14039| 1.00201| 1.00195| 1.00161| +|**SCA1_COL**| 1.16616| 1.13531| 1.12264| 1.06201| 0.99984| 1.00260| 1.00025| +|**SCA2_ROW**| 0.95878| 0.59815| 0.57947| 0.54085| 0.46363| 0.49243| 0.49099| +|**SCA2_COL**| 1.15653| 0.60819| 0.60288| 0.56786| 0.57526| 0.62318| 0.62819| +|**SEG_CSR**| 0.12899| 0.79093| 0.85310| 0.90918| 0.92836| 0.95836| 0.97648| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.83429| 0.99799| 1.00083| 1.00025| 1.00031| 1.00064| 1.00164| +|**SCA1_COL**| 0.95503| 1.00040| 1.00000| 1.00099| 1.00062| 0.99984| 1.00112| +|**SCA2_ROW**| 0.87720| 0.52381| 0.50913| 0.45509| 0.45298| 0.45932| 0.45726| +|**SCA2_COL**| 0.96022| 0.54092| 0.54332| 0.53990| 0.58750| 0.63555| 0.63592| +|**SEG_CSR**| 0.10094| 0.85060| 0.89727| 0.94099| 0.96736| 0.97427| 0.98112| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.84654| 1.11686| 1.00236| 1.00080| 1.00123| 1.00119| 1.00000| +|**SCA1_COL**| 0.93248| 1.00751| 1.00026| 1.00019| 1.00072| 1.00026| 1.00000| +|**SCA2_ROW**| 0.84882| 0.49763| 0.47187| 0.43955| 0.31643| 0.28687| 1.00000| +|**SCA2_COL**| 0.93319| 0.69127| 0.64031| 0.63898| 0.50155| 0.48077| 1.00000| +|**SEG_CSR**| 0.08507| 0.96749| 0.98601| 0.99306| 0.99363| 0.99294| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.41032| 1.09833| 1.00153| 1.00158| 1.00130| 1.00000| 1.00000| +|**SCA1_COL**| 0.93141| 1.00006| 1.00002| 1.00020| 1.00015| 1.00000| 1.00000| +|**SCA2_ROW**| 1.40187| 0.49462| 0.46917| 0.32623| 0.29866| 1.00000| 1.00000| +|**SCA2_COL**| 0.93899| 0.64740| 0.61663| 0.48703| 0.46603| 1.00000| 1.00000| +|**SEG_CSR**| 0.14433| 0.96020| 0.98445| 0.99018| 0.99946| 1.00000| 1.00000| + +## mean, backward=False + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.78993| 0.99829| 1.00006| 0.99946| 1.00004| 1.00107| 0.99994| +|**SCA1_COL**| 0.94087| 0.99996| 1.00030| 0.99878| 0.99977| 0.99927| 1.00075| +|**SCA2_ROW**| 0.69895| 0.26575| 0.23536| 0.20636| 0.19804| 0.20334| 0.20276| +|**SCA2_COL**| 0.63423| 0.27393| 0.24865| 0.23371| 0.24389| 0.25910| 0.26120| +|**SEG_CSR**| 0.10376| 0.66863| 0.71454| 0.75159| 0.78289| 0.80503| 0.81739| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.81599| 0.99740| 0.99961| 1.00042| 0.99986| 1.00038| 0.99806| +|**SCA1_COL**| 0.91821| 0.99661| 1.00015| 1.00014| 0.99954| 0.99994| 0.99733| +|**SCA2_ROW**| 0.70751| 0.26241| 0.23468| 0.20250| 0.19550| 0.19349| 0.19097| +|**SCA2_COL**| 0.63548| 0.27443| 0.25012| 0.23664| 0.24811| 0.26004| 0.26314| +|**SEG_CSR**| 0.09868| 0.74500| 0.76749| 0.78646| 0.80112| 0.81084| 0.81492| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.84879| 1.10074| 1.00101| 1.00099| 1.00067| 1.00000| 1.00000| +|**SCA1_COL**| 0.92600| 1.00006| 1.00014| 0.99981| 0.99992| 1.00000| 1.00000| +|**SCA2_ROW**| 0.74825| 0.24069| 0.21230| 0.19027| 0.14245| 0.00000| 1.00000| +|**SCA2_COL**| 0.59082| 0.30711| 0.27877| 0.27017| 0.21907| 0.00000| 1.00000| +|**SEG_CSR**| 0.09641| 0.85286| 0.87959| 0.88350| 0.88424| 0.88370| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.38281| 1.00254| 1.00123| 1.00088| 1.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.93615| 0.99983| 1.00037| 1.00038| 1.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 1.25914| 0.27262| 0.22607| 0.15259| 0.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.53446| 0.29392| 0.26840| 0.21438| 0.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.15487| 0.92207| 0.94311| 0.94879| 0.95750| 1.00000| 1.00000| + +## min, backward=False + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.42751| 1.24119| 1.10536| 1.14499| 1.06588| 1.09993| 0.89292| +|**SCA1_COL**| 0.91809| 2.58328| 2.66146| 2.83895| 2.74778| 2.61905| 2.54277| +|**SCA2_ROW**| 1.42519| 1.03845| 1.04996| 1.21698| 1.24672| 1.48923| 1.47399| +|**SCA2_COL**| 0.75544| 1.08716| 1.15346| 1.16575| 1.12225| 1.09153| 1.06374| +|**SEG_CSR**| 0.12415| 0.33711| 0.47687| 0.60181| 0.75435| 0.85701| 0.92152| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.39706| 1.53793| 1.37468| 1.39797| 1.31952| 1.23927| 0.96666| +|**SCA1_COL**| 0.88381| 2.60448| 2.66669| 2.84052| 2.73885| 2.62804| 2.53716| +|**SCA2_ROW**| 1.39680| 1.29286| 1.12725| 1.22481| 1.19471| 1.20904| 1.37143| +|**SCA2_COL**| 0.73176| 1.11623| 1.17150| 1.17949| 1.13573| 1.10129| 1.08616| +|**SEG_CSR**| 0.10218| 0.55525| 0.71847| 0.80220| 0.89846| 0.93427| 0.94926| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.71307| 1.67392| 1.87125| 1.95150| 1.92485| 1.96991| 1.00000| +|**SCA1_COL**| 0.95010| 2.17095| 2.47491| 2.56155| 2.49341| 3.37615| 1.00000| +|**SCA2_ROW**| 1.51970| 1.48272| 1.24524| 1.22289| 1.15853| 1.30697| 1.00000| +|**SCA2_COL**| 0.54244| 1.02994| 1.12931| 1.13766| 0.97459| 1.26264| 1.00000| +|**SEG_CSR**| 0.08031| 0.74695| 0.86450| 0.89175| 0.91329| 0.92045| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 2.32755| 1.43590| 1.31547| 1.27502| 1.23839| 1.00000| 1.00000| +|**SCA1_COL**| 0.72073| 2.24922| 2.49835| 2.56438| 3.46176| 1.00000| 1.00000| +|**SCA2_ROW**| 2.75047| 2.01619| 1.89967| 1.91520| 1.96945| 1.00000| 1.00000| +|**SCA2_COL**| 0.69488| 0.97702| 1.05225| 0.96822| 1.24841| 1.00000| 1.00000| +|**SEG_CSR**| 0.13807| 0.62555| 0.78980| 0.82150| 0.84275| 1.00000| 1.00000| + +## max, backward=False + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.43973| 1.21454| 1.10774| 1.12920| 1.05342| 1.10188| 0.89435| +|**SCA1_COL**| 0.91867| 2.57566| 2.65917| 2.83829| 2.75885| 2.61837| 2.54393| +|**SCA2_ROW**| 1.42586| 1.11590| 0.98054| 1.22802| 1.24348| 1.45884| 1.47679| +|**SCA2_COL**| 0.75429| 1.08424| 1.15715| 1.16435| 1.12143| 1.09267| 1.06317| +|**SEG_CSR**| 0.12331| 1.06776| 1.13772| 1.15676| 1.18046| 1.18911| 1.18885| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.40430| 1.53739| 1.37368| 1.40171| 1.31694| 1.24070| 0.97113| +|**SCA1_COL**| 0.88603| 2.59737| 2.66826| 2.83938| 2.73643| 2.62659| 2.53788| +|**SCA2_ROW**| 1.40009| 1.30378| 1.15114| 1.24267| 1.19358| 1.23864| 1.38778| +|**SCA2_COL**| 0.73307| 1.11653| 1.17178| 1.17753| 1.13758| 1.10591| 1.08623| +|**SEG_CSR**| 0.10219| 1.08101| 1.15085| 1.16873| 1.18664| 1.19056| 1.19272| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.73213| 1.63486| 1.87131| 1.95003| 1.92451| 1.97010| 1.00000| +|**SCA1_COL**| 0.94853| 2.17265| 2.47481| 2.56243| 2.49408| 3.37696| 1.00000| +|**SCA2_ROW**| 1.71307| 1.47341| 1.24509| 1.22900| 1.15068| 1.30262| 1.00000| +|**SCA2_COL**| 0.57608| 1.03065| 1.12881| 1.13982| 0.97569| 1.26371| 1.00000| +|**SEG_CSR**| 0.07125| 1.04245| 1.10447| 1.11396| 1.12632| 1.12540| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 2.57132| 1.43416| 1.31678| 1.27503| 1.23822| 1.00000| 1.00000| +|**SCA1_COL**| 0.72271| 2.24822| 2.49813| 2.56523| 3.46169| 1.00000| 1.00000| +|**SCA2_ROW**| 2.63685| 2.08461| 1.90157| 1.91692| 1.97772| 1.00000| 1.00000| +|**SCA2_COL**| 0.69382| 0.97848| 1.05122| 0.96882| 1.25138| 1.00000| 1.00000| +|**SEG_CSR**| 0.13828| 1.05981| 1.05883| 1.06503| 1.06624| 1.00000| 1.00000| + +## sum, backward=True + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.11639| 0.95674| 0.93714| 0.93401| 0.93265| 0.93820| 0.94121| +|**SCA1_COL**| 0.95210| 0.95658| 0.94582| 0.94844| 0.95296| 0.95607| 0.95808| +|**SCA2_ROW**| 0.85289| 0.49040| 0.45805| 0.41024| 0.39783| 0.43063| 0.44562| +|**SCA2_COL**| 0.94981| 0.53240| 0.52782| 0.50776| 0.53652| 0.56548| 0.56868| +|**SEG_CSR**| 0.15498| 0.60155| 0.66000| 0.69321| 0.71603| 0.72836| 0.73353| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.95280| 0.95611| 0.93450| 0.92970| 0.92847| 0.93334| 0.93466| +|**SCA1_COL**| 0.94100| 0.95561| 0.94405| 0.94629| 0.95012| 0.95545| 0.95169| +|**SCA2_ROW**| 0.88639| 0.48743| 0.45741| 0.40261| 0.39245| 0.41116| 0.42875| +|**SCA2_COL**| 0.93856| 0.53557| 0.53042| 0.51283| 0.54400| 0.56727| 0.56947| +|**SEG_CSR**| 0.14283| 0.63947| 0.68004| 0.70384| 0.72282| 0.73549| 0.74390| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.75189| 0.94483| 0.96305| 0.95899| 0.95856| 1.00000| 1.00000| +|**SCA1_COL**| 0.89286| 0.97881| 0.97627| 0.97516| 0.97541| 1.00000| 1.00000| +|**SCA2_ROW**| 0.74922| 0.45992| 0.41972| 0.38923| 0.27958| 1.00000| 1.00000| +|**SCA2_COL**| 0.89232| 0.64293| 0.59105| 0.58035| 0.44425| 1.00000| 1.00000| +|**SEG_CSR**| 0.12070| 0.71465| 0.72531| 0.73307| 0.73117| 1.00000| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.14105| 0.99024| 0.98789| 0.98644| 1.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.89454| 0.99304| 0.99207| 0.99202| 1.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 1.00852| 0.44818| 0.41439| 0.28619| 1.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.70001| 0.61344| 0.57669| 0.43854| 1.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.15896| 0.71420| 0.71842| 0.72466| 1.00000| 1.00000| 1.00000| + +## mean, backward=True + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.59020| 0.48945| 0.48631| 0.47776| 0.47476| 0.47927| 0.48205| +|**SCA1_COL**| 0.56318| 0.49066| 0.49489| 0.49357| 0.49855| 0.50466| 0.50830| +|**SCA2_ROW**| 0.46701| 0.16906| 0.15138| 0.13204| 0.12603| 0.13239| 0.13789| +|**SCA2_COL**| 0.38771| 0.18395| 0.17225| 0.16202| 0.16726| 0.17440| 0.17572| +|**SEG_CSR**| 0.31344| 0.96689| 0.98798| 1.00417| 1.01692| 1.02622| 1.02849| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.62181| 0.48915| 0.48603| 0.47638| 0.47419| 0.47315| 0.47470| +|**SCA1_COL**| 0.58115| 0.49121| 0.49581| 0.49579| 0.50042| 0.50096| 0.50612| +|**SCA2_ROW**| 0.48204| 0.16887| 0.15141| 0.13113| 0.12551| 0.12881| 0.13398| +|**SCA2_COL**| 0.39004| 0.18517| 0.17295| 0.16366| 0.16975| 0.17457| 0.17602| +|**SEG_CSR**| 0.26334| 1.04140| 1.01789| 1.01481| 1.01884| 1.04089| 1.02477| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.44880| 0.49277| 0.47520| 0.46779| 0.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.51132| 0.52026| 0.50975| 0.50755| 0.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 0.46388| 0.15584| 0.13620| 0.12353| 0.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.42258| 0.20605| 0.18725| 0.18107| 0.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.28089| 1.17089| 1.17180| 1.16441| 1.14123| 1.00000| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.72081| 0.47611| 0.46858| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.59720| 0.51209| 0.50423| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 0.68859| 0.16285| 0.13877| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.33414| 0.19928| 0.18213| 0.00000| 1.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.45336| 1.36970| 1.35099| 1.31499| 1.00000| 1.00000| 1.00000| + +## min, backward=True + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.70220| 0.64839| 0.64656| 0.71693| 0.66840| 0.71298| 0.61056| +|**SCA1_COL**| 0.55632| 0.52798| 0.55013| 0.59922| 0.56287| 0.56198| 0.51268| +|**SCA2_ROW**| 0.73705| 0.53193| 0.52286| 0.64117| 0.60659| 0.69707| 0.66150| +|**SCA2_COL**| 0.44983| 0.34897| 0.36936| 0.39182| 0.37444| 0.37882| 0.34589| +|**SEG_CSR**| 0.15144| 0.24979| 0.34449| 0.41533| 0.50278| 0.56577| 0.58375| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.66634| 0.68755| 0.68855| 0.76308| 0.72256| 0.70088| 0.60732| +|**SCA1_COL**| 0.55048| 0.52858| 0.55007| 0.59506| 0.56481| 0.56574| 0.51442| +|**SCA2_ROW**| 0.71325| 0.55084| 0.54391| 0.59947| 0.56702| 0.59900| 0.61248| +|**SCA2_COL**| 0.44094| 0.35268| 0.37191| 0.39258| 0.37905| 0.38516| 0.35038| +|**SEG_CSR**| 0.17286| 0.35580| 0.44916| 0.48577| 0.54911| 0.58248| 0.58741| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.90875| 0.74148| 0.78686| 0.83554| 0.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.44948| 0.47300| 0.51630| 0.54517| 0.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 0.88557| 0.58973| 0.55829| 0.57025| 0.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.39044| 0.32612| 0.35040| 0.36717| 0.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.12988| 0.51043| 0.56296| 0.57957| 0.39686| 1.00000| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.59429| 0.88234| 0.84499| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.47599| 0.47775| 0.50593| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 1.60570| 0.91526| 0.88074| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.35817| 0.31463| 0.32807| 0.00000| 1.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.19852| 0.45612| 0.51982| 0.53573| 1.00000| 1.00000| 1.00000| + +## max, backward=True + +**DIMACS10/citationCiteseer** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.69000| 0.64766| 0.64751| 0.71753| 0.66865| 0.71311| 0.60958| +|**SCA1_COL**| 0.55251| 0.52811| 0.54964| 0.59922| 0.56290| 0.56208| 0.51273| +|**SCA2_ROW**| 0.73648| 0.53226| 0.52718| 0.65601| 0.60941| 0.70048| 0.66846| +|**SCA2_COL**| 0.45057| 0.34891| 0.36940| 0.39188| 0.37428| 0.37876| 0.34590| +|**SEG_CSR**| 0.14949| 0.33128| 0.42511| 0.48209| 0.55851| 0.61046| 0.61870| + +**SNAP/web-Stanford** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.66699| 0.68594| 0.68771| 0.76360| 0.72241| 0.69930| 0.60677| +|**SCA1_COL**| 0.55022| 0.52887| 0.54992| 0.59510| 0.56484| 0.56557| 0.51433| +|**SCA2_ROW**| 0.70934| 0.55091| 0.54874| 0.60374| 0.57179| 0.60293| 0.60828| +|**SCA2_COL**| 0.44249| 0.35290| 0.37247| 0.39276| 0.37914| 0.38446| 0.35004| +|**SEG_CSR**| 0.17869| 0.38175| 0.49868| 0.52714| 0.58364| 0.61532| 0.61742| + +**Janna/StocF-1465** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 0.90928| 0.73380| 0.78708| 0.83562| 0.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.48282| 0.47301| 0.51633| 0.54520| 0.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 1.04252| 0.59050| 0.55838| 0.57002| 0.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.44175| 0.32631| 0.35042| 0.36731| 0.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.14171| 0.55021| 0.59514| 0.60921| 0.40811| 1.00000| 1.00000| + +**GHS_psdef/ldoor** +| | 1| 16| 32| 64| 128| 256| 512| +|------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +|**SCA1_ROW**| 1.44068| 0.88226| 0.84510| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA1_COL**| 0.46274| 0.47765| 0.50598| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_ROW**| 1.61725| 0.91619| 0.87866| 0.00000| 1.00000| 1.00000| 1.00000| +|**SCA2_COL**| 0.35839| 0.31470| 0.32820| 0.00000| 1.00000| 1.00000| 1.00000| +|**SEG_CSR**| 0.19929| 0.51719| 0.55656| 0.56972| 1.00000| 1.00000| 1.00000| + diff --git a/torch_scatter/scatter.py b/torch_scatter/scatter.py index f3991dd3..c53e34a7 100644 --- a/torch_scatter/scatter.py +++ b/torch_scatter/scatter.py @@ -8,12 +8,15 @@ def scatter_sum(src: torch.Tensor, index: torch.Tensor, dim: int = -1, out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> torch.Tensor: - # FIXME: when index.dim() == 1, use index_reduce and don't do the broadcast - index = broadcast(index, src, dim) include = True if out is None: # we can use `include_self = True` here out = _create_out(src, index, dim, dim_size) + + if (index.dim() == 1): + return out.index_add_(dim, index, src) + + index = broadcast(index, src, dim) return out.scatter_reduce_(dim, index, src, 'sum', include_self=include) @@ -26,26 +29,32 @@ def scatter_add(src: torch.Tensor, index: torch.Tensor, dim: int = -1, def scatter_mul(src: torch.Tensor, index: torch.Tensor, dim: int = -1, out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> torch.Tensor: - # FIXME: when index.dim() == 1, use index_reduce and don't do the broadcast - index = broadcast(index, src, dim) include = True if out is None: # use include=True so indices not scattered to are filled with 1s # as per torch_scatter out = _create_out(src, index, dim, dim_size, is_mul=True) + + if (index.dim() == 1): + return out.index_reduce_(dim, index, src, 'prod', include_self=include) + + index = broadcast(index, src, dim) return out.scatter_reduce_(dim, index, src, 'prod', include_self=include) def scatter_mean(src: torch.Tensor, index: torch.Tensor, dim: int = -1, out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> torch.Tensor: - # FIXME: when index.dim() == 1, use index_reduce and don't do the broadcast - index = broadcast(index, src, dim) include = True if out is None: out = _create_out(src, index, dim, dim_size) # include must be false to avoid adding 1 to the denominator include = False + + if (index.dim() == 1): + return out.index_reduce_(dim, index, src, 'mean', include_self=include) + + index = broadcast(index, src, dim) return out.scatter_reduce_(dim, index, src, 'mean', include_self=include) @@ -57,7 +66,6 @@ def scatter_min( src: torch.Tensor, index: torch.Tensor, dim: int = -1, out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> Tuple[torch.Tensor, torch.Tensor]: - index = broadcast(index, src, dim) include = True if out is None: out = _create_out(src, index, dim, dim_size) @@ -65,7 +73,13 @@ def scatter_min( # of reduction inits, otherwise non scattered positions will be # filled with inits include = False - out.scatter_reduce_(dim, index, src, 'amin', include_self=include) + + if (index.dim() == 1): + out.index_reduce_(dim, index, src, 'amin', include_self=include) + else: + index = broadcast(index, src, dim) + out.scatter_reduce_(dim, index, src, 'amin', include_self=include) + return out, torch.empty(()) @@ -73,12 +87,17 @@ def scatter_max( src: torch.Tensor, index: torch.Tensor, dim: int = -1, out: Optional[torch.Tensor] = None, dim_size: Optional[int] = None) -> Tuple[torch.Tensor, torch.Tensor]: - index = broadcast(index, src, dim) include = True if out is None: out = _create_out(src, index, dim, dim_size) include = False - out.scatter_reduce_(dim, index, src, 'amax', include_self=include) + + if (index.dim() == 1): + out.index_reduce_(dim, index, src, 'amax', include_self=include) + else: + index = broadcast(index, src, dim) + out.scatter_reduce_(dim, index, src, 'amax', include_self=include) + return out, torch.empty(())