This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Fix lifetime of ExecutionEngine runtime functions.
ClosedPublic

Authored by silvas on Sep 28 2021, 3:01 PM.

Details

Summary

We weren't retaining the ctypes closures that the ExecutionEngine was
calling back into, leading to mysterious errors.

Open to feedback about how to test this. And an extra pair of eyes to
make sure I caught all the places that need to be aware of this.

Diff Detail

Event Timeline

silvas created this revision.Sep 28 2021, 3:01 PM
silvas requested review of this revision.Sep 28 2021, 3:01 PM
stellaraccident accepted this revision.Sep 28 2021, 3:06 PM
stellaraccident added inline comments.
mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
112–115

Maybe call this callbackObj?

121–122

While you're in here would you mind adding appropriate py::arg annotations and possibly updating the docstring?

This revision is now accepted and ready to land.Sep 28 2021, 3:06 PM
silvas marked 2 inline comments as done.Sep 28 2021, 3:22 PM
This revision was landed with ongoing or failed builds.Sep 28 2021, 3:32 PM
This revision was automatically updated to reflect the committed changes.