MIOpen Porting Guide VERSION 1.0 JULY, 2017

Key differences between MIOpen v1.0 and cuDNN: • • • • •

• • •

MIOpen only supports 4-D tensors in the NCHW storage format. This means all the “*Nd*” APIs in cuDNN do not have a corresponding API in MIOpen. MIOpen only supports float (fp32) data-type. MIOpen only supports 2D Convolutions and 2D Pooling. Calling miopenFindConvolution*Algorithm() is mandatory before calling any Convolution API. Typical calling sequence for Convolution APIs for MIOpen is: o miopenConvolution*GetWorkSpaceSize() // returns the workspace size required by Find() o miopenFindConvolution*Algorithm() // returns performance info about various algorithms o miopenConvolution*() MIOpen does not support Preferences for convolutions. MIOpen does not support Softmax modes. MIOpen implements the SOFTMAX_MODE_CHANNEL flavor. MIOpen does not support Transform-Tensor, Dropout, RNNs, and Divisive Normalization.

Helpful MIOpen Environment Variables MIOPEN_ENABLE_LOGGING=1 – log all the MIOpen APIs called including the parameters passed to those APIs. MIOPEN_DEBUG_AMD_ROCM_PRECOMPILED_BINARIES=0 – disable Winograd convolution algorithm. MIOPEN_DEBUG_GCN_ASM_KERNELS=0 – disable hand-tuned asm. kernels for Direct convolution algorithm. Fall-back to kernels written in high-level language. MIOPEN_DEBUG_CONV_FFT=0 – disable FFT convolution algorithm. MIOPEN_DEBUG_CONV_DIRECT=0 – disable Direct convolution algorithm.

Operation

cuDNN API

MIOpen API

cudnnStatus_t cudnnCreate(cudnnHandle_t *handle)

miopenStatus_t miopenCreate(miopenHandle_t *handle) miopenStatus_t miopenDestroy(miopenHandle_t handle) miopenStatus_t miopenSetStream(miopenHandle_t handle, miopenAcceleratorQueue_t streamID) miopenStatus_t miopenGetStream(miopenHandle_t handle, miopenAcceleratorQueue_t *streamID) miopenStatus_t miopenCreateTensorDescriptor(miop enTensorDescriptor_t *tensorDesc) // Only NCHW format is supported miopenStatus_t miopenSet4dTensorDescriptor( miopenTensorDescriptor_t tensorDesc, miopenDataType_t dataType, int n, int c, int h, int w) miopenStatus_t miopenGet4dTensorDescriptor( miopenTensorDescriptor_t tensorDesc, miopenDataType_t *dataType, int *n, int *c, int *h, int *w, int *nStride, int *cStride, int *hStride, int *wStride) miopenStatus_t miopenDestroyTensorDescriptor(mio penTensorDescriptor_t tensorDesc)

cudnnStatus_t cudnnDestroy(cudnnHandle_t handle) Handle

cudnnStatus_t cudnnSetStream(cudnnHandle_t handle, cudaStream_t streamId) cudnnStatus_t cudnnGetStream(cudnnHandle_t handle, cudaStream_t *streamId) cudnnStatus_t cudnnCreateTensorDescriptor(cudnnT ensorDescriptor_t *tensorDesc) cudnnStatus_t cudnnSetTensor4dDescriptor(cudnnTe nsorDescriptor_t tensorDesc, cudnnTensorFormat_t format, cudnnDataType_t dataType, int n, int c, int h, int w) cudnnStatus_t cudnnGetTensor4dDescriptor(cudnnTe nsorDescriptor_t tensorDesc, cudnnDataType_t *dataType, int *n, int *c, int *h, int *w, int *nStride, int *cStride, int *hStride, int *wStride)

Tensor

cudnnStatus_t cudnnDestroyTensorDescriptor(cudnn TensorDescriptor_t tensorDesc) cudnnStatus_t cudnnAddTensor(cudnnHandle_t handle, const void *alpha, const cudnnTensorDescriptor_t aDesc, const void *A, const void *beta, const cudnnTensorDescriptor_t cDesc, void *C)

// Set tensorOp to miopenOpTensorAdd miopenStatus_t miopenOpTensor(miopenHandle_t handle, miopenTensorOp_t tensorOp, const void *alpha1, const miopenTensorDescriptor_t aDesc, const void *A, const void *alpha2, const miopenTensorDescriptor_t bDesc, const void *B, const void *beta, const miopenTensorDescriptor_t cDesc, void *C) // For Forward Bias use, miopenConvolutionForwardBias

Operation

Tensor

Filter

Convolution

cuDNN API cudnnStatus_t cudnnOpTensor(cudnnHandle_t handle, const cudnnOpTensorDescriptor_t opTensorDesc, const void *alpha1, const cudnnTensorDescriptor_t aDesc, const void *A, const void *alpha2, const cudnnTensorDescriptor_t bDesc, const void *B, const void *beta, const cudnnTensorDescriptor_t cDesc, void *C) cudnnStatus_t cudnnSetTensor( cudnnHandle_t handle, const cudnnTensorDescriptor_t yDesc, void *y, const void *valuePtr) cudnnStatus_t cudnnScaleTensor(cudnnHandle_t handle, const cudnnTensorDescriptor_t yDesc, void *y, const void *alpha) cudnnStatus_t cudnnCreateFilterDescriptor( cudnnFilterDescriptor_t *filterDesc) cudnnStatus_t cudnnCreateConvolutionDescriptor(c udnnConvolutionDescriptor_t *convDesc)

MIOpen API miopenStatus_t miopenOpTensor(miopenHandle_t handle, miopenTensorOp_t tensorOp, const void *alpha1, const miopenTensorDescriptor_t aDesc, const void *A, const void *alpha2, const miopenTensorDescriptor_t bDesc, const void *B, const void *beta, const miopenTensorDescriptor_t cDesc, void *C) miopenStatus_t miopenSetTensor(miopenHandle_t handle, const miopenTensorDescriptor_t yDesc, void *y, const void *alpha) miopenStatus_t miopenScaleTensor(miopenHandle_t handle, const miopenTensorDescriptor_t yDesc, void *y, const void *alpha) // All *FilterDescriptor* APIs are substituted by the respective TensorDescriptor APIs miopenStatus_t miopenCreateConvolutionDescriptor (miopenConvolutionDescriptor_t *convDesc)

Operation

Convolution

cuDNN API cudnnStatus_t cudnnSetConvolution2dDescriptor(cu dnnConvolutionDescriptor_t convDesc, int pad_h, int pad_w, int u, int v, int upscalex, int upscaley cudnnConvolutionMode_t mode) cudnnStatus_t cudnnGetConvolution2dDescriptor(co nst cudnnConvolutionDescriptor_t convDesc, int *pad_h, int *pad_y, int *u, int *v, int *upscalex, int *upscaley, cudnnConvolutionMode_t *mode) cudnnStatus_t cudnnGetConvolution2dForwardOutput Dim(const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t inputTensorDesc, const cudnnFilterDescriptor_t filterDesc, int *n, int *c, int *h, int *w) cudnnStatus_t cudnnDestroyConvolutionDescriptor( cudnnConvolutionDescriptor_t convDesc) cudnnStatus_t cudnnFindConvolutionForwardAlgorit hm(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnFilterDescriptor_t wDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t yDesc, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionFwdAlgoPerf_t *perfResults)

MIOpen API miopenStatus_t miopenInitConvolutionDescriptor(m iopenConvolutionDescriptor_t convDesc, miopenConvolutionMode_t mode, int pad_h, int pad_w, int u, int v, int upscalex, int upscaley) miopenStatus_t miopenGetConvolutionDescriptor(mi openConvolutionDescriptor_t convDesc, miopenConvolutionMode_t *mode, int *pad_h, int *pad_y, int *u, int *v, int *upscalex, int *upscaley) miopenStatus_t miopenGetConvolutionForwardOutput Dim(miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t inputTensorDesc, const miopenTensorDescriptor_t filterDesc, int *n, int *c, int *h, int *w)

miopenStatus_t miopenDestroyConvolutionDescripto r(miopenConvolutionDescriptor_t convDesc) // FindConvolution() is mandatory // Allocate workspace prior to running this API // A table with times and memory requirements for different algorithms is returned // Users can chose the top-most algorithm if they only care about the fastest algorithm miopenStatus_t miopenFindConvolutionForwardAlgor ithm(miopenHandle_t handle, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t wDesc, const void *w, const cudnnStatus_t miopenConvolutionDescriptor_t cudnnFindConvolutionForwardAlgorit convDesc, hmEx(cudnnHandle_t handle, const miopenTensorDescriptor_t const cudnnTensorDescriptor_t yDesc, xDesc, void *y, const void *x, const int requestAlgoCount, const cudnnFilterDescriptor_t int *returnedAlgoCount, wDesc, miopenConvAlgoPerf_t *perfResults,

Operation

cuDNN API const void *w, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t yDesc, void *y, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionFwdAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSizeInBytes)

Convolution

cudnnStatus_t cudnnGetConvolutionForwardAlgorit hm(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnFilterDescriptor_t wDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t yDesc, cudnnConvolutionFwdPreference_t preference, size_t memoryLimitInBytes, cudnnConvolutionFwdAlgo_t *algo) cudnnStatus_t cudnnGetConvolutionForwardWorksp aceSize(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnFilterDescriptor_t wDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t yDesc, cudnnConvolutionFwdAlgo_t algo, size_t *sizeInBytes) cudnnStatus_t cudnnConvolutionForward(cudnnHan dle_t handle, const void *alpha, const cudnnTensorDescriptor_t xDesc, const void *x,

MIOpen API void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)

miopenStatus_t miopenConvolutionForwardGetWorkSpa ceSize(miopenHandle_t handle, const miopenTensorDescriptor_t wDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize)

miopenStatus_t miopenConvolutionForward(miopenHan dle_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x,

Operation

Convolution

cuDNN API

MIOpen API

const cudnnFilterDescriptor_t wDesc, const void *w, const cudnnConvolutionDescriptor_t convDesc, cudnnConvolutionFwdAlgo_t algo, void *workSpace, size_t workSpaceSizeInBytes, const void *beta, const cudnnTensorDescriptor_t yDesc, void *y) cudnnStatus_t cudnnConvolutionBackwardBias( cudnnHandle_t handle, const void *alpha, const cudnnTensorDescriptor_t dyDesc, const void *dy, const void *beta, const cudnnTensorDescriptor_t dbDesc, void *db) cudnnStatus_t cudnnFindConvolutionBackwardFilt erAlgorithm(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnFilterDescriptor_t dwDesc, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionBwdFilterAlgoPer f_t *perfResults)

const miopenTensorDescriptor_t wDesc, const void *w, const miopenConvolutionDescriptor_t convDesc, miopenConvFwdAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, void *workSpace, size_t workSpaceSize) miopenStatus_t miopenConvolutionBackwardBias(miop enHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const void *beta, const miopenTensorDescriptor_t dbDesc, void *db) // FindConvolution() is mandatory // Allocate workspace prior to running this API // A table with times and memory requirements for different algorithms is returned // Users can chose the top-most algorithm if they only care about the fastest algorithm

cudnnStatus_t cudnnFindConvolutionBackwardFilt erAlgorithmEx(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnTensorDescriptor_t dyDesc, const void *y, const

miopenStatus_t miopenFindConvolutionBackwardWeigh tsAlgorithm(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, void *dw, const int requestAlgoCount, int *returnedAlgoCount, miopenConvAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)

Operation

cuDNN API

MIOpen API

cudnnConvolutionDescriptor_t convDesc, const cudnnFilterDescriptor_t dwDesc, void *dw, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionBwdFilterAlgoPer f_t *perfResults, void *workSpace, size_t workSpaceSizeInBytes)

Convolution

cudnnStatus_t cudnnGetConvolutionBackwardFilte rAlgorithm(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnFilterDescriptor_t dwDesc, cudnnConvolutionBwdFilterPrefere nce_t preference, size_t memoryLimitInBytes, cudnnConvolutionBwdFilterAlgo_t *algo) cudnnStatus_t cudnnGetConvolutionBackwardFilte rWorkspaceSize(cudnnHandle_t handle, const cudnnTensorDescriptor_t xDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnFilterDescriptor_t gradDesc, cudnnConvolutionBwdFilterAlgo_t algo, size_t *sizeInBytes)

miopenStatus_t miopenConvolutionBackwardWeightsGe tWorkSpaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t xDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dwDesc, size_t *workSpaceSize)

Operation

cuDNN API

MIOpen API

Convolution

cudnnStatus_t cudnnConvolutionBackwardFilter( cudnnHandle_t handle, const void *alpha, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnConvolutionDescriptor_t convDesc, cudnnConvolutionBwdFilterAlgo_t algo, void *workSpace, size_t workSpaceSizeInBytes, const void *beta, const cudnnFilterDescriptor_t dwDesc, void *dw) cudnnStatus_t cudnnGetConvolutionBackwardDataWo rkspaceSize(cudnnHandle_t handle, const cudnnFilterDescriptor_t wDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t dxDesc, cudnnConvolutionBwdDataAlgo_t algo, size_t *sizeInBytes) cudnnStatus_t cudnnFindConvolutionBackwardDataA lgorithm(cudnnHandle_t handle, const cudnnFilterDescriptor_t wDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t dxDesc, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionBwdDataAlgoPerf_t *perfResults)

miopenStatus_t miopenConvolutionBackwardWeights( miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const miopenConvolutionDescriptor_t convDesc, miopenConvBwdWeightsAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t dwDesc, void *dw, void *workSpace, size_t workSpaceSize) miopenStatus_t miopenConvolutionBackwardDataGetW orkSpaceSize(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const miopenTensorDescriptor_t wDesc, const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, size_t *workSpaceSize)

// FindConvolution() is mandatory // Allocate workspace prior to running this API // A table with times and memory requirements for different algorithms is returned // Users can chose the top-most algorithm if they only care about the fastest algorithm miopenStatus_t miopenFindConvolutionBackwardData Algorithm(miopenHandle_t handle, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t wDesc, const void *w,

Operation

cuDNN API cudnnStatus_t cudnnFindConvolutionBackwardDataA lgorithmEx(cudnnHandle_t handle, const cudnnFilterDescriptor_t wDesc, const void *w, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t dxDesc, void *dx, const int requestedAlgoCount, int *returnedAlgoCount, cudnnConvolutionBwdDataAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSizeInBytes)

Convolution

MIOpen API const miopenConvolutionDescriptor_t convDesc, const miopenTensorDescriptor_t dxDesc, const void *dx, const int requestAlgoCount, int *returnedAlgoCount, miopenConvAlgoPerf_t *perfResults, void *workSpace, size_t workSpaceSize, bool exhaustiveSearch)

cudnnStatus_t cudnnGetConvolutionBackwardDataAl gorithm(cudnnHandle_t handle, const cudnnFilterDescriptor_t wDesc, const cudnnTensorDescriptor_t dyDesc, const cudnnConvolutionDescriptor_t convDesc, const cudnnTensorDescriptor_t dxDesc, cudnnConvolutionBwdDataPreference _t preference, size_t memoryLimitInBytes, cudnnConvolutionBwdDataAlgo_t *algo) cudnnStatus_t cudnnConvolutionBackwardData( cudnnHandle_t handle, const void *alpha, const cudnnFilterDescriptor_t wDesc, const void *w, const cudnnTensorDescriptor_t dyDesc, const void *dy,

miopenStatus_t miopenConvolutionBackwardData(mi openHandle_t handle, const void *alpha, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t wDesc, const void *w,

Operation

Convolution

Softmax

Pooling

cuDNN API

MIOpen API

const cudnnConvolutionDescriptor_t convDesc, cudnnConvolutionBwdDataAlgo_t algo, void *workSpace, size_t workSpaceSizeInBytes, const void *beta, const cudnnTensorDescriptor_t dxDesc, void *dx)

const miopenConvolutionDescriptor_t convDesc, miopenConvBwdDataAlgorithm_t algo, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, void *workSpace, size_t workSpaceSi ze) miopenStatus_t miopenSoftmaxForward(miopenHandl e_t handle, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)

cudnnStatus_t cudnnSoftmaxForward(cudnnHandle_t handle, cudnnSoftmaxAlgorithm_t algo, cudnnSoftmaxMode_t mode, const void *alpha, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t yDesc, void *y) cudnnStatus_t cudnnSoftmaxBackward( cudnnHandle_t handle, cudnnSoftmaxAlgorithm_t algo, cudnnSoftmaxMode_t mode, const void *alpha, const cudnnTensorDescriptor_t yDesc, const void *y, const cudnnTensorDescriptor_t dyDesc, const void *dy, const void *beta, const cudnnTensorDescriptor_t dxDesc, void *dx) cudnnStatus_t cudnnCreatePoolingDescriptor( cudnnPoolingDescriptor_t *poolingDesc) cudnnStatus_t cudnnSetPooling2dDescriptor( cudnnPoolingDescriptor_t poolingDesc, cudnnPoolingMode_t mode, cudnnNanPropagation_t maxpoolingNanOpt, int windowHeight, int windowWidth, int verticalPadding,

miopenStatus_t miopenSoftmaxBackward( miopenHandle_t handle, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx) miopenStatus_t miopenCreatePoolingDescriptor(mi openPoolingDescriptor_t *poolDesc) miopenStatus_t miopenSet2dPoolingDescriptor( miopenPoolingDescriptor_t poolDesc, miopenPoolingMode_t mode, int windowHeight, int windowWidth, int pad_h, int pad_w, int u, int v)

Operation

Pooling

cuDNN API int horizontalPadding, int verticalStride, int horizontalStride) cudnnStatus_t cudnnGetPooling2dDescriptor( const cudnnPoolingDescriptor_t poolingDesc, cudnnPoolingMode_t *mode, cudnnNanPropagation_t *maxpoolingNanOpt, int *windowHeight, int *windowWidth, int *verticalPadding, int *horizontalPadding, int *verticalStride, int *horizontalStride) cudnnStatus_t cudnnGetPooling2dForwardOutputDim( const cudnnPoolingDescriptor_t poolingDesc, const cudnnTensorDescriptor_t inputTensorDesc, int *n, int *c, int *h, int *w) cudnnStatus_t cudnnDestroyPoolingDescriptor( cudnnPoolingDescriptor_t poolingDesc) cudnnStatus_t cudnnPoolingForward( cudnnHandle_t handle, const cudnnPoolingDescriptor_t poolingDesc, const void *alpha, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t yDesc, void *y)

cudnnStatus_t cudnnPoolingBackward( cudnnHandle_t handle, const cudnnPoolingDescriptor_t poolingDesc, const void *alpha,

MIOpen API

miopenStatus_t miopenGet2dPoolingDescriptor( const miopenPoolingDescriptor_t poolDesc, miopenPoolingMode_t *mode, int *windowHeight, int *windowWidth, int *pad_h, int *pad_w, int *u, int *v)

miopenStatus_t miopenGetPoolingForwardOutputDim( const miopenPoolingDescriptor_t poolDesc, const miopenTensorDescriptor_t tensorDesc, int *n, int *c, int *h, int *w) miopenStatus_t miopenDestroyPoolingDescriptor( miopenPoolingDescriptor_t poolDesc) miopenStatus_t miopenPoolingForward( miopenHandle_t handle, const miopenPoolingDescriptor_t poolDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, bool do_backward, void *workSpace, size_t workSpaceSize) miopenStatus_t miopenPoolingGetWorkSpaceSize( const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize) miopenStatus_t miopenPoolingBackward( miopenHandle_t handle, const miopenPoolingDescriptor_t poolDesc, const void *alpha,

Operation

Pooling

cuDNN API const cudnnTensorDescriptor_t yDesc, const void *y, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t dxDesc, void *dx) cudnnStatus_t cudnnCreateActivationDescriptor( cudnnActivationDescriptor_t *activationDesc) cudnnStatus_t cudnnSetActivationDescriptor( cudnnActivationDescriptor_t activationDesc, cudnnActivationMode_t mode, cudnnNanPropagation_t reluNanOpt, double reluCeiling) cudnnStatus_t cudnnGetActivationDescriptor( const cudnnActivationDescriptor_t activationDesc, cudnnActivationMode_t *mode, cudnnNanPropagation_t *reluNanOpt, double* reluCeiling)

Activation cudnnStatus_t cudnnDestroyActivationDescriptor( cudnnActivationDescriptor_t activationDesc) cudnnStatus_t cudnnActivationForward( cudnnHandle_t handle, cudnnActivationDescriptor_t activationDesc, const void *alpha, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t yDesc, void *y)

MIOpen API const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, const void *workspace) miopenStatus_t miopenCreateActivationDescriptor( miopenActivationDescriptor_t *activDesc) miopenStatus_t miopenSetActivationDescriptor( const miopenActivationDescriptor_t activDesc, miopenActivationMode_t mode, double activAlpha, double activBeta, double activPower) miopenStatus_t miopenGetActivationDescriptor( const miopenActivationDescriptor_t activDesc, miopenActivationMode_t *mode, double *activAlpha, double *activBeta, double *activPower) miopenStatus_t miopenDestroyActivationDescriptor (miopenActivationDescriptor_t activDesc) miopenStatus_t miopenActivationForward( miopenHandle_t handle, const miopenActivationDescriptor_t activDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y)

Operation

Activation

cuDNN API cudnnStatus_t cudnnActivationBackward( cudnnHandle_t handle, cudnnActivationDescriptor_t activationDesc, const void *alpha, const cudnnTensorDescriptor_t yDesc, const void *y, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t dxDesc, void *dx) cudnnStatus_t cudnnCreateLRNDescriptor( cudnnLRNDescriptor_t *normDesc) cudnnStatus_t cudnnSetLRNDescriptor( cudnnLRNDescriptor_t normDesc, unsigned lrnN, double lrnAlpha, double lrnBeta, double lrnK) cudnnStatus_t cudnnGetLRNDescriptor( cudnnLRNDescriptor_t normDesc, unsigned* lrnN, double* lrnAlpha, double* lrnBeta, double* lrnK)

LRN cudnnStatus_t cudnnDestroyLRNDescriptor(cudnnLRN Descriptor_t lrnDesc) cudnnStatus_t cudnnLRNCrossChannelForward( cudnnHandle_t handle, cudnnLRNDescriptor_t normDesc, cudnnLRNMode_t lrnMode, const void* alpha, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t yDesc, void *y)

MIOpen API miopenStatus_t miopenActivationBackward( miopenHandle_t handle, const miopenActivationDescriptor_t activDesc, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx) miopenStatus_t miopenCreateLRNDescriptor(miopenL RNDescriptor_t *lrnDesc) miopenStatus_t miopenSetLRNDescriptor( const miopenLRNDescriptor_t lrnDesc, miopenLRNMode_t mode, unsigned lrnN, double lrnAlpha, double lrnBeta, double lrnK) miopenStatus_t miopenGetLRNDescriptor( const miopenLRNDescriptor_t lrnDesc, miopenLRNMode_t *mode, unsigned *lrnN, double *lrnAlpha, double *lrnBeta, double *lrnK) miopenStatus_t miopenDestroyLRNDescriptor(miopen LRNDescriptor_t lrnDesc) miopenStatus_t miopenLRNForward( miopenHandle_t handle, const miopenLRNDescriptor_t lrnDesc, const void *alpha, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t yDesc, void *y, bool do_backward, void *workspace)

Operation

LRN

Batch Normalization

cuDNN API cudnnStatus_t cudnnLRNCrossChannelBackward( cudnnHandle_t handle, cudnnLRNDescriptor_t normDesc, cudnnLRNMode_t lrnMode, const void* alpha, const cudnnTensorDescriptor_t yDesc, const void *y, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnTensorDescriptor_t xDesc, const void *x, const void *beta, const cudnnTensorDescriptor_t dxDesc, void *dx)

cudnnStatus_t cudnnDeriveBNTensorDescriptor( cudnnTensorDescriptor_t derivedBnDesc, const cudnnTensorDescriptor_t xDesc, cudnnBatchNormMode_t mode) cudnnStatus_t cudnnBatchNormalizationForwardTrai ning( cudnnHandle_t handle, cudnnBatchNormMode_t mode, void *alpha, void *beta, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnTensorDescriptor_t yDesc, void *y, const cudnnTensorDescriptor_t bnScaleBiasMeanVarDesc, void *bnScale, void *bnBias, double exponentialAverageFactor, void *resultRunningMean, void *resultRunningVariance, double epsilon, void *resultSaveMean, void *resultSaveInvVariance)

MIOpen API miopenStatus_t miopenLRNBackward( miopenHandle_t handle, const miopenLRNDescriptor_t lrnDesc, const void *alpha, const miopenTensorDescriptor_t yDesc, const void *y, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t xDesc, const void *x, const void *beta, const miopenTensorDescriptor_t dxDesc, void *dx, const void *workspace) miopenStatus_t miopenLRNGetWorkSpaceSize( const miopenTensorDescriptor_t yDesc, size_t *workSpaceSize) miopenStatus_t miopenDeriveBNTensorDescriptor( miopenTensorDescriptor_t derivedBnDesc, const miopenTensorDescriptor_t xDesc, miopenBatchNormMode_t bn_mode) miopenStatus_t miopenBatchNormalizationForwardTr aining( miopenHandle_t handle, miopenBatchNormMode_t bn_mode, void *alpha, void *beta, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc, void *bnScale, void *bnBias, double expAvgFactor, void *resultRunningMean, void *resultRunningVariance, double epsilon, void *resultSaveMean, void *resultSaveInvVariance)

Operation

cuDNN API

MIOpen API

Batch Normalization

cudnnStatus_t cudnnnBatchNormalizationForwardInf erence(cudnnHandle_t handle, cudnnBatchNormMode_t mode, void *alpha, void *beta, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnTensorDescriptor_t yDesc, void *y, const cudnnTensorDescriptor_t bnScaleBiasMeanVarDesc, const void *bnScale, void *bnBias, const void *estimatedMean, const void *estimatedVariance, double epsilon) cudnnStatus_t cudnnBatchNormalizationBackward( cudnnHandle_t handle, cudnnBatchNormMode_t mode, const void *alphaDataDiff, const void *betaDataDiff, const void *alphaParamDiff, const void *betaParamDiff, const cudnnTensorDescriptor_t xDesc, const void *x, const cudnnTensorDescriptor_t dyDesc, const void *dy, const cudnnTensorDescriptor_t dxDesc, void *dx, const cudnnTensorDescriptor_t bnScaleBiasDiffDesc, const void *bnScale, void *resultBnScaleDiff, void *resultBnBiasDiff, double epsilon, const void *savedMean, const void *savedInvVariance)

miopenStatus_t miopenBatchNormalizationForwardIn ference(miopenHandle_t handle, miopenBatchNormMode_t bn_mode, void *alpha, void *beta, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, const miopenTensorDescriptor_t bnScaleBiasMeanVarDesc, void *bnScale, void *bnBias, void *estimatedMean, void *estimatedVariance, double epsilon) miopenStatus_t miopenBatchNormalizationBackward( miopenHandle_t handle, miopenBatchNormMode_t bn_mode, const void *alphaDataDiff, const void *betaDataDiff, const void *alphaParamDiff, const void *betaParamDiff, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t dxDesc, void *dx, const miopenTensorDescriptor_t bnScaleBiasDiffDesc, const void *bnScale, void *resultBnScaleDiff, void *resultBnBiasDiff, double epsilon, const void *savedMean, const void *savedInvVariance)

