This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] [Python] Add a method to clear live operations map
ClosedPublic

Authored by jdd on Apr 15 2022, 10:04 PM.

Details

Summary

Introduce a method on PyMlirContext (and plumb it through to Python) to
invalidate all of the operations in the live operations map and clear
it. Since Python has no notion of private data, an end-developer could
reach into some 3rd party API which uses the MLIR Python API (that is
behaving correctly with regard to holding references) and grab a
reference to an MLIR Python Operation, preventing it from being
deconstructed out of the live operations map. This allows the API
developer to clear the map when it calls C++ code which could delete
operations, protecting itself from its users.

Diff Detail

Event Timeline

jdd created this revision.Apr 15 2022, 10:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2022, 10:04 PM
jdd requested review of this revision.Apr 15 2022, 10:04 PM
jdd added a reviewer: ftynse.Apr 15 2022, 10:10 PM
jdd edited the summary of this revision. (Show Details)
jdd edited the summary of this revision. (Show Details)
jdd added a comment.Apr 16 2022, 6:48 PM

Pre-merge debian check is failing with OSError: [Errno 28] No space left on device.

ftynse accepted this revision.Apr 19 2022, 4:49 AM
This revision is now accepted and ready to land.Apr 19 2022, 4:49 AM
This revision was landed with ongoing or failed builds.Apr 19 2022, 3:14 PM
This revision was automatically updated to reflect the committed changes.