Memory layout

13/07/2021 16 min Episodio 45
Memory layout

Listen "Memory layout"

Episode Synopsis

Memory layout specifies how the logical multi-dimensional tensor maps its elements onto physical linear memory. Some layouts admit more efficient implementations, e.g., NCHW versus NHWC. Memory layout makes use of striding to allow users to conveniently represent their tensors with different physical layouts without having to explicitly tell every operator what to do.Further reading.Tutorial https://pytorch.org/tutorials/intermediate/memory_format_tutorial.htmlMemory format RFC https://github.com/pytorch/pytorch/issues/19092Layout permutation proposal (not implemented) https://github.com/pytorch/pytorch/issues/32078