[mlir][sparse] Moving integration tests that merely use the Python APIReviewed By: aartbikDifferential Revision: https://reviews.llvm.org/D114192
[mlir][sparse] run less combinations of SpMM in test (to reduce runtime)This revision also adds a few passes to the sparse compiler part to unify the transformation sequence with all other paths we
[mlir][sparse] run less combinations of SpMM in test (to reduce runtime)This revision also adds a few passes to the sparse compiler part to unify the transformation sequence with all other paths we currently use.Reviewed By: nicolasvasilacheDifferential Revision: https://reviews.llvm.org/D111900
show more ...
[mlir] Factor type reconciliation out of Standard-to-LLVM conversionConversion to the LLVM dialect is being refactored to be more progressive andis now performed as a series of independent passes
[mlir] Factor type reconciliation out of Standard-to-LLVM conversionConversion to the LLVM dialect is being refactored to be more progressive andis now performed as a series of independent passes converting differentdialects. These passes may produce `unrealized_conversion_cast` operations thatrepresent pending conversions between built-in and LLVM dialect types.Historically, a more monolithic Standard-to-LLVM conversion pass did not needthese casts as all operations were converted in one shot. Previous refactoringshave led to the requirement of running the Standard-to-LLVM conversion pass toclean up `unrealized_conversion_cast`s even though the IR had no standardoperations in it. The pass must have been also run the last among all to-LLVMpasses, in contradiction with the partial conversion logic. Additionally, theway it was set up could produce invalid operations by removing casts betweenLLVM and built-in types even when the consumer did not accept the uncastedtype, or could lead to cryptic conversion errors (recursive application of therewrite pattern on `unrealized_conversion_cast` as a means to indicate failureto eliminate casts).In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is notspecific to to-LLVM conversions and can be factored out into a separate typereconciliation pass, which is achieved in this commit. While the cast operationitself has a folder pattern, it is insufficient in most conversion passes asthe folder only applies to the second cast. Without complex legality setup inthe conversion target, the conversion infra will either consider the castoperations valid and not fold them (a separate canonicalization would benecessary to trigger the folding), or consider the first cast invalid upongeneration and stop with error. The pattern provided by the reconciliation passapplies to the first cast operation instead. Furthermore, having a separatepass makes it clear when `unrealized_conversion_cast`s could not have beeneliminated since it is the only reason why this pass can fail.Reviewed By: nicolasvasilacheDifferential Revision: https://reviews.llvm.org/D109507
[mlir][sparse][python] migrate more code from boilerplate into proper numpy landThe boilerplate was setting up some arrays for testing. To fully illustratepython - MLIR potential, however, this da
[mlir][sparse][python] migrate more code from boilerplate into proper numpy landThe boilerplate was setting up some arrays for testing. To fully illustratepython - MLIR potential, however, this data should also come from numpy land.Reviewed By: bixiaDifferential Revision: https://reviews.llvm.org/D108336
[mlir][sparse][python] make imports more selectiveReviewed By: bixiaDifferential Revision: https://reviews.llvm.org/D108055
[mlir][sparse][python] add an "exhaustive" sparse test using pythonUsing the python API to easily set up sparse kernels, this testexhaustively builds, compilers, and runs SpMM for all annotations
[mlir][sparse][python] add an "exhaustive" sparse test using pythonUsing the python API to easily set up sparse kernels, this testexhaustively builds, compilers, and runs SpMM for all annotationson a sparse tensor, making sure every version generates the correctresult. This test also illustrates using the python API to set upa sparse kernel and sparse compilation.Reviewed By: bixiaDifferential Revision: https://reviews.llvm.org/D107943
[mlir][sparse][capi][python] add sparse tensor passesFirst set of "boilerplate" to get sparse tensorpasses available through CAPI and Python.Reviewed By: stellaraccidentDifferential Revision:
[mlir][sparse][capi][python] add sparse tensor passesFirst set of "boilerplate" to get sparse tensorpasses available through CAPI and Python.Reviewed By: stellaraccidentDifferential Revision: https://reviews.llvm.org/D102362
[mlir][Python] Finish adding RankedTensorType support for encoding.Differential Revision: https://reviews.llvm.org/D102184
[mlir][Python] Re-export cext sparse_tensor module to the public namespace.* This was left out of the previous commit accidentally.Differential Revision: https://reviews.llvm.org/D102183
[mlir][Python] Upstream the PybindAdaptors.h helpers and use it to implement sparse_tensor.encoding.* The PybindAdaptors.h file has been evolving across different sub-projects (npcomp, circt) and h
[mlir][Python] Upstream the PybindAdaptors.h helpers and use it to implement sparse_tensor.encoding.* The PybindAdaptors.h file has been evolving across different sub-projects (npcomp, circt) and has been successfully used for out of tree python API interop/extensions and defining custom types.* Since sparse_tensor.encoding is the first in-tree custom attribute we are supporting, it seemed like the right time to upstream this header and use it to define the attribute in a way that we can support for both in-tree and out-of-tree use (prior, I had not wanted to upstream dead code which was not used in-tree).* Adapted the circt version of `mlir_type_subclass`, also providing an `mlir_attribute_subclass`. As we get a bit of mileage on this, I would like to transition the builtin types/attributes to this mechanism and delete the old in-tree only `PyConcreteType` and `PyConcreteAttribute` template helpers (which cannot work reliably out of tree as they depend on internals).* Added support for defaulting the MlirContext if none is passed so that we can support the same idioms as in-tree versions.There is quite a bit going on here and I can split it up if needed, but would prefer to keep the first use and the header together so sending out in one patch.Differential Revision: https://reviews.llvm.org/D102144