You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/08 20:21:21 UTC
[GitHub] tlby opened a new pull request #7815: [Perl] reduce buffer copies in NDArray<->PDL conversions
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:
users@infra.apache.org
With regards,
Apache Git Services