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

Fused LSTM grad-grad #3256

Merged
merged 3 commits into from Oct 14, 2017
Merged

Fused LSTM grad-grad #3256

merged 3 commits into from Oct 14, 2017

Conversation

unnonouno
Copy link
Member

LSTM grad-grad calls too many kernels. I used cupy.fuse to combine them.
Merge #3206 first.

@unnonouno unnonouno added cat:enhancement Implementation that does not break interfaces. st:ready-for-review cat:feature Implementation that introduces new interfaces. labels Sep 4, 2017
@okuta okuta self-assigned this Sep 18, 2017
@okuta
Copy link
Member

okuta commented Sep 18, 2017

jenkins, test this please.

return cuda.fusion.tanh(x * half) * half + half


@cuda.fuse()
Copy link
Member

Choose a reason for hiding this comment

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

How about using input_num?
lstm_grad_grad will accept writable arguments.

@cuda.fuse(input_num=13)
def lstm_grad_grad(
        c_prev, a, i, f, o, c, gc, gh, ggc_prev, gga, ggi, ggf, ggo,
        gc_prev, ga, gi, gf, go, gc_next, ggc, ggh):

Copy link
Member Author

Choose a reason for hiding this comment

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

How to fix?

Copy link
Member

Choose a reason for hiding this comment

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

I wrote sample. That kernel will reduce array copy.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, This is my mistake.

@okuta okuta added st:awaiting-author State indicating that response is needed from contributors, often authors of pull request. and removed st:ready-for-review labels Sep 19, 2017
@okuta
Copy link
Member

okuta commented Oct 14, 2017

LGTM!

@okuta okuta merged commit 9e9a9e1 into chainer:master Oct 14, 2017
@unnonouno unnonouno deleted the lstm-fusion branch October 15, 2017 02:56
@beam2d beam2d added this to the v4.0.0a1 milestone Oct 17, 2017
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. cat:feature Implementation that introduces new interfaces. st:awaiting-author State indicating that response is needed from contributors, often authors of pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants