You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We identified a possible memory leak in the buffer_add.mlir unit test. The issue seems to be introduced by the hcl.buffer_at pragma. When we run hcl-opt -opt on the following input code:
As you can see, the hcl.buffer_at transformation generates %0 = memref.alloc() without generating memref::deallocs. According to the documentation from MLIR (Buffer Deallocation Internals), deallocs have to be placed to free allocated memory and avoid memory leaks, this code could cause memory leaks in some platforms.
The text was updated successfully, but these errors were encountered:
Thanks @wyanzhao for finding the memory leak issue. This is indeed something we have not considered before. We will look into the code and fix it soon.
After further investigation, I found that the hcl.reuse_at pragma could also cause a memory leak. These include the blur, blur5, blur_x, and conv2d functions under the reuse.mlir unit test, as well as the hcl.buffer_at related unit tests buffer_conv.mlir and buffer_gemm.mlir.
We identified a possible memory leak in the buffer_add.mlir unit test. The issue seems to be introduced by the hcl.buffer_at pragma. When we run hcl-opt -opt on the following input code:
We get the following output:
As you can see, the
hcl.buffer_at
transformation generates%0 = memref.alloc()
without generatingmemref::deallocs
. According to the documentation from MLIR (Buffer Deallocation Internals),deallocs
have to be placed to free allocated memory and avoid memory leaks, this code could cause memory leaks in some platforms.The text was updated successfully, but these errors were encountered: