Deokjae Lee created MXNET-259:
---------------------------------

             Summary: Performance improvement of random.shuffle
                 Key: MXNET-259
                 URL: https://issues.apache.org/jira/browse/MXNET-259
             Project: Apache MXNet
          Issue Type: Improvement
            Reporter: Deokjae Lee


For multidimensional arrays on CPU, `mx.random.shuffle` implements Fisher-Yates 
algorithm which needs `n` number of swaps of two memory ranges where `n` is the 
length of the first axis. Previously the swap is performed by 
`std::swap_ranges`. This PR replaces it with a manual swap using `std::memcpy`. 
This brings a good performance gain. For example, shuffling of arrays with 
shape `(1000, 10000)` is almost ten times faster. (1D arrays on CPU and arrays 
on GPU are not in the scope of this PR.)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to