| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR][Python] add GetTypeID for llvm.struct_type and llvm.ptr and enable downcasting (#169383) | 8 个月前 | |
[MLIR][Python] Expose the insertion point of pattern rewriter (#161001) In [#160520](https://github.com/llvm/llvm-project/pull/160520), we discussed the current limitations of PDL rewriting in Python (see [this comment](https://github.com/llvm/llvm-project/pull/160520#issuecomment-3332326184)). At the moment, we cannot create new operations in PDL native (python) rewrite functions because the PatternRewriter APIs are not exposed. This PR introduces bindings to retrieve the insertion point of the PatternRewriter, enabling users to create new operations within Python rewrite functions. With this capability, more complex rewrites e.g. with branching and loops that involve op creations become possible. --------- Co-authored-by: Maksim Levental <maksim.levental@gmail.com> | 9 个月前 | |
[mlir][py][c] Enable setting block arg locations. (#169033) This enables changing the location of a block argument. Follows the approach for updating type of block arg. | 8 个月前 | |
| 9 个月前 | ||
[MLIR][Python] Make check-mlir-python depend on runner utils (#166077) ninja check-mlir-python will fail in the recent main branch due to missing shared libraries (libmlir_runner_utils.so and libmlir_c_runner_utils.so). This PR adds mlir_c_runner_utils and mlir_runner_utils into dependencies of check-mlir-python so it will make sure that these libraries are available before the test cases are executed. `` [4350/4351] Running the MLIR Python regression tests FAIL: MLIR :: python/execution_engine.py (92 of 99) ******************** TEST 'MLIR :: python/execution_engine.py' FAILED ******************** Exit Code: 1 Command Output (stdout): -- # RUN: at line 1 env MLIR_RUNNER_UTILS=/llvm-project/build/lib/libmlir_runner_utils.so MLIR_C_RUNNER_UTILS=/llvm-project/build/lib/libmlir_c_runner_utils.so /python-env/bin/python3 /llvm-project/mlir/test/python/execution_engine.py 2>&1 | /llvm-project/build/bin/FileCheck /llvm-project/mlir/test/python/execution_engine.py # executed command: env MLIR_RUNNER_UTILS=/llvm-project/build/lib/libmlir_runner_utils.so MLIR_C_RUNNER_UTILS=/llvm-project/build/lib/libmlir_c_runner_utils.so /python-env/bin/python3 /llvm-project/mlir/test/python/execution_engine.py # note: command had no output on stdout or stderr # error: command failed with exit status: 1 # executed command: /llvm-project/build/bin/FileCheck /llvm-project/mlir/test/python/execution_engine.py # .---command stderr------------ # | /llvm-project/mlir/test/python/execution_engine.py:741:16: error: CHECK-LABEL: expected string not found in input # | # CHECK-LABEL: TEST: testNanoTime # | ^ # | <stdin>:62:24: note: scanning from here # | TEST: testSharedLibLoad # | ^ # | <stdin>:73:68: note: possible intended match here # | File "/llvm-project/mlir/test/python/execution_engine.py", line 732, in testSharedLibLoad # | ^ # | # | Input file: <stdin> # | Check file: /llvm-project/mlir/test/python/execution_engine.py # | # | -dump-input=help explains the following input dump. # | # | Input was: # | <<<<<< # | . # | . # | . # | 57: TEST: testF8E5M2Memref # | 58: # | 59: TEST: testDynamicMemrefAdd2D # | 60: True # | 61: # | 62: TEST: testSharedLibLoad # | label:741'0 X error: no match found # | 63: Failed to create MemoryBuffer for: /llvm-project/build/lib/libmlir_runner_utils.so # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 64: Error: No such file or directory # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 65: Failed to create MemoryBuffer for: /llvm-project/build/lib/libmlir_c_runner_utils.so # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 66: Error: No such file or directory # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 67: JIT session error: Symbols not found: [ _mlir_ciface_printMemrefF32 ] # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 68: Traceback (most recent call last): # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 69: File "/llvm-project/mlir/test/python/execution_engine.py", line 737, in <module> # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 70: run(testSharedLibLoad) # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~ # | 71: File "/llvm-project/mlir/test/python/execution_engine.py", line 35, in run # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 72: f() # | label:741'0 ~~~~~ # | 73: File "/llvm-project/mlir/test/python/execution_engine.py", line 732, in testSharedLibLoad # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | label:741'1 ? possible intended match # | 74: execution_engine.invoke("main", arg0_memref_ptr) # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 75: File "/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir/execution_engine.py", line 31, in invoke # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 76: func = self.lookup(name) # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~ # | 77: ^^^^^^^^^^^^^^^^^ # | label:741'0 ~~~~~~~~~~~~~~~~~~~ # | 78: File "/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir/execution_engine.py", line 22, in lookup # | label:741'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # | . # | . # | . # | >>>>>> # ----------------------------- # error: command failed with exit status: 1 -- ******************** ******************** Failed Tests (1): MLIR :: python/execution_engine.py Testing Time: 2.60s Total Discovered Tests: 99 Unsupported: 2 (2.02%) Passed : 96 (96.97%) Failed : 1 (1.01%) FAILED: tools/mlir/test/python/CMakeFiles/check-mlir-python /llvm-project/build/tools/mlir/test/python/CMakeFiles/check-mlir-python cd /llvm-project/build/tools/mlir/test/python && /python-env/bin/python3 /llvm-project/build/./bin/llvm-lit -sv /llvm-project/build/tools/mlir/test/python ninja: build stopped: subcommand failed. ``` | 8 个月前 | |
[NFC][Py Reformat] Reformat python files in mlir subdir This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with black. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential Revision: https://reviews.llvm.org/D150782 | 3 年前 | |
[MLIR][ExecutionEngine] don't dump decls (#164478) Currently ExecutionEngine tries to dump all functions declared in the module, even those which are "external" (i.e., linked/loaded at runtime). E.g. mlir func.func private @printF32(f32) func.func @supported_arg_types(%arg0: i32, %arg1: f32) { call @printF32(%arg1) : (f32) -> () return } fails with Could not compile printF32: Symbols not found: [ __mlir_printF32 ] Program aborted due to an unhandled Error: Symbols not found: [ __mlir_printF32 ] even though printF32 can be provided at final build time (i.e., when the object file is linked to some executable or shlib). E.g, if our own libmlir_c_runner_utils is linked. So just skip functions which have no bodies during dump (i.e., are decls without defns). | 8 个月前 | |
[MLIR] Split ExecutionEngine Initialization out of ctor into an explicit method call (#153524) Retry landing https://github.com/llvm/llvm-project/pull/153373 ## Major changes from previous attempt - remove the test in CAPI because no existing tests in CAPI deal with sanitizer exemptions - update mlir/docs/Dialects/GPU.md to reflect the new behavior: load GPU binary in global ctors, instead of loading them at call site. - skip the test on Aarch64 since we have an issue with initialization there --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com> | 11 个月前 | |
[NFC][Py Reformat] Reformat python files in mlir subdir This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with black. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential Revision: https://reviews.llvm.org/D150782 | 3 年前 | |
[mlir][py] invalidate nested operations when parent is deleted (#93339) When an operation is erased in Python, its children may still be in the "live" list inside Python bindings. After this, if some of the newly allocated operations happen to reuse the same pointer address, this will trigger an assertion in the bindings. This assertion would be incorrect because the operations aren't actually live. Make sure we remove the children operations from the "live" list when erasing the parent. This also concentrates responsibility over the removal from the "live" list and invalidation in a single place. Note that this requires the IR to be sufficiently structurally valid so a walk through it can succeed. If this invariant was broken by, e.g, C++ pass called from Python, there isn't much we can do. | 2 年前 | |
Enabled freethreading support in MLIR python bindings (#122684) Reland reverted https://github.com/llvm/llvm-project/pull/107103 with the fixes for Python 3.8 cc @jpienaar Co-authored-by: Peter Hawkins <phawkins@google.com> | 1 年前 | |
[MLIR][Python] Expose PassManager::enableStatistics to CAPI and Python (#162591) PassManager::enableStatistics seems currently missing in both C API and Python bindings. So here we added them in this PR, which includes the PassDisplayMode enum type and the EnableStatistics method. | 9 个月前 | |
[MLIR][Python] Add the ability to signal pass failures in python-defined passes (#157613) This is a follow-up PR for #156000. In this PR we add the ability to signal pass failures ( signal_pass_failure()) in python-defined passes. To achieve this, we expose MlirExternalPass via nb::class_ with a method signal_pass_failure(), and the callable passed to pm.add(..) now accepts two arguments (op: MlirOperation, pass_: MlirExternalPass). For example: python def custom_pass_that_fails(op, pass_): if some_condition: pass_.signal_pass_failure() # do something | 10 个月前 | |
[MLIR][Python] add type hints for accessors (#158455) This PR adds type hints for accessors in the generated builders. | 10 个月前 | |
[MLIR][Python] Pass OpView subclasses instead of Operation in rewrite patterns (#163080) This is a follow-up PR for #162699. Currently, in the function where we define rewrite patterns, the op we receive is of type ir.Operation rather than a specific OpView type (such as arith.AddIOp). This means we can’t conveniently access certain parts of the operation — for example, we need to use op.operands[0] instead of op.lhs. The following example code illustrates this situation. python def to_muli(op, rewriter): # op is typed ir.Operation instead of arith.AddIOp pass patterns.add(arith.AddIOp, to_muli) In this PR, we convert the operation to its corresponding OpView subclass before invoking the rewrite pattern callback, making it much easier to write patterns. --------- Co-authored-by: Maksim Levental <maksim.levental@gmail.com> | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 8 个月前 | ||
| 11 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 9 个月前 |