tlby opened a new pull request #7815: [Perl] reduce buffer copies in 
NDArray<->PDL conversions
URL: https://github.com/apache/incubator-mxnet/pull/7815
 
 
   A bit of profiling and research lead me to try the performance test 
suggested in #2739 for Perl.  The performance test code
   ```perl
   #!/usr/bin/perl
   use strict;
   use warnings;
   use AI::MXNet 'mx';
   use Benchmark;
   
   my $a = mx->random->normal(0, 1, [ 4, 1024, 1024 ]);
   mx->nd->waitall();
   
   my $p = $a->aspdl;
   my $size = length(${$p->get_dataref}) / 2 ** 30;
   
   my $t = Benchmark::countit(-4, sub { $a->aspdl });
   printf("GB/s: %g\n", $t->iters * $size / $t->[0]);
   ```
   gave me `GB/s: 0.851562` on master.  after looking into the code a bit, this 
patch brings the performance test to `GB/s: 8.35156` due to reduced buffer 
copying overhead.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to