Created by: arlesniak
PR types
New features
PR changes
Others
Describe
With two new global flags one can filter OneDNN op types which should be turned on or off in DyGraph after FLAGS_use_mkldnn enabled. It can be used for debugging as well as experimenting with models.
FLAGS_tracer_mkldnn_ops_on contains comma separated list of OneDNN op types that should be enabled and FLAGS_tracer_mkldnn_ops_off on the contrary.
Op types naming on the lists should be in line with op type naming in Tracer class. For example:
FLAGS_tracer_mkldnn_ops_on="batch_norm,conv2d,relu"
In order to keep backward compatibility priority of flags is as follows:
FLAGS_use_mkldnn=1 => all ops are run with parameter use_mkldnn=true
FLAGS_use_mkldnn=1 FLAGS_tracer_mkldnn_ops_on="" FLAGS_tracer_mkldnn_ops_off="" => all ops are run with parameter use_mkldnn=true, because both lists are empty
FLAGS_use_mkldnn=1 FLAGS_tracer_mkldnn_ops_on="elementwise_add,softmax" => only elementwise_add and softmax is run with parameter use_mkldnn=true
FLAGS_use_mkldnn=1 FLAGS_tracer_mkldnn_ops_off="sum" => all ops except sum is run with parameter use_mkldnn=true
FLAGS_use_mkldnn=1 FLAGS_tracer_mkldnn_ops_on="batch_norm,matmul" FLAGS_tracer_mkldnn_ops_off="sum,relu" => only batch_norm and matmul are run with parameter use_mkldnn=true, operations sum,relu are not modified