Skip to content

Support GEMM Pipelining *without* Epilogue Peeling - #10388

Merged
manishucsd merged 1 commit into
iree-org:mainfrom
manishucsd:epilogue_peeling_false
Sep 16, 2022
Merged

manishucsd merged 1 commit into
iree-org:mainfrom
manishucsd:epilogue_peeling_false

Conversation

@manishucsd

@manishucsd manishucsd commented Sep 13, 2022 •

Copy link
Copy Markdown
Contributor
  • GEMM Pipelining without epilogue peeling (unpeeled epilogue) requires prediction for operations with side effects.
  • For example, unpleed epilogue requires handling OOB access on Global Memory (src ofAsyncCopyOp) for the last few gemm-k-iterations.
  • This PR uses AsyncCopyOp with zfill to handle OOB access on the last few gemm-k-iterations that moves from peeled epilogue to the GEMM mainloop for an unpeeled epilogue.
  • This PR adds a new pass options (epilogue-peeling=<bool>) to GPUPipeliningPass to switch between peeled and unpeeled epilogue.
  • epilogue-peeling is set to true by default, for now, in order to not change the current wmma-based GEMMs, unpeeled epilogue has proven to improve performance of mma.sync-based GEMMs.

@manishucsd
manishucsd force-pushed the epilogue_peeling_false branch 8 times, most recently from c4a783c to 993f1f6 Compare September 15, 2022 04:10
@iree-github-actions-bot

Copy link
Copy Markdown
Contributor

Abbreviated Linux Benchmark Summary

@ commit 993f1f67d7242fd40ff4b7a2dcd4078183de34b9 (vs. base 1c186886757f7281e7cf528c7b13c205a5006c69)

No improved or regressed benchmarks 🏖️

Regressed Compilation Times 🚩

Benchmark Name Compilation Time (ms)
PoseNet [fp32] (TFLite) CPU-x86\_64-CascadeLake 8-thread,full-inference,default-flags 12378 (vs. 8673, 42.72%↑)
PoseNet [fp32] (TFLite) CPU-x86\_64-CascadeLake full-inference,default-flags 12378 (vs. 8673, 42.72%↑)
PoseNet [fp32] (TFLite) CPU-x86\_64-CascadeLake 4-thread,full-inference,default-flags 12378 (vs. 8673, 42.72%↑)

[Top 3 out of 48 results showed]

Improved Compilation Times 🎉

Benchmark Name Compilation Time (ms)
MobileBertSquad [fp32] (TFLite) CPU-RV64-Generic full-inference,default-flags 59966 (vs. 63822, 6.04%↓)

Regressed Total Dispatch Sizes 🚩

Benchmark Name Total Dispatch Size (bytes)
MobileBertSquad [fp32] (TFLite) CPU-RV64-Generic full-inference,default-flags 37896 (vs. 23296, 62.67%↑)
MobileBertSquad [int8] (TFLite) CPU-RV64-Generic full-inference,default-flags 2331360 (vs. 1901536, 22.60%↑)

For more information:

@manishucsd
manishucsd force-pushed the epilogue_peeling_false branch from 993f1f6 to 19c3e5f Compare September 15, 2022 15:30
@manishucsd
manishucsd merged commit 8d1e6ab into iree-org:main Sep 16, 2022
manishucsd pushed a commit that referenced this pull request Jan 23, 2023
…atrix] (#11817)

Adds native Tensor Core (F16) support for NVIDIA GPUs. Specifically,
adds support to target
`mma.sync.aligned.m16n8k16.row.col.f16.f16.f16.f16` and `ldmatrix`
instructions on NVIDIA A100 GPUs. For now, these instructions are not
enabled by default and requires using
(`--iree-codegen-llvmgpu-use-mma-sync=true`).

IREE runs row-row matmul and the native Tensor Core support requires
`ldmatrix` for operandA and `ldmatrix.trans` for operandB.
`ldmatrix.trans` transposes the data while loading to use Tensor Core
`mma*row.col*` instruction.

There are LLVM/MLIR upstream pathes and previous IREE PRs that enable
targeting native Tensor Core F16 support.

A few LLVM/MLIR upstream patches:
- [[mlir][NVGPU] Adding Support for cp_async_zfill via Inline
Asm](https://reviews.llvm.org/D132269)
- [[mlir][NVGPU] Handle Native mma.sync sizes and ldmatrix(x4) for
matrixB](https://reviews.llvm.org/D135749)
- [[mlir][NVGPU] Fix affine maps computing indices for LdMatrixOp
srcMemref](https://reviews.llvm.org/D138978)
- [[mlir][NVGPU] Fix NVGPU Bazel
Layering](https://reviews.llvm.org/D141982)


Previous IREE PRs:
- [Support GEMM Pipelining *without* Epilogue
Peeling](#10388)
- [Add support for GEMM e2e Test For CUDA backend on F16
input](#10842)
qedawkins pushed a commit to qedawkins/iree that referenced this pull request Apr 2, 2023
…atrix] (iree-org#11817)

Adds native Tensor Core (F16) support for NVIDIA GPUs. Specifically,
adds support to target
`mma.sync.aligned.m16n8k16.row.col.f16.f16.f16.f16` and `ldmatrix`
instructions on NVIDIA A100 GPUs. For now, these instructions are not
enabled by default and requires using
(`--iree-codegen-llvmgpu-use-mma-sync=true`).

IREE runs row-row matmul and the native Tensor Core support requires
`ldmatrix` for operandA and `ldmatrix.trans` for operandB.
`ldmatrix.trans` transposes the data while loading to use Tensor Core
`mma*row.col*` instruction.

There are LLVM/MLIR upstream pathes and previous IREE PRs that enable
targeting native Tensor Core F16 support.

A few LLVM/MLIR upstream patches:
- [[mlir][NVGPU] Adding Support for cp_async_zfill via Inline
Asm](https://reviews.llvm.org/D132269)
- [[mlir][NVGPU] Handle Native mma.sync sizes and ldmatrix(x4) for
matrixB](https://reviews.llvm.org/D135749)
- [[mlir][NVGPU] Fix affine maps computing indices for LdMatrixOp
srcMemref](https://reviews.llvm.org/D138978)
- [[mlir][NVGPU] Fix NVGPU Bazel
Layering](https://reviews.llvm.org/D141982)


Previous IREE PRs:
- [Support GEMM Pipelining *without* Epilogue
Peeling](iree-org#10388)
- [Add support for GEMM e2e Test For CUDA backend on F16
input](iree-org#10842)
jpienaar pushed a commit that referenced this pull request May 1, 2023
…atrix] (#11817)

Adds native Tensor Core (F16) support for NVIDIA GPUs. Specifically,
adds support to target
`mma.sync.aligned.m16n8k16.row.col.f16.f16.f16.f16` and `ldmatrix`
instructions on NVIDIA A100 GPUs. For now, these instructions are not
enabled by default and requires using
(`--iree-codegen-llvmgpu-use-mma-sync=true`).

IREE runs row-row matmul and the native Tensor Core support requires
`ldmatrix` for operandA and `ldmatrix.trans` for operandB.
`ldmatrix.trans` transposes the data while loading to use Tensor Core
`mma*row.col*` instruction.

There are LLVM/MLIR upstream pathes and previous IREE PRs that enable
targeting native Tensor Core F16 support.

A few LLVM/MLIR upstream patches:
- [[mlir][NVGPU] Adding Support for cp_async_zfill via Inline
Asm](https://reviews.llvm.org/D132269)
- [[mlir][NVGPU] Handle Native mma.sync sizes and ldmatrix(x4) for
matrixB](https://reviews.llvm.org/D135749)
- [[mlir][NVGPU] Fix affine maps computing indices for LdMatrixOp
srcMemref](https://reviews.llvm.org/D138978)
- [[mlir][NVGPU] Fix NVGPU Bazel
Layering](https://reviews.llvm.org/D141982)


Previous IREE PRs:
- [Support GEMM Pipelining *without* Epilogue
Peeling](#10388)
- [Add support for GEMM e2e Test For CUDA backend on F16
input](#10842)
rengolin pushed a commit to plaidml/iree that referenced this pull request May 2, 2023
…atrix] (iree-org#11817)

Adds native Tensor Core (F16) support for NVIDIA GPUs. Specifically,
adds support to target
`mma.sync.aligned.m16n8k16.row.col.f16.f16.f16.f16` and `ldmatrix`
instructions on NVIDIA A100 GPUs. For now, these instructions are not
enabled by default and requires using
(`--iree-codegen-llvmgpu-use-mma-sync=true`).

IREE runs row-row matmul and the native Tensor Core support requires
`ldmatrix` for operandA and `ldmatrix.trans` for operandB.
`ldmatrix.trans` transposes the data while loading to use Tensor Core
`mma*row.col*` instruction.

There are LLVM/MLIR upstream pathes and previous IREE PRs that enable
targeting native Tensor Core F16 support.

A few LLVM/MLIR upstream patches:
- [[mlir][NVGPU] Adding Support for cp_async_zfill via Inline
Asm](https://reviews.llvm.org/D132269)
- [[mlir][NVGPU] Handle Native mma.sync sizes and ldmatrix(x4) for
matrixB](https://reviews.llvm.org/D135749)
- [[mlir][NVGPU] Fix affine maps computing indices for LdMatrixOp
srcMemref](https://reviews.llvm.org/D138978)
- [[mlir][NVGPU] Fix NVGPU Bazel
Layering](https://reviews.llvm.org/D141982)


Previous IREE PRs:
- [Support GEMM Pipelining *without* Epilogue
Peeling](iree-org#10388)
- [Add support for GEMM e2e Test For CUDA backend on F16
input](iree-org#10842)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants