Skip to content

MIOpen Logger to Driver Decoder for Convolutions

zjing14 edited this page Jan 25, 2018 · 14 revisions

Example miopenConvolutionForward log:

miopenStatus_t miopenConvolutionForward(miopenHandle_t, const void*, miopenTensorDescriptor_t, const void*, miopenTensorDescriptor_t, const void*, miopenConvolutionDescriptor_t, miopenConvFwdAlgorithm_t, const void*, miopenTensorDescriptor_t, void*, void*, size_t){
alpha = 0x7ffd8b2cdd84
xDesc = 100, 3, 32, 32
x = 0x7f8e22e5b410
wDesc = 32, 3, 3, 3
w = 0x7f8e22e5b990
convDesc = 0, 0, 1, 1, 1, 1, 
algo = 1
beta = 0x7ffd8b2cdd88
yDesc = 100, 32, 30, 30
y = 0x7f8e22e8ff60
workSpace = 0x7f8e22e5ac70
workSpaceSize = 97200
}

The lines of interest are:

  • xDesc = 100, 3, 32, 32 == < n, c, H, W >
  • wDesc = 32, 3, 3, 3 == < k, c, y, x >
  • convDesc = 0, 0, 1, 1, 1, 1 == < p, q, u, v, l, j >

Example miopenConvolutionBackwardData log:

miopenStatus_t miopenConvolutionBackwardData(miopenHandle_t, const void*, miopenTensorDescriptor_t, const void*, miopenTensorDescriptor_t, const void*, miopenConvolutionDescriptor_t, miopenConvBwdDataAlgorithm_t, const void*, miopenTensorDescriptor_t, void*, void*, size_t){
alpha = 0x7ffd8b2cdd64
dyDesc = 100, 32, 30, 30
dy = 0x7f8e22e8fca0
wDesc = 32, 3, 3, 3
w = 0x7f8e22e5b990
convDesc = 0, 0, 1, 1, 1, 1, 
algo = 1
beta = 0x7ffd8b2cdd68
dxDesc = 100, 3, 32, 32
dx = 0x7f8e22e5b6d0
workSpace = 0x7f8e22e5a9b0
workSpaceSize = 345600
}

The lines of interest are:

  • dxDesc = 100, 3, 32, 32 == < n, c, H, W >
  • wDesc = 32, 3, 3, 3 == < k, c, y, x >
  • convDesc = 0, 0, 1, 1, 1, 1 == < p, q, u, v, l, j >

Example miopenConvolutionBackwardWeights log:

miopenStatus_t miopenConvolutionBackwardWeights(miopenHandle_t, const void*, miopenTensorDescriptor_t, const void*, miopenTensorDescriptor_t, const void*, miopenConvolutionDescriptor_t, miopenConvBwdWeightsAlgorithm_t, const void*, miopenTensorDescriptor_t, void*, void*, size_t){
alpha = 0x7ffd8b2cdd64
dyDesc = 100, 32, 30, 30
dy = 0x7f8e22e8fca0
xDesc = 100, 3, 32, 32
x = 0x7f8e22e5b410
convDesc = 0, 0, 1, 1, 1, 1, 
algo = 1
beta = 0x7ffd8b2cdd68
dwDesc = 32, 3, 3, 3
dw = 0x7f8e22e8f9e0
workSpace = 0x7f8e22e5a9b0
workSpaceSize = 345600
}

The lines of interest are:

  • xDesc = 100, 3, 32, 32 == < n, c, H, W >
  • dwDesc = 32, 3, 3, 3 == < k, c, y, x >
  • convDesc = 0, 0, 1, 1, 1, 1 == < p, q, u, v, l, j >

Once the values n, c, H, W, k, x, y, p, q, l, j have been extracted from the log as shown above, they can be plugged into the MIOpenDriver conv command line.

Example miopenRNNForwardTraining log:

miopenStatus_t miopenRNNForwardTraining(miopenHandle_t, miopenRNNDescriptor_t, int, miopenTensorDescriptor**, const void*, miopenTensorDescriptor_t, const void*, miopenTensorDescriptor_t, const void*,                      miopenTensorDescriptor_t, const void*, miopenTensorDescriptor**, void*, miopenTensorDescriptor_t, void*, miopenTensorDescriptor_t, void*, void*, size_t, void*, size_t){
rnnDesc = 512, 3, 4, 6, 2, 1, 0, 0, 0,
sequenceLen = 10
xDesc = 0x22ebcf0
x = 0x7f8ef3a0a140
hxDesc = 6, 4, 512
hx = 0x7f8ef3a086f0
cxDesc = 6, 4, 512
cx = 0x23be8b0
wDesc = 4608, 4096
w = 0x7f8ef3a054e0
yDesc = 0x7f8ef3a62980
y = 0x7f8ef3a08500
hyDesc = 6, 4, 512
hy = 0x23beaa0
cyDesc = 6, 4, 512
cy = 0x23bec90
}

The lines of interest are:

  • xDesc is an array of tensor descriptors
  • rnnDesc = 512, 3, 4, 6, 2, 0, 0, 0, 0, == < hiddenSize, nlayers, nHiddenTensorsPerLayer, workspaceScale, rnnMode, dirMode, algoMode, inputMode, biasMode >
  • hxDesc = 3, 4, 512 == < nlayersTensor, xDescMax, hiddenSize >
  • cxDesc = 3, 4, 512 == < nlayersTensor, xDescMax, hiddenSize >
  • wDesc is a weights tensor descriptor, which is calculated by MIOpen
  • hyDesc = 3, 4, 512 == < nlayersTensor, xDescMax, hiddenSize >
  • cyDesc = 3, 4, 512 == < nlayersTensor, xDescMax, hiddenSize >

xDescMax is the largest first dimension of the xDesc tensor descriptor array.

nlayersTensor equals twice to nlayers if the dirMode is bidirectional.