Data Format of weights in FCLayer
Hi,
Weights to the FCLayer are in 'iohw' and i am creating a memory descriptor with Data Format 'any'. When i am comparing data format of weights descriptor expected by FCLayer after configuring the FCLayer with the 'iohw' memory descriptor, For BatchSize 1 it is same and does not need any reordering. But from BatchSize 2, expected is not iohw and is needed to be reordered.
Can you tell me in what format these weights would be expected by layer(other than iohw), and why it is not the same for BatchSize 1?
Thanks, Pranathi.
Hi @pranathibl,
In case FC is created with any memory format for src and weights, one should expect formats to be used as written in set_default_params() function defined here: https://github.com/oneapi-src/oneDNN/blob/f47ffe9a549a28537e95fefadbcdb2ceb3e7bcd6/src/cpu/cpu_inner_product_pd.hpp#L162-L196
There is a comment why MB=1 case is different from others:
/* With batch = 1, no transpose to use the faster gemv kernels. Otherwise, we transpose the weights to improve efficiency of no-copy kernels */.
The primary goal of format changing is calling faster GEMM kernels, thus leading for better performance overall.
Closing issue due to lack of activity. Feel free re-open or create a new one.