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, 0, 0, 0, 0,
sequenceLen = 10
xDesc = 0xe0d1c0
x = 0xe05a80
hxDesc = 3, 4, 512
hx = 0xdff280
cxDesc = 3, 4, 512
cx = 0xdff470
wDesc = 3584, 2048
w = 0xdfa690
yDesc = 0xdd2630
y = 0xdfac40
hyDesc = 3, 4, 512
hy = 0xdff660
cyDesc = 3, 4, 512
cy = 0xdff850
}

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, xDescMaxFirstDim, hiddenSize >
  • cxDesc = 3, 4, 512 == < nlayersTensor, xDescMaxFirstDim, hiddenSize >
  • wDesc is a weights tensor descriptor, which is calculated by MIOpen
  • hyDesc = 3, 4, 512 == < nlayersTensor, xDescMaxFirstDim, hiddenSize >
  • cyDesc = 3, 4, 512 == < nlayersTensor, xDescMaxFirstDim, hiddenSize >

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

nlayersTensor equals twice to nlayers if the dirMode is bidirectional.

Example miopenRNNBackwardData log:

miopenStatus_t miopenRNNBackwardData(miopenHandle_t, miopenRNNDescriptor_t, int, miopenTensorDescriptor**, const void*, miopenTensorDescriptor**, const void*, miopenTensorDescriptor_t, const void*,                         miopenTensorDescriptor_t, 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, 0, 0, 0, 0,
sequenceLen = 10
yDesc = 0xdd2630
y = 0xdfac40
dyDesc = 0xdd2630
dy = 0xdfaa50
dhyDesc = 3, 4, 512
dhy = 0xd3a340
dcyDesc = 3, 4, 512
dcy = 0xd3a530
wDesc = 3584, 2048
w = 0xdfa690
hxDesc = 3, 4, 512
hx = 0xdff280
cxDesc = 3, 4, 512
cx = 0xdff470
}

The lines of interest are:

  • rnnDesc = 512, 3, 4, 6, 2, 1, 0, 0, 0, == < hiddenSize, nlayers, nHiddenTensorsPerLayer, workspaceScale, rnnMode, dirMode, algoMode, inputMode, biasMode >
  • yDesc is an array of tensor descriptors
  • dyDesc is an array of fully packed tensor descriptors associated with the output from each time step
  • dhyDesc = 3, 4, 512 == < nlayersTensor , xDescMaxFirstDim, hiddenSize >
  • dcyDesc = 3, 4, 512 == < nlayersTensor , xDescMaxFirstDim, hiddenSize >
  • wDesc is a weights tensor descriptor
  • hxDesc = 3, 4, 512 == < nlayersTensor , xDescMaxFirstDim, hiddenSize >
  • cxDesc = 3, 4, 512 == < nlayersTensor , xDescMaxFirstDim, hiddenSize >

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

nlayersTensor equals twice to nlayers if the dirMode is bidirectional.

Example miopenRNNBackwardWeights log:

miopenStatus_t miopenRNNBackwardWeights(miopenHandle_t, miopenRNNDescriptor_t, int, miopenTensorDescriptor**, const void*, miopenTensorDescriptor_t, const void*, miopenTensorDescriptor**, const void*,                      miopenTensorDescriptor_t, void*, void*, size_t, const void*, size_t){
rnnDesc = 512, 3, 4, 6, 2, 0, 0, 0, 0,
sequenceLen = 10
xDesc = 0xe0d1c0
x = 0xe05a80
hxDesc = 3, 4, 512
hx = 0xdff280
yDesc = 0xdd2630
y = 0xdfaa50
dwDesc = 3584, 2048
dw = 0xdfa860
workSpace = 0xde13e0
workSpaceNumBytes = 1032192
reserveSpace = 0xde15d0
reserveSpaceNumBytes = 2064384
}

The lines of interest are:

  • rnnDesc = 512, 3, 4, 6, 2, 1, 0, 0, 0, == < hiddenSize, nlayers, nHiddenTensorsPerLayer, workspaceScale, rnnMode, dirMode, algoMode, inputMode, biasMode >
  • xDesc is an array of tensor descriptors
  • hxDesc = 3, 4, 512 == < nlayersTensor , xDescMaxFirstDim, hiddenSize >
  • dwDesc is a weights tensor descriptor

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

nlayersTensor equals twice to nlayers if the dirMode is bidirectional.