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

[FFI] part5: npx.batch_dot, npx.arange_like, npx.broadcast_like #20110

Merged
merged 5 commits into from
Apr 14, 2021

Conversation

barry-jin
Copy link
Contributor

Description

part5 of #20096
Benchmarks
npx.batch_dot

setup = """
from mxnet import np, npx
npx.set_np()
a = np.arange(24).reshape(2, 3, 4)
b = np.arange(24).reshape(2, 4, 3)
"""
stmt = """
out = npx.batch_dot(a, b, transpose_a=False, transpose_b=False, forward_stype="default")
"""
timer = timeit.Timer(setup=setup,
                     stmt=stmt)
num_repeat = 1000
print(min(timer.repeat(repeat=10, number=num_repeat)) / num_repeat)

legacy
0.00012874629299999984
New FFI
8.044332199999981e-05

npx.arange_like

setup = """
from mxnet import np, npx
npx.set_np()
inp = np.zeros((10, 2))
"""
stmt = """
out = npx.arange_like(inp, start=0.0, step=1.0, repeat=1, axis=None)
"""
timer = timeit.Timer(setup=setup,
                     stmt=stmt)
num_repeat = 1000
print(min(timer.repeat(repeat=10, number=num_repeat)) / num_repeat)

legacy
0.00011809111199999967
New FFI
7.085974700000009e-05

npx.broadcast_like

setup = """
from mxnet import np, npx
npx.set_np()
a = np.ones((1, 2))
b = np.zeros((10, 2))
"""
stmt = """
out = npx.broadcast_like(a, b, lhs_axes=None, rhs_axes=None)"""
timer = timeit.Timer(setup=setup,
                     stmt=stmt)
num_repeat = 1000
print(min(timer.repeat(repeat=10, number=num_repeat)) / num_repeat)

legacy
0.00010836260899999983
New FFI
7.267426700000002e-05

Checklist

Essentials

  • PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@barry-jin barry-jin requested a review from szha as a code owner March 31, 2021 20:39
@mxnet-bot
Copy link

Hey @barry-jin , 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: [website, centos-gpu, edge, unix-cpu, windows-gpu, windows-cpu, sanity, centos-cpu, miscellaneous, unix-gpu, clang]


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.

@lanking520 lanking520 added the pr-awaiting-testing PR is reviewed and waiting CI build and test label Mar 31, 2021
@lanking520 lanking520 added pr-work-in-progress PR is still work in progress and removed pr-awaiting-testing PR is reviewed and waiting CI build and test labels Mar 31, 2021
@lanking520 lanking520 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 Mar 31, 2021
@lanking520 lanking520 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 Mar 31, 2021
@lanking520 lanking520 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 Apr 1, 2021
@barry-jin
Copy link
Contributor Author

@mxnet-bot run ci [centos-cpu, unix-cpu]

@mxnet-bot
Copy link

Jenkins CI successfully triggered : [centos-cpu, unix-cpu]

@lanking520 lanking520 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 Apr 7, 2021
@lanking520 lanking520 removed the pr-work-in-progress PR is still work in progress label Apr 13, 2021
@lanking520 lanking520 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-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 13, 2021
@szha szha merged commit f591b62 into apache:master Apr 14, 2021
@barry-jin barry-jin deleted the ffi_npx_5 branch August 4, 2021 21:23
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.

4 participants