Does Habana support both NHWC and NCHW? which format should be used for best performance?

Both input formats are supported, but NHWC gives the best performance. Habana devices effectively support input tensors with an NHWC layout, meaning that only tensors whose channel component is the fastest changing and in dimension 0.