Page MenuHomePhabricator

mikeurbach (Mike Urbach)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 16 2020, 10:22 AM (132 w, 2 d)

Recent Activity

Feb 2 2023

mikeurbach accepted D143151: [mlir] GreedyPatternRewriteDriver: Ignore scope when rewriting top-level ops.

Thanks! I think this makes sense to me.

Feb 2 2023, 8:16 AM · Restricted Project, Restricted Project

Jan 23 2023

mikeurbach accepted D142182: [MLIR] Expose LocationAttrs in the C API.

I think this looks good to me. Not sure why the pre-merge tests failed...

Jan 23 2023, 12:57 PM · Restricted Project, Restricted Project, Restricted Project

Dec 13 2022

mikeurbach committed rGafb2ed80cb16: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses. (authored by mikeurbach).
[mlir][Python] Add a simple PyOpOperand iterator for PyValue uses.
Dec 13 2022, 6:21 PM · Restricted Project, Restricted Project
mikeurbach closed D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..
Dec 13 2022, 6:20 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

Thanks for the reviews!

Dec 13 2022, 6:00 PM · Restricted Project, Restricted Project
mikeurbach updated the diff for D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

Some clean ups suggested in review.

Dec 13 2022, 5:59 PM · Restricted Project, Restricted Project
mikeurbach added inline comments to D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..
Dec 13 2022, 5:18 PM · Restricted Project, Restricted Project
mikeurbach committed rGfa45b2fb2aef: [mlir][Python] Add `__hash__` implementation for Block. (authored by mikeurbach).
[mlir][Python] Add `__hash__` implementation for Block.
Dec 13 2022, 11:03 AM · Restricted Project, Restricted Project
mikeurbach closed D139599: [mlir][Python] Add `__hash__` implementation for Block..
Dec 13 2022, 11:03 AM · Restricted Project, Restricted Project
mikeurbach added a comment to D139599: [mlir][Python] Add `__hash__` implementation for Block..

I think this change may be trivial enough to land without pre-merge approval. I've been testing it in a downstream project and it seems to work as expected.

Dec 13 2022, 11:02 AM · Restricted Project, Restricted Project
mikeurbach updated subscribers of D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

I'm not sure who to tag on Python API additions these days, maybe @mehdi_amini, @jpienaar, or @jdd could take a look?

Dec 13 2022, 10:22 AM · Restricted Project, Restricted Project

Dec 12 2022

mikeurbach updated the diff for D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

Rebase main after C API landed.

Dec 12 2022, 1:19 PM · Restricted Project, Restricted Project
mikeurbach committed rGdd8e443539cc: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses. (authored by mikeurbach).
[mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses.
Dec 12 2022, 1:15 PM · Restricted Project, Restricted Project
mikeurbach closed D139596: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses..
Dec 12 2022, 1:15 PM · Restricted Project, Restricted Project

Dec 8 2022

mikeurbach updated the diff for D139596: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses..

Update test to use the new C API.

Dec 8 2022, 8:55 AM · Restricted Project, Restricted Project
mikeurbach updated the diff for D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

Switch to the new C API for OpOperand.

Dec 8 2022, 8:51 AM · Restricted Project, Restricted Project
mikeurbach updated the diff for D139596: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses..

Switch to the usual DEFINE_C_API_STRUCT for MlirOpOperand.

Dec 8 2022, 8:50 AM · Restricted Project, Restricted Project

Dec 7 2022

mikeurbach requested review of D139599: [mlir][Python] Add `__hash__` implementation for Block..
Dec 7 2022, 6:18 PM · Restricted Project, Restricted Project
mikeurbach added reviewers for D139596: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses.: stellaraccident, ftynse, mehdi_amini.
Dec 7 2022, 6:06 PM · Restricted Project, Restricted Project
mikeurbach added reviewers for D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses.: stellaraccident, ftynse.
Dec 7 2022, 6:06 PM · Restricted Project, Restricted Project
mikeurbach updated the diff for D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..

Fixup unrelated whitespace change.

Dec 7 2022, 6:00 PM · Restricted Project, Restricted Project
mikeurbach requested review of D139597: [mlir][Python] Add a simple PyOpOperand iterator for PyValue uses..
Dec 7 2022, 5:58 PM · Restricted Project, Restricted Project
mikeurbach requested review of D139596: [mlir][CAPI] Add a simple MlirOpOperand API for MlirValue uses..
Dec 7 2022, 5:55 PM · Restricted Project, Restricted Project

Jul 25 2022

mikeurbach committed rGe0af5032f17b: [mlir] Update Python CMake version requirement. (authored by mikeurbach).
[mlir] Update Python CMake version requirement.
Jul 25 2022, 10:30 AM · Restricted Project, Restricted Project
mikeurbach closed D130171: [mlir] Update Python CMake version requirement..
Jul 25 2022, 10:29 AM · Restricted Project, Restricted Project

Jul 20 2022

mikeurbach added inline comments to D130171: [mlir] Update Python CMake version requirement..
Jul 20 2022, 7:26 AM · Restricted Project, Restricted Project
mikeurbach requested review of D130171: [mlir] Update Python CMake version requirement..
Jul 20 2022, 7:24 AM · Restricted Project, Restricted Project

Jul 6 2022

mikeurbach added a comment to D128593: [mlir] Overhaul C/Python registration APIs to properly scope registration/loading activities..

Not that it is super relevant to this patch but I'm curious: is that some kind of debug build? 379MiB seems quite hefty otherwise! I expect that maybe you are <10MiB in a stripped/release build?

Jul 6 2022, 12:47 PM · Restricted Project, Restricted Project

Jul 5 2022

mikeurbach added a comment to D128593: [mlir] Overhaul C/Python registration APIs to properly scope registration/loading activities..

Sorry for the delay, but I finally got around to taking this for a spin.

Jul 5 2022, 5:05 PM · Restricted Project, Restricted Project

May 16 2022

mikeurbach accepted D124717: [mlir][tblgen][ods][python] Use keyword-only arguments for optional builder arguments in generated Python bindings.

I took this for a spin in CIRCT, and we have already used the extension mechanism to write our own constructors in a lot of places this could break APIs. There was one CIRCT helper, used in two places, that required minor changes at the call sites. I just wrote up a patch since it was so simple: https://github.com/llvm/circt/pull/3134.

May 16 2022, 4:19 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

Ok, I manually made the change in the inline comment and that fixed my issue, so I think this should be good to go after that.

May 16 2022, 3:55 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

I confirmed I don't hit this issue in the same environment with the new simple python detection script disabled... I will try to do a little deep dive into this and see if I can figure out what's going on.

May 16 2022, 3:39 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

I do see the script correctly sets this:

May 16 2022, 3:31 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

Actually, may have spoken too soon. I was able to run CMake successfully, but when I went to compile the Python dynamic shared object, there were some issues finding Python.h like this:

May 16 2022, 3:27 PM · Restricted Project, Restricted Project
mikeurbach accepted D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

Alright, I got a chance to test this, and I think it's working well.

May 16 2022, 3:16 PM · Restricted Project, Restricted Project

May 10 2022

mikeurbach added a comment to D125182: [mlir] Experimental, simplified CMake auto-config for Python development..

This looks good to me in general. I tried taking it for a spin, but I realized the dev machine I was on didn't have the proper python environment to test this. I will check again after installing a suitable python.

May 10 2022, 8:53 PM · Restricted Project, Restricted Project
mikeurbach added a comment to D124717: [mlir][tblgen][ods][python] Use keyword-only arguments for optional builder arguments in generated Python bindings.

Apologies for the delay... I said I'd take a look at this from CIRCT's perspective a week ago. Going this route in general sounds good to me, and the current implementation seems to make sense. I'm happy to update CIRCT as needed.

May 10 2022, 2:36 PM · Restricted Project, Restricted Project

Apr 26 2022

mikeurbach added a comment to D123641: Fix iteration counting in greedy pattern application.

Hi @frgossen, I just incorporated this change downstream into CIRCT, and I found it somewhat unintuitive.

Apr 26 2022, 8:30 AM · Restricted Project, Restricted Project

Oct 13 2021

mikeurbach accepted D111513: [mlir] Allow out-of-tree python building from installed MLIR..
Oct 13 2021, 10:27 PM · Restricted Project

Oct 12 2021

mikeurbach added inline comments to D111513: [mlir] Allow out-of-tree python building from installed MLIR..
Oct 12 2021, 9:44 AM · Restricted Project
mikeurbach committed rG55e76c70a4f7: [mlir] Limit Python dependency to Development.Module when possible. (authored by mikeurbach).
[mlir] Limit Python dependency to Development.Module when possible.
Oct 12 2021, 8:31 AM
mikeurbach closed D111585: [mlir] Limit Python dependency to Development.Module when possible..
Oct 12 2021, 8:31 AM · Restricted Project
mikeurbach updated the diff for D111585: [mlir] Limit Python dependency to Development.Module when possible..

Update commit message.

Oct 12 2021, 8:10 AM · Restricted Project

Oct 11 2021

mikeurbach added inline comments to D111585: [mlir] Limit Python dependency to Development.Module when possible..
Oct 11 2021, 10:59 PM · Restricted Project
mikeurbach updated the diff for D111585: [mlir] Limit Python dependency to Development.Module when possible..

Get rid of MLIR_BINDINGS_PYTHON_LOCK_VERSION and take add_mlir_python_extension from https://reviews.llvm.org/D111513.

Oct 11 2021, 10:58 PM · Restricted Project
mikeurbach added inline comments to D111513: [mlir] Allow out-of-tree python building from installed MLIR..
Oct 11 2021, 10:55 PM · Restricted Project
mikeurbach added inline comments to D111513: [mlir] Allow out-of-tree python building from installed MLIR..
Oct 11 2021, 10:43 PM · Restricted Project
mikeurbach added inline comments to D111585: [mlir] Limit Python dependency to Development.Module when possible..
Oct 11 2021, 6:18 PM · Restricted Project
mikeurbach added a comment to D111585: [mlir] Limit Python dependency to Development.Module when possible..

Take two. I tested this one locally and I think it should work. Do the buildbots run after commit to main or is there anywhere I can check before committing?

Oct 11 2021, 4:35 PM · Restricted Project
mikeurbach requested review of D111585: [mlir] Limit Python dependency to Development.Module when possible..
Oct 11 2021, 4:32 PM · Restricted Project

Oct 7 2021

mikeurbach added a comment to D111383: [mlir] Limit Python dependency to Development.Module when possible..

Thanks Mehdi. I will take a look at that. We also had some issues downstream so I was planning to revert but you beat me to it.

Oct 7 2021, 10:56 PM · Restricted Project
mikeurbach committed rG7aebdfc4fcc4: [mlir] Limit Python dependency to Development.Module when possible. (authored by mikeurbach).
[mlir] Limit Python dependency to Development.Module when possible.
Oct 7 2021, 10:06 PM
mikeurbach closed D111383: [mlir] Limit Python dependency to Development.Module when possible..
Oct 7 2021, 10:06 PM · Restricted Project
mikeurbach added a comment to D111383: [mlir] Limit Python dependency to Development.Module when possible..

We should propagate this to downstreams (at least a couple of which already require this version of cmake and don't need the conditional).

Oct 7 2021, 9:46 PM · Restricted Project
mikeurbach requested review of D111383: [mlir] Limit Python dependency to Development.Module when possible..
Oct 7 2021, 9:36 PM · Restricted Project

Jul 29 2021

mikeurbach accepted D107113: [MLIR][python] Disable SONAME on extensions..
Jul 29 2021, 3:35 PM · Restricted Project
mikeurbach accepted D107100: [MLIR][Python] Use DEST_PREFIX when installing..
Jul 29 2021, 3:10 PM · Restricted Project
mikeurbach accepted D107090: [MLIR][python] Export CAPI headers..

Makes sense to me.

Jul 29 2021, 11:03 AM · Restricted Project

Jul 28 2021

mikeurbach accepted D106992: Break apart the MLIR ExecutionEngine from core python module..
Jul 28 2021, 1:13 PM · Restricted Project

Jul 27 2021

mikeurbach accepted D106520: Re-engineer MLIR python build support..

This has been working out of the box for the CIRCT project. No more TypeID suprises, etc. Thanks Stella, this is super nice!

Jul 27 2021, 6:54 AM · Restricted Project

Jul 22 2021

mikeurbach added a comment to D106520: Re-engineer MLIR python build support..

If you'd like to wait until tomorrow, I'll have an npcomp branch staged with changes and you should be able to draft onto those. Probably easier than being the first to apply in a new project.

Jul 22 2021, 5:02 PM · Restricted Project
mikeurbach added a comment to D106520: Re-engineer MLIR python build support..

I've reviewed, and I think I'm understanding what's going on. I don't think I have enough CMake chops to provide serious suggestions/alternatives on the approach, so I'm just going to try it out with CIRCT and see how it goes. Assuming it works and we don't have to work around TypeID issues and whatnot, I'm satisfied!

Jul 22 2021, 3:29 PM · Restricted Project
mikeurbach added a comment to D106520: Re-engineer MLIR python build support..

I haven't reviewed yet, but it's great to see this. I'll dig in today, and I'll help integrate the changes into CIRCT. The CI builds of CIRCT use the github.com/circt/llvm repo, and we can stage this there for testing as needed.

Jul 22 2021, 11:26 AM · Restricted Project

Jul 15 2021

mikeurbach accepted D106106: [MLIR] [Python ODS] Use @builtins.property for cases where 'property' is already defined.

Makes sense to me.

Jul 15 2021, 3:24 PM · Restricted Project

May 10 2021

mikeurbach accepted D102144: [mlir][Python] Upstream the PybindAdaptors.h helpers and use it to implement sparse_tensor.encoding..

Thanks for pulling this upstream. It looks good to me, but I'm just a user, not a pybind expert.

May 10 2021, 8:26 AM · Restricted Project

May 3 2021

mikeurbach accepted D101734: [mlir][Python] Add casting constructor to Type and Attribute..
May 3 2021, 6:18 AM · Restricted Project

Apr 28 2021

mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

Thanks for the assistance @stellaraccident and @mehdi_amini!

Apr 28 2021, 6:31 PM · Restricted Project
mikeurbach committed rG49745f87e610: [mlir][python] Add `destroy` method to PyOperation. (authored by mikeurbach).
[mlir][python] Add `destroy` method to PyOperation.
Apr 28 2021, 6:30 PM
mikeurbach closed D101422: [mlir][python] Add `destroy` method to PyOperation..
Apr 28 2021, 6:30 PM · Restricted Project
mikeurbach updated the diff for D101422: [mlir][python] Add `destroy` method to PyOperation..

Add TODO about invalidating children of an erased operation.

Apr 28 2021, 5:50 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

Oops, I see your comment. I will leave a TODO for now :)

Apr 28 2021, 5:41 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

Also, when considering trees of operations, it is rather hard to make these kind of mutations 100% memory safe. We had discussed some approaches, but as it stands, if you erase a tree of ops and have a deep reference into the tree you just deleted, you're going to have a bad time. The expensive solution is, prior to erasing, iterate over children recursively, see if they have a corresponding PyOperation and invalidate it. I had toyed with other approaches to optimize that but never implemented them (i.e. if every operation had a monotonically increasing number associated with it, you could do some cheaper things and not run afoul of pointer re-use issues).

Apr 28 2021, 5:40 PM · Restricted Project
mikeurbach updated the diff for D101422: [mlir][python] Add `destroy` method to PyOperation..

Implement Stella's feedback.

Apr 28 2021, 5:32 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

Thanks @stellaraccident, I had missed that we can use the valid bit for this. I will give it a shot.

Apr 28 2021, 5:15 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

I've updated the test case to show what I mean. The bottom line is I need to make sure the Python reference is dropped and liveOperations is cleaned out before I can create any more operations. In the test, the addition of Operation.create("custom.op2") would hit the previously linked assertion, unless I added the del op.

Apr 28 2021, 4:59 PM · Restricted Project
mikeurbach updated the diff for D101422: [mlir][python] Add `destroy` method to PyOperation..

Update test case to show previous issue.

Apr 28 2021, 4:59 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

This simple case works, but the previous concern about having the erased operation's pointer in the live operations map is a real issue. In fact, if I try to create any operations after erasing one, I hit this assertion: https://github.com/llvm/llvm-project/blob/86f291ebb2dfc5a93e1ee83b2d5965dcfa5d8bb1/mlir/lib/Bindings/Python/IRCore.cpp#L805. I haven't dug this far, but I think maybe an implementation detail of MLIR means the same pointer will be re-used on the next operation created? Anyway, it seems we must remove the pointer when erase is called... I am adding a test for this and trying to address it.

Apr 28 2021, 4:33 PM · Restricted Project
mikeurbach added a comment to D101496: [mlir] Move PyConcreteType to header. NFC..

PSA noted. When I mentioned this on discourse, it seemed like this and the previous change for attributes were expansions we could get some mileage out of without totally going off the deep end. Are there immediate linkage concerns with deriving PyConcreteType out of tree, or just the general concerns we have been discussing?

Apr 28 2021, 4:20 PM · Restricted Project
mikeurbach updated the diff for D101422: [mlir][python] Add `destroy` method to PyOperation..

Rename "destroy" to "erase".

Apr 28 2021, 4:10 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

I did some more digging, and I think my confusion came from when operations are removed from the liveOperations map. This happens in the PyOperation destructor, and only there. When I was testing this before, I found that I was hitting the assertion in the destructor, because I had already called it once and removed the operation! Part of my confusion was how I previously wrote the test. I was checking the live operations map while I still had a Python reference, so the destructor hadn't been called.

Apr 28 2021, 4:08 PM · Restricted Project
mikeurbach updated the diff for D101422: [mlir][python] Add `destroy` method to PyOperation..

Replace call to destructor with call to mlirOperationDestroy.

Apr 28 2021, 3:59 PM · Restricted Project
mikeurbach committed rG6ff74f96fd9e: [mlir][python] Update `PyOpResult.owner` to get the parent object. (authored by mikeurbach).
[mlir][python] Update `PyOpResult.owner` to get the parent object.
Apr 28 2021, 1:40 PM
mikeurbach closed D101416: [mlir][python] Update `PyOpResult.owner` to get the parent object..
Apr 28 2021, 1:40 PM · Restricted Project

Apr 27 2021

mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

The backstory is we often need to create cycles in graph regions, and I have been working on something to aid this in Python. Circuit IR often looks like:

Apr 27 2021, 10:00 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

It isn't clear to me where/how was this assertions hit before?

Apr 27 2021, 7:58 PM · Restricted Project
mikeurbach added a comment to D101422: [mlir][python] Add `destroy` method to PyOperation..

Frankly I'm not sure if this is the best implementation. I do have a use-case where I think an explicit destroy call is needed, and to support that I think I had to make the destructor change. At that point, it seemed like I might as well just call the destructor in the new destroy method, but I'm not sure if that is some sort of anti-pattern.

Apr 27 2021, 7:42 PM · Restricted Project
mikeurbach requested review of D101422: [mlir][python] Add `destroy` method to PyOperation..
Apr 27 2021, 7:39 PM · Restricted Project
mikeurbach updated the diff for D101416: [mlir][python] Update `PyOpResult.owner` to get the parent object..

Rebase main

Apr 27 2021, 7:21 PM · Restricted Project
mikeurbach committed rG63d16d06f5b8: [mlir] Support setting operand values in C and Python APIs. (authored by mikeurbach).
[mlir] Support setting operand values in C and Python APIs.
Apr 27 2021, 7:18 PM
mikeurbach closed D101398: [mlir] Support setting operand values in C and Python APIs..
Apr 27 2021, 7:18 PM · Restricted Project
mikeurbach added a comment to D101090: [MLIR][Python] Add capsule methods for pybind11 to PyValue..

Thanks Stella!

Apr 27 2021, 7:15 PM · Restricted Project
mikeurbach committed rG3f3d1c901d7a: [MLIR][Python] Add capsule methods for pybind11 to PyValue. (authored by mikeurbach).
[MLIR][Python] Add capsule methods for pybind11 to PyValue.
Apr 27 2021, 7:14 PM
mikeurbach closed D101090: [MLIR][Python] Add capsule methods for pybind11 to PyValue..
Apr 27 2021, 7:14 PM · Restricted Project
mikeurbach requested review of D101416: [mlir][python] Update `PyOpResult.owner` to get the parent object..
Apr 27 2021, 5:21 PM · Restricted Project
mikeurbach added a reviewer for D101090: [MLIR][Python] Add capsule methods for pybind11 to PyValue.: mehdi_amini.

@mehdi_amini since you approved https://reviews.llvm.org/D101398, do you mind taking a look at this one as well?

Apr 27 2021, 4:43 PM · Restricted Project
mikeurbach updated the diff for D101090: [MLIR][Python] Add capsule methods for pybind11 to PyValue..

Rebase main

Apr 27 2021, 4:36 PM · Restricted Project
mikeurbach updated the diff for D101398: [mlir] Support setting operand values in C and Python APIs..

Add cleanup code to new C unittest.

Apr 27 2021, 3:37 PM · Restricted Project
mikeurbach updated the diff for D101398: [mlir] Support setting operand values in C and Python APIs..

Add C unittest for operands API

Apr 27 2021, 3:34 PM · Restricted Project
mikeurbach updated subscribers of D101398: [mlir] Support setting operand values in C and Python APIs..

This is something @jdd and I will use in circt, and seemed generally useful upstream in mlir. However, we weren't sure about the addition of mlirOperationSetOperand to the C API. Are there deeper considerations preventing this from being added? Or is it just something that was demand-driven and has yet to be demanded? I've been testing this patch locally with some small programs for about a week and haven't found any issues with setting operands from Python via the proposed C API.

Apr 27 2021, 1:49 PM · Restricted Project
mikeurbach requested review of D101398: [mlir] Support setting operand values in C and Python APIs..
Apr 27 2021, 1:43 PM · Restricted Project