23 Commits

Author SHA1 Message Date
Kun Wu
d46bad7b55 [mlir][sparse][gpu] add the 2:4 spmm integration test from linalg
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D155351
2023-07-15 06:01:03 +00:00
Aart Bik
4df01dc270 [mlir][sparse][gpu][nvidia] add pruning step and check to 2:4 matrix multiplication
(1) without the check, the results may silently be wrong, so check is needed
(2) add pruning step to guarantee 2:4 property

Note, in the longer run, we may want to split out the pruning step somehow,
or make it optional.

Reviewed By: K-Wu

Differential Revision: https://reviews.llvm.org/D155320
2023-07-14 12:08:13 -07:00
Aart Bik
f6f817d0d7 [mlir][sparse][gpu] minor improvements in 2:4 example
Reviewed By: K-Wu

Differential Revision: https://reviews.llvm.org/D155244
2023-07-13 16:20:27 -07:00
Guray Ozen
22a32f7d9c [mlir][gpu] Add dump-ptx option
When targeting NVIDIA GPUs, seeing the generated PTX is important. Currently, we don't have simple way to do it.

This work adds dump-ptx to gpu-to-cubin pass. One can use it like `gpu-to-cubin{chip=sm_90 features=+ptx80 dump-ptx}`.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D155166
2023-07-13 21:14:57 +02:00
Kun Wu
be2dd22b8f [mlir][sparse][gpu] reuse CUDA environment handle throughout instance lifetime
Differential Revision: https://reviews.llvm.org/D153173
2023-06-30 21:52:34 +00:00
Aart Bik
cdbdf93bf0 [mlir][sparse][gpu] extend SDDMM gpu test
Reviewed By: K-Wu

Differential Revision: https://reviews.llvm.org/D153378
2023-06-20 16:12:12 -07:00
Kun Wu
632ccc538c [mlir][sparse][gpu] remove tuple as one of the spmm_buffer_size output type
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D153188
2023-06-19 15:57:50 +00:00
Kun Wu
9167dd46ba [mlir][sparse][gpu] recognizing sddmm pattern in GPU libgen path
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D151582
2023-06-15 23:48:11 +00:00
Kun Wu
b1c683f5c4 [mlir][sparse][gpu] enable sm80+ sparsity integration test only when explicitly set
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D152966
2023-06-15 17:44:38 +00:00
Kun Wu
8f3fcbc687 [mlir][sparse][GPU] add 2:4 integration test
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D152287
2023-06-13 02:10:26 +00:00
Tobias Hieta
f9008e6366
[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
2023-05-26 08:05:40 +02:00
Aart Bik
22caafc9f3 [mlir][sparse][gpu] end to end test for matmul
(1) minor bug fix in copy back [always nice to run stuff ;-)]
(2) run with and without lib (even though some fall back to CPU)

Reviewed By: wrengr

Differential Revision: https://reviews.llvm.org/D151507
2023-05-25 16:10:22 -07:00
Aart Bik
76b7dca47d [mlir][sparse][gpu] fixed typo in CUDA test
Test was printing same result twice

Reviewed By: K-Wu

Differential Revision: https://reviews.llvm.org/D151370
2023-05-24 18:00:23 -07:00
wren romano
7f5fb90bbb [mlir][sparse] Fixing GPU tests (followup to D150330)
The GPU tests weren't updated when rebasing D150330, so this patch fixes that.

Reviewed By: anlunx

Differential Revision: https://reviews.llvm.org/D150822
2023-05-17 15:29:54 -07:00
wren romano
a0615d020a [mlir][sparse] Renaming the STEA field dimLevelType to lvlTypes
This commit is part of the migration of towards the new STEA syntax/design.  In particular, this commit includes the following changes:
* Renaming compiler-internal functions/methods:
  * `SparseTensorEncodingAttr::{getDimLevelType => getLvlTypes}`
  * `Merger::{getDimLevelType => getLvlType}` (for consistency)
  * `sparse_tensor::{getDimLevelType => buildLevelType}` (to help reduce confusion vs actual getter methods)
* Renaming external facets to match:
  * the STEA parser and printer
  * the C and Python bindings
  * PyTACO

However, the actual renaming of the `DimLevelType` itself (along with all the "dlt" names) will be handled in a separate commit.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D150330
2023-05-17 14:24:09 -07:00
Aart Bik
7c1fb94150 [mlir][sparse] change runners to c_runners
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D150628
2023-05-15 18:17:52 -07:00
Aart Bik
c820f9e6ae [mlir][sparse][gpu] end-to-end integration test of GPU libgen approach
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D150172
2023-05-15 10:57:14 -07:00
Aart Bik
86888e420c [mlir][sparse][gpu] generate proper memcpy in/out host and device
The host registration is a convenient way to get CUDA kernels
running, but it may be slow and does not work for all buffer
(like global constants). This revision uses the proper alloc
copy dealloc chains for buffers, using asynchronous chains
to increase overlap. The host registration mechanism is
kept under a flag for the output, just for experimentation
purposes while this project ramps up.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D148682
2023-04-21 09:30:42 -07:00
Aart Bik
bdea9b960d [mlir][sparse][gpu] put sparse compiler GPU end-to-end tests back
SM80 flag guards the test for targets that do not support A100 GPUs

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D147863
2023-04-11 15:37:13 -07:00
Mehdi Amini
10dbf23edc Revert "[mlir][sparse][gpu] end-to-end example with sparse GPU pipeline"
This reverts commit bf94afa10e5101f401f191f0386a9316cf0a5cda.

The bot is broken: https://lab.llvm.org/buildbot/#/builders/61/builds/42062
2023-04-06 19:11:27 -07:00
Mehdi Amini
103890fc07 Revert "[mlir][sparse][gpu] end-to-end test for 2:4 sparsity on NVidia GPUs"
This reverts commit a2c63d7f0b77ae92c97974d0630625d83a0745ce.

The bot is broken: https://lab.llvm.org/buildbot/#/builders/61/builds/42062
2023-04-06 19:11:27 -07:00
Aart Bik
bf94afa10e [mlir][sparse][gpu] end-to-end example with sparse GPU pipeline
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D147576
2023-04-05 16:10:21 -07:00
Aart Bik
a2c63d7f0b [mlir][sparse][gpu] end-to-end test for 2:4 sparsity on NVidia GPUs
Example of using 2:4 sparsity on NVidia GPU

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D145447
2023-03-21 13:32:43 -07:00