MIOpen Porting Guide - GitHub

cudnnCreateFilterDescriptor ( substituted by the respective. cudnnFilterDescriptor_t. TensorDescriptor APIs. * filterDesc). cudnnStatus t miopenstatus t. cudnnCreateConvolutionDescriptor (c miopenCreateConvolutionDescriptor. udnnConvolutionDescriptor t. (miopenConvolutionDescriptor t. *convDesc). *convDesc). Filter.

637KB Sizes 1 Downloads 51 Views

Recommend Documents

porting guide - GitHub
Mar 22, 2011 - This document describes the process of porting applications from ... Our development philosophy with BamTools so far has been to ... bool LocateIndex(const BamIndex::IndexType& preferredType = BamIndex::STANDARD);.

Porting to BamTools 2.x Attention! - GitHub
Oct 11, 2011 - Our development philosophy with BamTools so far has been to allow ... Please be aware that the coordinate issue will affect any code that uses the multi-reader's ... I hope to update the API tutorial soon to reflect these new.

Nipype Beginner's Guide - GitHub
Aug 23, 2017 - 10. 11. #Specify experiment specifc parameters. 12 experiment_dir .... For a full list of software interfaces supported by Nipype go here ...... (http://www.fil.ion.ucl.ac.uk/spm/software/spm12/SPM12_Release_Notes.pdf) mention some im-

Modern OpenGL Guide - GitHub
There is no best library out there, because everyone has different needs .... Page 10 ... Building. After you've downloaded the GLFW binaries package from the website or ... Here is a simple snippet of code to check your build configuration:.

MultiMarkdown User's Guide - GitHub
Nov 9, 2010 - best description of what Markdown is comes from John Gruber's Markdown web site: ... including complete XHTML documents, LaTeX, PDF, RTF, or even (shudder) Microsoft ... In a blosxom8, Movable Type9, Oddmuse10, or other web site ......

Pawn Implementor's Guide - GitHub
or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. ...... 3. call the public function with the "AMX address" */.

Development Guide - GitHub
Development Guide. A basic understanding of Git is required ... (3400 and 3500). All changes should build and boot Linux on all the targets described in the wiki.

Installation Guide - GitHub
Create the database tables. 3.2.5. (Optional) ... hedgehog Data Manager This is the user that will own the database created by. Hedgehog .... link on Homepage.

RVTPO User's Guide - GitHub
anyone, and any GitHub user can file issues or follow discussions related to the model software. Code in ... Because the repository is currently private, you may be prompted for your GitHub user name and password. ... The RVTPO model uses CUBE's cata

user guide - GitHub
TOOLS AnD EVA ITEMS CAn BE FOUnD In A nEW TAB UnDER SCIEnCE CATEGORy. .... But THE greatest thing above all is KSP community. ... Of course, we still need hard work to improve our mods and we have many other ideas as.

MultiMarkdown User's Guide - GitHub
Nov 9, 2010 - for Markdown's syntax is the format of plain text email. [1] ... including complete XHTML documents, LaTeX, PDF, RTF, or even (shudder) Microsoft ... Also, you can check out the MultiMarkdown discussion list: ...... At this time, Scrive

Marshmallow Porting on Beaglebone Black -
Dec 11, 2015 - mkdir /mnt/shell/emulated 0700 shell shell mkdir /storage/emulated 0555 root root export EXTERNAL_STORAGE /storage/emulated/legacy.

Hedgehog Tools Guide 2.4.0 - GitHub
The Hedgehog tools are a set of scripts that are used to perform various tasks in terms of creating and maintaining the database and hedgehog files on disk. They can be run directly from for convenience a wrapper script (. ) is provided: /libexec/hed