Prior to this change there were a number of places where the allocation and deallocation of SparseTensorCOO objects were not cleanly paired, leading to inconsistencies regarding whether each function released its tensor/coo arguments or not, as well as making it easy to run afoul of memory leaks, use-after-free, or double-free errors. This change cleans up the codegen vs runtime boundary to resolve those issues. Now, the only time the runtime library frees an object is either (a) because it's a function explicitly designed to do so, or (b) because the allocated object is entirely local to the function and would be a memory leak if not released. Thus, now the codegen takes complete responsibility for releasing any objects it caused to be allocated.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Herald added subscribers: sdasgup3, wenzhicui, Chia-hungDuan and 17 others. · View Herald Transcript
wrengr added a parent revision: D122061: [mlir][sparse] Enhancing sparse=>sparse conversion..Mar 24 2022, 2:27 PM
This revision is now accepted and ready to land.Mar 28 2022, 4:05 PM
wrengr removed a parent revision: D122061: [mlir][sparse] Enhancing sparse=>sparse conversion..Mar 30 2022, 12:33 PM
Closed by commit rG63bdcaf92a5e: [mlir][sparse] Moving `delete coo` into codegen instead of runtime library (authored by wrengr). · Explain WhyApr 1 2022, 11:09 AM
This revision was automatically updated to reflect the committed changes.