Page MenuHomePhabricator

[MLIR][GPU] Add CUDA Tensor core WMMA test
ClosedPublic

Authored by navdeepkk on Jan 24 2021, 11:27 PM.

Details

Summary

Add a test case to test the complete execution of WMMA ops on a Nvidia GPU with tensor cores.

Diff Detail

Event Timeline

navdeepkk created this revision.Jan 24 2021, 11:27 PM
navdeepkk requested review of this revision.Jan 24 2021, 11:27 PM
ftynse added a subscriber: ftynse.

@csigg have we decided on moving such tests to integration_test/ ?

csigg added a comment.Jan 25 2021, 8:56 AM

@csigg have we decided on moving such tests to integration_test/ ?

Not that I'm aware of. I wouldn't hold back this revision, but let me know if you want me to move everything afterwards.

bondhugula accepted this revision.Jan 26 2021, 2:42 AM

Looks great.

This revision is now accepted and ready to land.Jan 26 2021, 2:42 AM
bondhugula added inline comments.Jan 26 2021, 3:59 AM
mlir/test/mlir-cuda-runner/wmma-matmul.mlir
8–10 ↗(On Diff #318909)

All alignment attributes have a typo.

navdeepkk updated this revision to Diff 321333.Feb 4 2021, 12:06 AM

Changes in this diff :-

1.) Modify the test case to use the !gpu.mmafragment type introduced in 
  revision D95330.
bondhugula accepted this revision.Feb 4 2021, 12:41 AM
navdeepkk updated this revision to Diff 324332.Feb 17 2021, 8:57 AM
navdeepkk marked an inline comment as done.

Changes in this diff :-

1.) Change type of ldm attribute in load/store fragment from i32 to index.
navdeepkk updated this revision to Diff 342271.May 2 2021, 1:44 PM

Changes in this diff :-

1.) Make changes to operate with the newly intoduced gpu.mma_matrix type.
navdeepkk updated this revision to Diff 347047.May 21 2021, 8:49 AM

Rebase on upstream/main.

bondhugula accepted this revision.May 21 2021, 8:53 AM
bondhugula requested changes to this revision.May 21 2021, 9:01 AM
bondhugula added a subscriber: ThomasRaoux.

I just realized that getting these test cases in will mean check-mlir will fail for all those without tensor cores on GPUs (if they are configuring with NVPTX)! Can we add an -DMLIR_ENABLE_CUDA_TENSOR_CORES and have these tests run under that? @ftynse @ThomasRaoux

This revision now requires changes to proceed.May 21 2021, 9:01 AM

I just realized that getting these test cases in will mean check-mlir will fail for all those without tensor cores on GPUs (if they are configuring with NVPTX)! Can we add an -DMLIR_ENABLE_CUDA_TENSOR_CORES and have these tests run under that? @ftynse @ThomasRaoux

Correct, for example we have some systems on our CI running CUDA execution tests that don't have tensor cores.

bondhugula added inline comments.May 21 2021, 10:57 PM
mlir/test/Integration/GPU/CUDA/wmma-matmul-f16.mlir
1–7

Please configure to run these tests only under a -DMLIR_ENABLE_CUDA_TENSOR_CORES.

navdeepkk updated this revision to Diff 347183.May 22 2021, 2:22 AM

Changes in this diff:-

1.) Add flag to enable/disable Tensor core WMMA tests.
2.) Rebase on upstream/main.
navdeepkk updated this revision to Diff 347185.May 22 2021, 2:52 AM

Changes in this diff :-

1.) Remove unnecessary alignment attribute.
bondhugula accepted this revision.May 22 2021, 2:56 AM

LGTM. Some minor comments.

mlir/test/CMakeLists.txt
35 ↗(On Diff #347185)

Nit: Tensor core -> CUDA tensor core

mlir/test/Integration/GPU/CUDA/TensorCore/lit.local.cfg
3 ↗(On Diff #347185)

enabled

4 ↗(On Diff #347185)

...run_tensor_core... -> run_cuda_tensor_core...
for better context?

This revision is now accepted and ready to land.May 22 2021, 2:56 AM
navdeepkk updated this revision to Diff 347188.May 22 2021, 3:22 AM
navdeepkk marked 2 inline comments as done.

Changes in this diff :-

1.) Address comments on previous diff.

Please update the commit summary. It's no longer accurate.

navdeepkk edited the summary of this revision. (Show Details)May 22 2021, 3:40 AM
navdeepkk retitled this revision from [MLIR][CUDA-RUNNER] Add WMMA Tensor core matmul test to [MLIR][GPU] Add WMMA Tensor core matmul test.
navdeepkk retitled this revision from [MLIR][GPU] Add WMMA Tensor core matmul test to [MLIR][GPU] Add CUDA Tensor core WMMA test.May 22 2021, 3:43 AM
navdeepkk updated this revision to Diff 347193.May 22 2021, 3:45 AM
navdeepkk marked an inline comment as done.

Fix commit summary and title.

This revision was landed with ongoing or failed builds.May 22 2021, 3:50 AM
This revision was automatically updated to reflect the committed changes.