oneDNN icon indicating copy to clipboard operation
oneDNN copied to clipboard

forward_inference as default direction for a convolution in benchdnn

Open alenik01 opened this issue 6 years ago • 2 comments

Good afternoon.

At the moment a convolution primitive for a benchdnn run is created with dnnl_forward_training prop_kind if --dir option is not specified (benchdnn/conv/conv.cpp). However, there is no actual training there, only a call to convolution and reference implementation. May you please comment, why forward_training is the default value and not forward_inference? Similar situation occurs in gtests also (test_convolution_forward_common.hpp).

Best wishes, Aleksandr

alenik01 avatar Nov 27 '20 22:11 alenik01

Hi @alenik01, thank you for the question.

The main idea was to test bias by default. Due to historical reasons there's no a separate option for conv driver (yet) to distinct bias presence and its data type. FWD_B is responsible for adding bias for now. FWD_I doesn't include bias (though it may happen for inference). Another thing is training most of times uses scratchpad while inference may not.

Actually, there's no much sense to rely on default configuration. It's only done for ability to run bare problem descriptors, sometimes it's useful. Besides of that, there are so many flavors of convolutions that it's better to specify which exactly flavor is desired.

Hope it helps. Thanks.

dzarukin avatar Nov 29 '20 02:11 dzarukin

@dzarukin, many thanks for the detailed explanation.

alenik01 avatar Dec 01 '20 21:12 alenik01