Bug report: ExternalItemRecommender - hundereds of threads

10 views
Skip to first unread message

Petr Sobotka

unread,
Apr 27, 2019, 1:48:52 PM4/27/19
to MyMediaLite
First of all, thanks for an awesome library! 

I'm using the command line interface of MyMediaLite.  Version 3.12, compiled on Linux Debian from source. Mono v. 4.6.2. 
Also tested with the 3.11 precompiled binaries and Mono 5.2 on Windows 7. 
I'm having troubles with the ExternalItemRecommender. It starts literally hundreds of threads, I tried several times and after a couple of minutes it climbs to over 400 running threads. An ordinary computer gets ruined by this of course. RAM usage is OK, it does not climb. I experienced no such issue with the other recommenders. 

Command: 
item_recommendation --training-file=abcd.tsv --test-file=efgh.tsv --recommender=ExternalItemRecommender  --recommender-options="prediction_file=predictions.txt"
loading_time 0.05
memory 7
training data: 2874 users, 21261 items, 28740 events, sparsity 99.95297
test data:     2354 users, 9127 items, 10345 events, sparsity 99.95185
ExternalItemRecommender prediction_file=predictions.txt 
training_time 00:00:00.0548050 memory 10


While on Linux, interruption with CTRL+C gave me this output:


