Implement true GRU and RNN runtime kernels and layer classes in kernel.cu#39
Open
Implement true GRU and RNN runtime kernels and layer classes in kernel.cu#39
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
GRULayer/RNNLayerbehave correctly when created/initialized through base pointers.Description
kGRUGatesForward,kGRUGatesBackward,kRNNForward, andkRNNBackwardimplementing GRU (update/reset/candidate) and vanilla RNN (tanh) math.GRULayerandRNNLayeroverrides (Init,InitFromData,Forward,Backward,Update,SaveBest,RestoreBest) that use correct gate dimensions (3 * hidden_sizefor GRU,1 * hidden_sizefor RNN) and integrate with existing cuBLAS/cu kernels.LSTMLayermethodsFreeAll,Init, andInitFromDatavirtualso derived layers' implementations are invoked through base-class pointers.kernel.cuand aim only to correct recurrent-layer runtime/gradient behavior and memory layouts.Testing
rgto verify the new kernels and layer overrides (kGRUGatesForward,kRNNForward, virtualInit), which succeeded.nl/ code review) to confirm insertion points and gate-dimension adjustments, which succeeded.nvcc -std=c++17 -c kernel.cubut compilation could not be run in this environment becausenvccis not available; no runtime binary tests were executed.Codex Task