Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve F.rsqrt performance in CPU #4538

Merged
merged 1 commit into from Apr 3, 2018

Conversation

kmaehashi
Copy link
Member

F.rsqrt optimization for GPU (#4108) made significant performance regression (about 20 times slower) in backward computation when CPU is used.
I separated the code between CPU and GPU to fix this issue.

CPU performance before applying this PR:

  • Forward: 1.63ms
  • Backward: 70.44ms

CPU performance after applying this PR:

  • Forward: 1.75ms
  • Backward: 3.71ms

Benchmark code: https://github.com/kmaehashi/chainer-benchmark/blob/master/benchmarks/functions/math/sqrt.py#L20
Data: float32 shape=(1000, 1000)

@kmaehashi kmaehashi added cat:enhancement Implementation that does not break interfaces. to-be-backported Pull request that should be backported. labels Mar 29, 2018
@kmaehashi kmaehashi added this to the v5.0.0a1 milestone Mar 29, 2018
@okuta okuta self-assigned this Mar 29, 2018
@okuta
Copy link
Member

okuta commented Apr 3, 2018

LGTM!

@okuta okuta merged commit 9f64c77 into chainer:master Apr 3, 2018
@kmaehashi kmaehashi deleted the fix-rsqrt-backward branch April 17, 2018 04:07
kmaehashi pushed a commit to kmaehashi/chainer that referenced this pull request Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:enhancement Implementation that does not break interfaces. to-be-backported Pull request that should be backported.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants