ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.14k stars 306 forks source link

memory alignment #777

Open skane1024 opened 1 week ago

skane1024 commented 1 week ago

In the BuildArmComputeTensor(Tensor& tensor, const armnn::TensorInfo& tensorInfo) function in the ArmComputeTensorUtils.hpp file, I tried to modify the alignment value of ComputeTensor memory, that is,

tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo)); modified to tensor.allocator()->init(BuildArmComputeTensorInfo(tensorInfo),4096);,

making the allocated memory can be 4K aligned(default 64), but in the test found that the execution speed of some operators has slowed down, I don't quite understand why?

Colm-in-Arm commented 4 days ago

Hi,

Superficially I can't see any obvious reason why inference performance would decrease by changing the tensor alignment. Is it CpuAcc or GpuAcc you're using? If you can tell me the hardware too that might be relevant too.

Colm.