STATE CUE CARD: (? means a positive number, usually 1 or 2, * means any number)
        0x0     - starting (GOOD, unless the thread is running managed code)
        0x1     - running (BAD, unless it's the gc thread)
        0x2     - detached (GOOD, unless the thread is running managed code)
        0x?03   - async suspended (GOOD)
        0x?04   - self suspended (GOOD)
        0x?05   - async suspend requested (BAD)
        0x?06   - self suspend requested (BAD)
        0x*07   - blocking (GOOD)
        0x?08   - blocking with pending suspend (GOOD)
--thread 0x7f2944006e80 id 0x7f290355a700 [(nil)] state 1  
--thread 0x7f2938006e80 id 0x7f290375b700 [(nil)] state 1  GC INITIATOR
--thread 0x7f293c006e80 id 0x7f290395c700 [(nil)] state 1  
--thread 0x7f2930006e80 id 0x7f2903b5d700 [(nil)] state 1  
--thread 0x7f2934006e80 id 0x7f2903d5e700 [(nil)] state 1  
--thread 0x7f2928006e80 id 0x7f2903f5f700 [(nil)] state 1  
--thread 0x7f292c006e80 id 0x7f2904160700 [(nil)] state 1  
--thread 0x7f2920006e80 id 0x7f2904361700 [(nil)] state 1  
--thread 0x7f2924006e80 id 0x7f2904562700 [(nil)] state 1  
--thread 0x7f2918006e80 id 0x7f2904763700 [(nil)] state 1  
--thread 0x7f291c006e80 id 0x7f2904964700 [(nil)] state 1  
--thread 0x55fdd15cc070 id 0x7f2904b65700 [(nil)] state 1  
--thread 0x7f2994005dc0 id 0x7f2904d66700 [(nil)] state 1  
--thread 0x7f298c017480 id 0x7f2904f67700 [(nil)] state 1  
--thread 0x7f2990010260 id 0x7f2905168700 [(nil)] state 1  
--thread 0x7f29840091a0 id 0x7f2905369700 [(nil)] state 1  
--thread 0x7f2988007e80 id 0x7f290556a700 [(nil)] state 1  
--thread 0x7f297c012a20 id 0x7f290576b700 [(nil)] state 1  
--thread 0x7f2978005d90 id 0x7f290596c700 [(nil)] state 1  
--thread 0x7f2970005d90 id 0x7f2905b6d700 [(nil)] state 1  
--thread 0x7f2974005d90 id 0x7f2905d6e700 [(nil)] state 1  
--thread 0x7f2968005d90 id 0x7f2905f6f700 [(nil)] state 1  
--thread 0x7f296c005d90 id 0x7f2906170700 [(nil)] state 1  
--thread 0x7f2960005d90 id 0x7f2906371700 [(nil)] state 1  
--thread 0x7f2964005d90 id 0x7f2906572700 [(nil)] state 1  
--thread 0x7f2958005d90 id 0x7f2906773700 [(nil)] state 1  
--thread 0x7f295c005d90 id 0x7f2906974700 [(nil)] state 1  
--thread 0x7f2950005d90 id 0x7f2906b75700 [(nil)] state 1  
--thread 0x7f2954005d90 id 0x7f2906d76700 [(nil)] state 1  
--thread 0x7f2948005d90 id 0x7f2906f77700 [(nil)] state 1  
--thread 0x7f294c009050 id 0x7f2907178700 [(nil)] state 1  
--thread 0x7f2940005d90 id 0x7f2907379700 [(nil)] state 1  
--thread 0x7f2944005d90 id 0x7f290757a700 [(nil)] state 1  
--thread 0x7f2938005d90 id 0x7f290777b700 [(nil)] state 1  
--thread 0x7f293c005d90 id 0x7f290797c700 [(nil)] state 1  
--thread 0x7f2930005d90 id 0x7f2907b7d700 [(nil)] state 1  
--thread 0x7f2934005d90 id 0x7f2907d7e700 [(nil)] state 1  
--thread 0x7f2928005d90 id 0x7f2907f7f700 [(nil)] state 1  
--thread 0x7f292c005d90 id 0x7f2908180700 [(nil)] state 1  
--thread 0x7f2920005d90 id 0x7f2908381700 [(nil)] state 1  
--thread 0x7f2924005d90 id 0x7f2908582700 [(nil)] state 1  
--thread 0x7f2918005d90 id 0x7f2908783700 [(nil)] state 1  
--thread 0x7f291c005d90 id 0x7f2908984700 [(nil)] state 1  
--thread 0x55fdd15bdad0 id 0x7f2908b85700 [(nil)] state 1  
--thread 0x7f2994004cd0 id 0x7f2908d86700 [(nil)] state 1  
--thread 0x7f298c013390 id 0x7f2908f87700 [(nil)] state 1  
--thread 0x7f299000f730 id 0x7f2909188700 [(nil)] state 1  
--thread 0x7f2984008260 id 0x7f2909389700 [(nil)] state 1  
--thread 0x7f29880035d0 id 0x7f290958a700 [(nil)] state 1  
--thread 0x7f297c011ae0 id 0x7f290978b700 [(nil)] state 1  
--thread 0x7f2978004ca0 id 0x7f290998c700 [(nil)] state 1  
--thread 0x7f2970004ca0 id 0x7f2909b8d700 [(nil)] state 1  
--thread 0x7f2974004ca0 id 0x7f2909d8e700 [(nil)] state 1  
--thread 0x7f2968004ca0 id 0x7f2909f8f700 [(nil)] state 1  
--thread 0x7f296c004ca0 id 0x7f290a190700 [(nil)] state 1  
--thread 0x7f2960004ca0 id 0x7f290a391700 [(nil)] state 1  
--thread 0x7f2964004ca0 id 0x7f290a592700 [(nil)] state 1  
--thread 0x7f2958004ca0 id 0x7f290a793700 [(nil)] state 1  
--thread 0x7f295c004ca0 id 0x7f290a994700 [(nil)] state 1  
--thread 0x7f2950004ca0 id 0x7f290ab95700 [(nil)] state 1  
--thread 0x7f2954004ca0 id 0x7f290ad96700 [(nil)] state 1  
--thread 0x7f2948004ca0 id 0x7f290af97700 [(nil)] state 1  
--thread 0x7f294c007f60 id 0x7f290b198700 [(nil)] state 1  
--thread 0x7f2940004ca0 id 0x7f290b399700 [(nil)] state 1  
--thread 0x7f2944004ca0 id 0x7f290b59a700 [(nil)] state 1  
--thread 0x7f2938004ca0 id 0x7f290b79b700 [(nil)] state 1  
--thread 0x7f293c004ca0 id 0x7f290b99c700 [(nil)] state 1  
--thread 0x7f2930004ca0 id 0x7f290bb9d700 [(nil)] state 1  
--thread 0x7f2934004ca0 id 0x7f290bd9e700 [(nil)] state 1  
--thread 0x7f2928004ca0 id 0x7f290bf9f700 [(nil)] state 1  
--thread 0x7f292c004ca0 id 0x7f290c1a0700 [(nil)] state 1  
--thread 0x7f2920004ca0 id 0x7f290c3a1700 [(nil)] state 1  
--thread 0x7f2924004ca0 id 0x7f290c5a2700 [(nil)] state 1  
--thread 0x7f2918004ca0 id 0x7f290c7a3700 [(nil)] state 1  
--thread 0x7f291c004ca0 id 0x7f290c9a4700 [(nil)] state 1  
--thread 0x55fdd15bcb90 id 0x7f290cba5700 [(nil)] state 1  
--thread 0x7f2994003be0 id 0x7f290cda6700 [(nil)] state 1  
--thread 0x7f298c00f2a0 id 0x7f290cfa7700 [(nil)] state 1  
--thread 0x7f299001a5d0 id 0x7f290d1a8700 [(nil)] state 1  
--thread 0x7f29840131c0 id 0x7f290d3a9700 [(nil)] state 1  
--thread 0x7f2988002690 id 0x7f290d5aa700 [(nil)] state 1  
--thread 0x7f297c010960 id 0x7f290d7ab700 [(nil)] state 1  
--thread 0x7f2978003bb0 id 0x7f290d9ac700 [(nil)] state 1  
--thread 0x7f2970003bb0 id 0x7f290dbad700 [(nil)] state 1  
--thread 0x7f2974003bb0 id 0x7f290ddae700 [(nil)] state 1  
--thread 0x7f2968003bb0 id 0x7f290dfaf700 [(nil)] state 1  
--thread 0x7f296c003bb0 id 0x7f290e1b0700 [(nil)] state 1  
--thread 0x7f2960003bb0 id 0x7f290e3b1700 [(nil)] state 1  
--thread 0x7f2964003bb0 id 0x7f290e5b2700 [(nil)] state 1  
--thread 0x7f2958003bb0 id 0x7f290e7b3700 [(nil)] state 1  
--thread 0x7f295c003bb0 id 0x7f290e9b4700 [(nil)] state 1  
--thread 0x7f2950003bb0 id 0x7f290ebb5700 [(nil)] state 1  
--thread 0x7f2954003bb0 id 0x7f290edb6700 [(nil)] state 1  
--thread 0x7f2948003bb0 id 0x7f290efb7700 [(nil)] state 1  
--thread 0x7f294c006f10 id 0x7f290f1b8700 [(nil)] state 1  
--thread 0x7f2940003bb0 id 0x7f290f3b9700 [(nil)] state 1  
--thread 0x7f2944003bb0 id 0x7f290f5ba700 [(nil)] state 1  
--thread 0x7f2938003bb0 id 0x7f290f7bb700 [(nil)] state 1  
--thread 0x7f293c003bb0 id 0x7f290f9bc700 [(nil)] state 1  
--thread 0x7f2930003bb0 id 0x7f290fbbd700 [(nil)] state 1  
--thread 0x7f2934003bb0 id 0x7f290fdbe700 [(nil)] state 1  
--thread 0x7f2928003bb0 id 0x7f290ffbf700 [(nil)] state 1  
--thread 0x7f292c003bb0 id 0x7f29101c0700 [(nil)] state 1  
--thread 0x7f2920003bb0 id 0x7f29103c1700 [(nil)] state 1  
--thread 0x7f2924003bb0 id 0x7f29105c2700 [(nil)] state 1  
--thread 0x7f2918003bb0 id 0x7f29107c3700 [(nil)] state 1  
--thread 0x7f291c003bb0 id 0x7f29109c4700 [(nil)] state 1  
--thread 0x55fdd15bb2c0 id 0x7f2910bc5700 [(nil)] state 1  
--thread 0x7f2994002af0 id 0x7f2910dc6700 [(nil)] state 1  
--thread 0x7f298c00b1b0 id 0x7f2910fc7700 [(nil)] state 1  
--thread 0x7f299001d8b0 id 0x7f29111c8700 [(nil)] state 1  
--thread 0x7f2984012280 id 0x7f29113c9700 [(nil)] state 1  
--thread 0x7f2988001b60 id 0x7f29115ca700 [(nil)] state 1  
--thread 0x7f297c00fa20 id 0x7f29117cb700 [(nil)] state 1  
--thread 0x7f2978002ac0 id 0x7f29119cc700 [(nil)] state 1  
--thread 0x7f2970002ac0 id 0x7f2911bcd700 [(nil)] state 1  
--thread 0x7f2974002ac0 id 0x7f2911dce700 [(nil)] state 1  
--thread 0x7f2968002ac0 id 0x7f2911fcf700 [(nil)] state 1  
--thread 0x7f296c002ac0 id 0x7f29121d0700 [(nil)] state 1  
--thread 0x7f2960002ac0 id 0x7f29123d1700 [(nil)] state 1  
--thread 0x7f2964002ac0 id 0x7f29125d2700 [(nil)] state 1  
--thread 0x7f2958002ac0 id 0x7f29127d3700 [(nil)] state 1  
--thread 0x7f295c002ac0 id 0x7f29129d4700 [(nil)] state 1  
--thread 0x7f2950002ac0 id 0x7f2912bd5700 [(nil)] state 1  
--thread 0x7f2954002ac0 id 0x7f2912dd6700 [(nil)] state 1  
--thread 0x7f2948002ac0 id 0x7f2912fd7700 [(nil)] state 1  
--thread 0x7f294c005fd0 id 0x7f29131d8700 [(nil)] state 1  
--thread 0x7f2940002ac0 id 0x7f29133d9700 [(nil)] state 1  
--thread 0x7f2944002ac0 id 0x7f29135da700 [(nil)] state 1  
--thread 0x7f2938002ac0 id 0x7f29137db700 [(nil)] state 1  
--thread 0x7f293c002ac0 id 0x7f29139dc700 [(nil)] state 1  
--thread 0x7f2930002ac0 id 0x7f2913bdd700 [(nil)] state 1  
--thread 0x7f2934002ac0 id 0x7f2913dde700 [(nil)] state 1  
--thread 0x7f2928002ac0 id 0x7f2913fdf700 [(nil)] state 1  
--thread 0x7f292c002ac0 id 0x7f29141e0700 [(nil)] state 1  
--thread 0x7f2920002ac0 id 0x7f29143e1700 [(nil)] state 1  
--thread 0x7f2924002ac0 id 0x7f29145e2700 [(nil)] state 1  
--thread 0x7f2918002ac0 id 0x7f29147e3700 [(nil)] state 1  
--thread 0x7f291c002ac0 id 0x7f29149e4700 [(nil)] state 1  
--thread 0x55fdd15a3f00 id 0x7f2914be5700 [(nil)] state 1  
--thread 0x7f29940019f0 id 0x7f2914de6700 [(nil)] state 1  
--thread 0x7f298c0070c0 id 0x7f2914fe7700 [(nil)] state 1  
--thread 0x7f299001c560 id 0x7f29151e8700 [(nil)] state 1  
--thread 0x7f298403ee70 id 0x7f29153e9700 [(nil)] state 1  
--thread 0x7f29880054b0 id 0x7f29155ea700 [(nil)] state 1  
--thread 0x7f297c03ecf0 id 0x7f29157eb700 [(nil)] state 1  
--thread 0x7f29780019d0 id 0x7f29159ec700 [(nil)] state 1  
--thread 0x7f29700019d0 id 0x7f2915bed700 [(nil)] state 1  
--thread 0x7f29740019d0 id 0x7f2915dee700 [(nil)] state 1  
--thread 0x7f29680019d0 id 0x7f2915fef700 [(nil)] state 1  
--thread 0x7f296c0019d0 id 0x7f29161f0700 [(nil)] state 1  
--thread 0x7f29600019d0 id 0x7f29163f1700 [(nil)] state 1  
--thread 0x7f29640019d0 id 0x7f29165f2700 [(nil)] state 1  
--thread 0x7f29580019d0 id 0x7f29167f3700 [(nil)] state 1  
--thread 0x7f295c0019d0 id 0x7f29169f4700 [(nil)] state 1  
--thread 0x7f29500019d0 id 0x7f2916bf5700 [(nil)] state 1  
--thread 0x7f29540019d0 id 0x7f2916df6700 [(nil)] state 1  
--thread 0x7f29480019d0 id 0x7f2916ff7700 [(nil)] state 1  
--thread 0x7f294c005090 id 0x7f29171f8700 [(nil)] state 1  
--thread 0x7f29400019d0 id 0x7f29173f9700 [(nil)] state 1  
--thread 0x7f29440019d0 id 0x7f29175fa700 [(nil)] state 1  
--thread 0x7f29380019d0 id 0x7f29177fb700 [(nil)] state 1  
--thread 0x7f293c0019d0 id 0x7f29179fc700 [(nil)] state 1  
--thread 0x7f29300019d0 id 0x7f2917bfd700 [(nil)] state 1  
--thread 0x7f29340019d0 id 0x7f2917dfe700 [(nil)] state 1  
--thread 0x7f29280019d0 id 0x7f2917fff700 [(nil)] state 1  
--thread 0x7f292c0019d0 id 0x7f29803e1700 [(nil)] state 1  
--thread 0x7f29200019d0 id 0x7f29805e2700 [(nil)] state 1  
--thread 0x7f29240019d0 id 0x7f29807e3700 [(nil)] state 1  
--thread 0x7f29180019d0 id 0x7f29809e4700 [(nil)] state 1  
--thread 0x7f291c0019d0 id 0x7f2980be5700 [(nil)] state 1  
--thread 0x55fdd15ae660 id 0x7f2980de6700 [(nil)] state 1  
--thread 0x7f291c0008e0 id 0x7f2980fe7700 [(nil)] state 1  
--thread 0x7f29180008e0 id 0x7f29811e8700 [(nil)] state 1  
--thread 0x7f29240008e0 id 0x7f29813e9700 [(nil)] state 1  
--thread 0x7f29200008e0 id 0x7f29815ea700 [(nil)] state 1  
--thread 0x7f292c0008e0 id 0x7f29817eb700 [(nil)] state 1  
--thread 0x7f29280008e0 id 0x7f29819ec700 [(nil)] state 1  
--thread 0x7f29340008e0 id 0x7f2981bed700 [(nil)] state 1  
--thread 0x7f29300008e0 id 0x7f2981dee700 [(nil)] state 1  
--thread 0x7f293c0008e0 id 0x7f2981fef700 [(nil)] state 1  
--thread 0x7f29380008e0 id 0x7f29821f0700 [(nil)] state 1  
--thread 0x7f29440008e0 id 0x7f29823f1700 [(nil)] state 1  
--thread 0x7f29400008e0 id 0x7f29825f2700 [(nil)] state 1  
--thread 0x7f294c0008e0 id 0x7f29827f3700 [(nil)] state 1  
--thread 0x7f29480008e0 id 0x7f29829f4700 [(nil)] state 1  
--thread 0x7f29540008e0 id 0x7f2982bf5700 [(nil)] state 1  
--thread 0x7f29500008e0 id 0x7f2982df6700 [(nil)] state 1  
--thread 0x7f295c0008e0 id 0x7f2982ff7700 [(nil)] state 1  
--thread 0x7f29580008e0 id 0x7f29831f8700 [(nil)] state 1  
--thread 0x7f29640008e0 id 0x7f29833f9700 [(nil)] state 1  
--thread 0x7f29600008e0 id 0x7f29835fa700 [(nil)] state 1  
--thread 0x7f296c0008e0 id 0x7f29837fb700 [(nil)] state 1  
--thread 0x7f29680008e0 id 0x7f29839fc700 [(nil)] state 105  
--thread 0x7f29740008e0 id 0x7f2983bfd700 [(nil)] state 1  
--thread 0x7f29700008e0 id 0x7f2983dfe700 [(nil)] state 1  
--thread 0x7f29780008e0 id 0x7f2983fff700 [(nil)] state 1  
--thread 0x7f297c0008e0 id 0x7f29983fc700 [(nil)] state 1  
--thread 0x7f29880008e0 id 0x7f29985fd700 [(nil)] state 1  
--thread 0x7f29840008e0 id 0x7f29987fe700 [(nil)] state 1  
--thread 0x7f29900008e0 id 0x7f29989ff700 [(nil)] state 1  
--thread 0x7f29940008e0 id 0x7f299a434700 [(nil)] state 1  
--thread 0x55fdd1253e40 id 0x7f299de6a740 [(nil)] state 1  
WAITING for 1 threads, got 0 suspended
suspend_thread suspend took 200 ms, which is more than the allowed 200 ms
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Environment.Exit (int) <IL 0x00007, 0x00058>
  at System.Console.DoConsoleCancelEvent () <0x00190>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x00020, 0x00069>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke (System.Runtime.Remoting.Messaging.AsyncResult) <IL 0x00013, 0x00061>
  at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x0000c>
  at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x001d6>
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x00008>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) <IL 0x0001f, 0x00062>

Native stacktrace:

        mono(+0xc8d94) [0x55fdd0756d94]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x110e0) [0x7f299d3530e0]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcf) [0x7f299cdbefff]
        /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f299cdc042a]
        mono(+0x289fe9) [0x55fdd0917fe9]
        mono(+0x28a27c) [0x55fdd091827c]
        mono(+0x28a34f) [0x55fdd091834f]
        mono(+0x2804c5) [0x55fdd090e4c5]
        mono(+0x280f3c) [0x55fdd090ef3c]
        mono(+0x1befd3) [0x55fdd084cfd3]
        mono(+0x1c9be3) [0x55fdd0857be3]
        mono(+0x1bbba0) [0x55fdd0849ba0]
        mono(+0x168fcd) [0x55fdd07f6fcd]
        [0x413d3969]

Debug info from gdb:

[New LWP 18784]
[New LWP 18785]
[New LWP 18787]
[New LWP 18788]
[New LWP 18789]
[New LWP 18790]
[New LWP 18791]
[New LWP 18792]
[New LWP 18794]
[New LWP 18795]
[New LWP 18796]
[New LWP 18797]
[New LWP 18798]
[New LWP 18799]
[New LWP 18800]
[New LWP 18801]
[New LWP 18802]
[New LWP 18803]
[New LWP 18804]
[New LWP 18805]
[New LWP 18806]
[New LWP 18810]
[New LWP 18811]
[New LWP 18812]
[New LWP 18816]
[New LWP 18817]
[New LWP 18818]
[New LWP 18819]
[New LWP 18821]
[New LWP 18822]
[New LWP 18823]
[New LWP 18824]
[New LWP 18825]
[New LWP 18826]
[New LWP 18827]
[New LWP 18828]
[New LWP 18829]
[New LWP 18830]
[New LWP 18831]
[New LWP 18832]
[New LWP 18833]
[New LWP 18834]
[New LWP 18835]
[New LWP 18836]
[New LWP 18837]
[New LWP 18838]
[New LWP 18839]
[New LWP 18840]
[New LWP 18841]
[New LWP 18842]
[New LWP 18843]
[New LWP 18844]
[New LWP 18845]
[New LWP 18846]
[New LWP 18847]
[New LWP 18848]
[New LWP 18849]
[New LWP 18850]
[New LWP 18851]
[New LWP 18852]
[New LWP 18853]
[New LWP 18854]
[New LWP 18855]
[New LWP 18856]
[New LWP 18857]
[New LWP 18865]
[New LWP 18871]
[New LWP 18872]
[New LWP 18873]
[New LWP 18874]
[New LWP 18875]
[New LWP 18876]
[New LWP 18877]
[New LWP 18878]
[New LWP 18879]
[New LWP 18880]
[New LWP 18882]
[New LWP 18888]
[New LWP 18906]
[New LWP 19115]
[New LWP 19410]
[New LWP 19413]
[New LWP 19414]
[New LWP 19415]
[New LWP 19418]
[New LWP 19420]
[New LWP 19421]
[New LWP 19423]
[New LWP 19427]
[New LWP 19428]
[New LWP 19429]
[New LWP 19430]
[New LWP 19431]
[New LWP 19432]
[New LWP 19433]
[New LWP 19434]
[New LWP 19435]
[New LWP 19436]
[New LWP 19437]
[New LWP 19438]
[New LWP 19439]
[New LWP 19440]
[New LWP 19441]
[New LWP 19442]
[New LWP 19443]
[New LWP 19444]
[New LWP 19445]
[New LWP 19448]
[New LWP 19449]
[New LWP 19450]
[New LWP 19451]
[New LWP 19452]
[New LWP 19453]
[New LWP 19454]
[New LWP 19455]
[New LWP 19456]
[New LWP 19457]
[New LWP 19458]
[New LWP 19459]
[New LWP 19460]
[New LWP 19461]
[New LWP 19462]
[New LWP 19463]
[New LWP 19464]
[New LWP 19465]
[New LWP 19466]
[New LWP 19467]
[New LWP 19468]
[New LWP 19469]
[New LWP 19470]
[New LWP 19471]
[New LWP 19472]
[New LWP 19473]
[New LWP 19474]
[New LWP 19475]
[New LWP 19476]
[New LWP 19477]
[New LWP 19478]
[New LWP 19479]
[New LWP 19480]
[New LWP 19481]
[New LWP 19482]
[New LWP 19483]
[New LWP 19484]
[New LWP 19485]
[New LWP 19487]
[New LWP 19488]
[New LWP 19489]
[New LWP 19490]
[New LWP 19491]
[New LWP 19492]
[New LWP 19493]
[New LWP 19494]
[New LWP 19495]
[New LWP 19496]
[New LWP 19497]
[New LWP 19498]
[New LWP 19499]
[New LWP 19500]
[New LWP 19501]
[New LWP 19502]
[New LWP 19504]
[New LWP 19505]
[New LWP 19506]
[New LWP 19507]
[New LWP 19508]
[New LWP 19509]
[New LWP 19510]
[New LWP 19511]
[New LWP 19512]
[New LWP 19513]
[New LWP 19514]
[New LWP 19515]
[New LWP 19516]
[New LWP 19517]
[New LWP 19518]
[New LWP 19519]
[New LWP 19520]
[New LWP 19521]
[New LWP 19523]
[New LWP 19526]
[New LWP 19527]
[New LWP 19528]
[New LWP 19529]
[New LWP 19538]
[New LWP 19543]
[New LWP 19546]
[New LWP 19548]
[New LWP 19549]
[New LWP 19550]
[New LWP 19551]
[New LWP 19552]
[New LWP 19553]
[New LWP 19554]
[New LWP 19555]
[New LWP 19556]
[New LWP 19557]
[New LWP 19558]
[New LWP 19559]
[New LWP 19560]
[New LWP 19561]
[New LWP 19562]
[New LWP 19563]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".



