Thank you for your investigation, and results! It looks like the relatively more complex computation of matrix multiplication does indeed scale better with more threads, which is reassuring.
Interesting that the high thread numbers were slightly counter-productive at 4x4, and plateaued at 8x8. It would be potentially interesting to run each of those a number of times to eliminate caching and CPU heat-slowdown as factors. Though the plateau isn’t very surprising, given memory bandwidth being a probable issue. Best regards, Ed From: Luis Mochán<mailto:moc...@icf.unam.mx> Sent: 09 July 2022 22:28 To: Ed .<mailto:ej...@hotmail.com> Cc: Eric Wheeler<mailto:p...@lists.ewheeler.net>; pdl-general@lists.sourceforge.net<mailto:pdl-general@lists.sourceforge.net> Subject: Re: [Pdl-general] How do you create a set of cdouble matrices from (real, imag) values? On Fri, Jul 08, 2022 at 05:53:19PM +0000, Ed . wrote: > Hi Luis, > > Glad to hear that more substantial speedups are possible with matrix > multiplication! What results are you seeing? Here are some examples for 2x2, 4x4 and 8x8 matrix multiplications: 2x2: mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(2,2,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 0 Time: 0.080798864364624 Threads: 0 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(2,2,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 2 Time: 0.0626440048217773 Threads: 2 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(2,2,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 4 Time: 0.0534470081329346 Threads: 4 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(2,2,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 8 Time: 0.041100025177002 Threads: 8 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(2,2,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' Time: 0.0347418785095215 Threads: 48 4x4: mochan@tlahuilli:~$ mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(4,4,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 0 Time: 0.250298976898193 Threads: 0 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(4,4,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 2 Time: 0.169501066207886 Threads: 2 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(4,4,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 4 Time: 0.126749038696289 Threads: 4 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(4,4,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 8 Time: 0.113579988479614 Threads: 8 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(4,4,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' Time: 0.132315874099731 Threads: 48 8x8: mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(8,8,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 0 Time: 1.30779314041138 Threads: 0 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(8,8,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 2 Time: 0.862032890319824 Threads: 2 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(8,8,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 4 Time: 0.621423959732056 Threads: 4 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(8,8,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' 8 Time: 0.449688911437988 Threads: 8 mochan@tlahuilli:~$ perl -MTime::HiRes=time -MPDL -E 'set_autopthread_targ(shift) if @ARGV; $x = random(8,8,500,5000); $t=time; $z=$x x $x; say "Time: ",time-$t; say "Threads: ", get_autopthread_actual();' Time: 0.44658899307251 Threads: 48 Regards, Luis -- o W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ Av. Universidad s/n CP 62210 | (*)/\/ \ Cuernavaca, Morelos, México | moc...@fis.unam.mx /\_/\__/ GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB
_______________________________________________ pdl-general mailing list pdl-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-general