mahinlma
mahinlma

Reputation: 1258

Tensorflow Intel MKL Optimization with NHWC data format

TensorFlow is compiled with the Intel MKL optimizations, many operations will be optimized and support NCHW.

Can someone please explain, why does Intel MKL support NCHW format more than NHWC?

Upvotes: 0

Views: 416

Answers (2)

Nathan Greeneltch
Nathan Greeneltch

Reputation: 84

MKLDNN will run most of its compute-heavy math on a custom (Blocked) memory layout, and the conversion from NCHW --> blocked takes similar time to NHWC --> blocked. So there should be no difference for pure MKLDNN primitive accelerations. The difference is in some of the GEMM-based math, which works on the NCHW format by default, meaning that some matmul calls will NOT require layout conversions if input format is NCHW.

Upvotes: 2

Nikhila Haridas_Intel
Nikhila Haridas_Intel

Reputation: 409

TensorFlow default NHWC format is not the most efficient data layout for CPU and it results in some additional conversion overhead.Hence Intel MKL support NCHW format

Upvotes: 2

Related Questions