First I thought my data is too big but reduction does not help (the debug log is already on a reduced snippet). 

The format of the prediction file being tested (which I had to figure out myself because the program does not accept the format of predictions it itself produces) is the standard triplets (user, item, score).  
mml_threads.png

Zeno Gantner

unread,
Apr 27, 2019, 2:34:16 PM4/27/19
to mymed...@googlegroups.com
Hello Petr,
interesting.

Do you also see the behaviour if you replace the Parallel.ForEach in Eval.Items.cs with a normal ForEach loop?
Or you can modify MaxDegreeOfParallelism in ParallelOptions and pass this to the Parallel.ForEach.

I would expect that Mono only uses as many threads as there are cores.

Something is odd, I would say.

Cheers,
   Z.


--
You received this message because you are subscribed to the Google Groups "MyMediaLite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mymedialite...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Petr Sobotka

unread,
Apr 29, 2019, 5:45:56 AM4/29/19
to MyMediaLite
Thanks for this hint. I'm not very familiar with parallel programming and unfortunately not even with C#, but...

I tried to modify the source file Eval/IItems.cs in the following way:

(...)
var po = new ParallelOptions
{
   
MaxDegreeOfParallelism = 4
};
           
Parallel.ForEach(test_users, po, user_id => {
(...)


And it works fine. Only 4 threads now. I even tried to make it standard foreach. Complete modified source file in the attachment. Maybe it can help somebody else. 

What occured to me is that the code of ExternalItemRecommneder uses the DataSet in a very inefficient way effectively leading to a complexity of <num_users> * <num_items> * <num_items> which very easily climbs into billions of iterations. Maybe it also causes unintended thread locks.

In words: for every candidate item being tested ExternalIemRecommender  iterates the whole dataset linearly. 
I modified the code to use indexes, leading to decreased complexity. 

Example on my pruned dataset: 2.000 users, 30.000 items, 20 items recommended per user (not very large dataset IMHO). 
On a 4 core CPU it used to run for almost 4 hours. Now it runs under 30 seconds. 


Further improvement is totally possible, because it makes no sense to iterate over all candidate item. Just finding the intersection between items in test file and external predictions file would be enough. But This probably means overloading a re-implementing the Recommender.cs::Recommend() method. Unfortunately I don't feel I'm able to do it. 


Items.cs

Zeno Gantner

unread,
Apr 29, 2019, 10:41:31 AM4/29/19
to mymed...@googlegroups.com
OK.
After your fix (the efficiency one), do you still see the threading behavior?
Because I still do not have a good explanation for it.

Cheers,
   Z.

Petr Sobotka

unread,
May 3, 2019, 5:08:48 AM5/3/19
to MyMediaLite
I still see it although it is not that significant. 

I used larger data 

training data: 48912 users,  87954 items, 244560 events, sparsity 99.99432
test data
:     40025 users, 116271 items, 366344 events, sparsity 99.99213

with 50 predicted items per user.  It run on a 4-core CPU for 40 minutes and the number of running threads climbed to approx. 90. 




Dne pondělí 29. dubna 2019 16:41:31 UTC+2 Zeno Gantner napsal(a):
To unsubscribe from this group and stop receiving emails from it, send an email to mymed...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages