-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[PERFORMANCE] Improve shuffle implementation #20928
Conversation
Hey @anko-intel , Thanks for submitting the PR
CI supported jobs: [edge, centos-gpu, sanity, unix-cpu, windows-gpu, unix-gpu, clang, website, miscellaneous, centos-cpu, windows-cpu] Note: |
772d880
to
b4ac568
Compare
src/operator/random/shuffle_op.cc
Outdated
@@ -78,28 +78,37 @@ void ShuffleND(DType* const out, | |||
std::shuffle(index.begin(), index.end(), *prnd); | |||
if (reqT != kWriteInplace) { | |||
for (index_t i = 0; i < first_axis_len; ++i) { | |||
auto j = index[i]; | |||
std::memcpy(out + stride * j, in + stride * i, stride_bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following error occurs after first comit:
/work/mxnet/src/operator/random/shuffle_op.cc:82:18: error: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'class mshadow::half::half_t' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
@mxnet-bot run ci [windows-cpu, windows-gpu] |
Jenkins CI successfully triggered : [windows-gpu, windows-cpu] |
@mxnet-bot run ci [windows-cpu, windows-gpu, unix-cpu] |
Jenkins CI successfully triggered : [windows-cpu, windows-gpu, unix-cpu] |
@mxnet-bot run ci [unix-cpu, centos-gpu, windows-gpu] |
Jenkins CI successfully triggered : [unix-cpu, centos-gpu, windows-gpu] |
@mxnet-bot run ci [centos-gpu, windows-gpu] |
Jenkins CI successfully triggered : [windows-gpu, centos-gpu] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Improve performance of random.shuffle implementation.
Results on c6i.8xlarge instance ( Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz ) of the follwing script
shows following improvments:
Checklist
Essentials