Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Add oneDNN support for reduce operators #20669

Merged
merged 9 commits into from
Nov 26, 2021

Conversation

bgawrych
Copy link
Contributor

Description

Add oneDNN support for reduction operators: sum and mean, for both nd and np interfaces

@mxnet-bot
Copy link

Hey @bgawrych , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [sanity, miscellaneous, website, centos-cpu, clang, centos-gpu, windows-gpu, windows-cpu, unix-cpu, unix-gpu, edge]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress labels Oct 14, 2021
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Oct 19, 2021
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Oct 26, 2021
@mseth10 mseth10 added pr-awaiting-review PR is waiting for code review and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Nov 16, 2021
Copy link
Contributor

@bartekkuncer bartekkuncer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Only some cosmetic changes.

src/operator/nn/dnnl/dnnl_reduce.cc Outdated Show resolved Hide resolved
src/operator/nn/dnnl/dnnl_reduce.cc Show resolved Hide resolved
src/operator/nn/dnnl/dnnl_reduce.cc Outdated Show resolved Hide resolved
src/operator/nn/dnnl/dnnl_reduce-inl.h Outdated Show resolved Hide resolved
src/operator/nn/dnnl/dnnl_reduce.cc Show resolved Hide resolved
src/operator/nn/dnnl/dnnl_reduce.cc Outdated Show resolved Hide resolved
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-awaiting-review PR is waiting for code review pr-awaiting-testing PR is reviewed and waiting CI build and test labels Nov 19, 2021
@bgawrych
Copy link
Contributor Author

@mxnet-bot run ci [miscellaneous, windows-gpu]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [miscellaneous, windows-gpu]

@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-awaiting-review PR is waiting for code review and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Nov 19, 2021
@bgawrych
Copy link
Contributor Author

Perf results on CLX8280 (28 cores):

image

Script:

import mxnet
import mxnet.gluon.nn as nn
import mxnet.numpy as np
import time

dims = [128, 512, 1024, 4096]
print("shape;axis;time;mean")
for ndim in range (2):
   for dim1 in dims:
     for dim2 in dims:
        shape = (dim1, dim2) if ndim == 0 else (32, dim1, dim2)
        a = np.random.uniform(-1.0, 1.0, shape).astype(np.float32)
        for axis in range(2 + ndim):
            tic = time.time()
            for i in range(100):
                out = np.mean(a, axis=axis)
                out.wait_to_read()
            toc = time.time()
            print(f"{shape};{axis};{toc-tic}")

@bgawrych
Copy link
Contributor Author

Merging, @szha if there is any procedure of merging own commits let me know

@bgawrych bgawrych merged commit f67b222 into apache:master Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants