Created by: zhiqiu
PR types
Bug fixes
PR changes
APIs
Describe
Temporally disable zero_copy of to_variable
and to_tensor
Why?
we found two problems when enable zero_copy on CPUPlace.
- Eigen requires 16-bytes alignments, but the data of numpy array may not always satisfy the condition. Details: https://eigen.tuxfamily.org/dox/group__TopicUnalignedArrayAssert.html
- When used in flask framework, it may result in hang. Details: https://github.com/PaddlePaddle/Paddle/issues/26635
- zero_copy is only used in CPUPlace. For training on CPU, the computation is not as fast as on GPU, so the time consumption of doing copy may not be the major issue of performance.
So, we temporally diable the zero_copy strategy.