This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse][gpu] introduce flag that controls host to device copy strategies (regular dma default)
ClosedPublic

Authored by K-Wu on Jul 14 2023, 8:06 PM.

Diff Detail

Event Timeline

K-Wu created this revision.Jul 14 2023, 8:06 PM
Herald added a project: Restricted Project. · View Herald Transcript
K-Wu updated this revision to Diff 540632.Jul 14 2023, 8:48 PM

disabling zero copy test for the time being

K-Wu updated this revision to Diff 540633.Jul 14 2023, 8:49 PM

recover

K-Wu retitled this revision from [sparse][mlir][gpu] add copy flag to choose copy strategy in Sparse GPU libgen path to [mlir][sparse][gpu] introduce flag that controls host to device copy strategies (regular dma default).
K-Wu added inline comments.
mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.td
126

TODO: unnecessary change:

K-Wu updated this revision to Diff 541775.Jul 18 2023, 4:23 PM

updating

K-Wu updated this revision to Diff 542291.Jul 19 2023, 8:48 PM

upd tests

K-Wu updated this revision to Diff 546166.Aug 1 2023, 11:36 AM

add assertion to disable zero-copy at this moment

K-Wu published this revision for review.Aug 1 2023, 12:13 PM
aartbik added inline comments.Aug 1 2023, 12:33 PM
mlir/include/mlir/Dialect/SparseTensor/Pipelines/Passes.h
55

can we make this a bit more precise, e.g. transfer -> gpuDataTransfer

mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
47

add a TODO that ZeroCopy is not supported yet, together with a tracker # that describes the problem so it can be fixed in the future (and then enabled here)

mlir/lib/Dialect/SparseTensor/Transforms/SparseGPUCodegen.cpp
494

this change changes the order in all our tests; can't we keep the original order, and to the !regularDMA part later?
(bit hard to judge, so this is a soft request, okay to keep if needed)

496

keep block together (unnecessary change)

or, start new block with comment if you want to have whitespace
(but given content above, that makes less sense)

497

to avoid the underscore and keep naming consistent, can't we just use

castR
castC
castV
castX
castY

563

keep block together (unnecessary change)

574

no whiteline

623

same, just castR, castC etc.

745

no whiteline

746

castA, castB etc.

893

castB, castA

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
83–87

add tracker #

mlir/test/Integration/Dialect/SparseTensor/GPU/CUDA/sm80-lt/sparse-matmul-2-4-lib-from-linalg.mlir
14

add tracker #

mlir/test/Integration/Dialect/SparseTensor/GPU/CUDA/sparse-matmul-lib.mlir
17

tracker

mlir/test/Integration/Dialect/SparseTensor/GPU/CUDA/sparse-matvec-lib.mlir
16

tracker

mlir/test/Integration/Dialect/SparseTensor/GPU/CUDA/sparse-sampled-matmul-lib.mlir
17

tracker

K-Wu updated this revision to Diff 546200.Aug 1 2023, 1:29 PM
K-Wu marked 9 inline comments as done.

addressing comments

K-Wu marked an inline comment as done.Aug 1 2023, 1:29 PM

addressing some comments

K-Wu updated this revision to Diff 546203.Aug 1 2023, 1:32 PM
K-Wu marked an inline comment as done.

addressing comments

K-Wu updated this revision to Diff 546227.Aug 1 2023, 2:25 PM
K-Wu marked 5 inline comments as done.

reverting order changes and addressing comemnts

K-Wu updated this revision to Diff 546228.Aug 1 2023, 2:29 PM

fix tests

aartbik added inline comments.Aug 1 2023, 2:33 PM
mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
48

GPUDataTransferStrategy
(not necessary Sparse)

58–60

let's name this gpuDataTransferStrategy

mlir/test/Integration/Dialect/SparseTensor/GPU/CUDA/sm80-lt/sparse-matmul-2-4-lib.mlir
13

the other RUN and NOTRUN?

K-Wu updated this revision to Diff 546240.Aug 1 2023, 3:13 PM

remove unnecessary change

K-Wu edited the summary of this revision. (Show Details)Aug 1 2023, 3:15 PM
K-Wu updated this revision to Diff 546242.Aug 1 2023, 3:23 PM
K-Wu marked 3 inline comments as done.

addressing comments

K-Wu added a comment.Aug 1 2023, 3:23 PM

addressing comments

aartbik accepted this revision.Aug 1 2023, 3:29 PM
This revision is now accepted and ready to land.Aug 1 2023, 3:29 PM
This revision was landed with ongoing or failed builds.Aug 1 2023, 3:31 PM
This revision was automatically updated to reflect the committed changes.