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

RNN Dynamic algo single stream #3406

Merged
merged 23 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/miopen/miopen.h
Original file line number Diff line number Diff line change
Expand Up @@ -3748,10 +3748,12 @@ typedef enum
*/
typedef enum
{
miopenRNNdefault = 0, /*!< Use dedicated gate-operation kernel for LSTM and fundamental
algorithm for vanilla RNN & GRU */
miopenRNNfundamental =
1, /*!< Function by basic tesnsor operations, supported for vanilla RNN, LSTM, GRU */
miopenRNNdefault = 0, /*!< Use dedicated gate-operation kernel for LSTM and fundamental
algorithm for vanilla RNN & GRU */
miopenRNNfundamental = 1, /*!< Deprecated, low performance. Function by basic tesnsor
operations, supported for vanilla RNN, LSTM, GRU */
miopenRNNroundedDynamic = 2, /*!< The algorithm rounds some RNN parametrs upwards
to utilize the most optimal GEMM kernel in the computation.*/
} miopenRNNAlgo_t;

/*! @enum miopenRNNDirectionMode_t
Expand Down
9 changes: 9 additions & 0 deletions src/include/miopen/rnn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ struct MIOPEN_INTERNALS_EXPORT RNNDescriptor : miopenRNNDescriptor
miopenRNNFWDMode_t fwdMode) const;
size_t GetMaxReserveSize(Handle& handle, const SeqTensorDescriptor& xDesc) const;

std::tuple<size_t, size_t> GetTmpSpaceSizeDynamicAlgo(Handle& handle,
const SeqTensorDescriptor& xDesc,
miopenRNNFWDMode_t fwdMode) const;
bool CheckDynamicAlgoSelection(Handle& handle,
const SeqTensorDescriptor& xDesc,
miopenRNNFWDMode_t fwdMode) const;

size_t
GetParamsSize(Handle& handle, const TensorDescriptor& xDesc, miopenDataType_t dtype) const;
size_t GetParamsSize(size_t inputVector) const;
Expand Down Expand Up @@ -534,6 +541,8 @@ struct MIOPEN_INTERNALS_EXPORT RNNDescriptor : miopenRNNDescriptor
Data_t hy,
const TensorDescriptor& cyDesc,
Data_t cy,
Data_t workSpace,
size_t workSpaceSize,
Data_t reserveSpace,
size_t reserveSpaceSize) const;

Expand Down
Loading
Loading