-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable using bare pointers for GPU kernels with static shape, and then use that support #690
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for doing that.
Update: looks like we need to poke at how MIOpen calls us... |
We're now |
edc905e
to
0cd8182
Compare
7366727
to
232bc39
Compare
232bc39
to
cd80dc5
Compare
(Update, @jungpark-mlir might be the person to tag in for MIGraphX? ) |
cd80dc5
to
c09ab72
Compare
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/blob/7dcae03776938bf983ef6184a13bb9bcada678b5/src/targets/gpu/mlir.cpp#L623 |
c09ab72
to
cb840be
Compare
Blocked on @zhanglx13 getting his changes to finding MLIR into MIOpen, since we don't want both those changes to be one MIOpen PR ROCm/MIOpen#1673 |
@@ -18,6 +18,8 @@ | |||
extern "C" { | |||
#endif | |||
|
|||
#define MLIR_MIGRAPHX_DIALECT_API_VERSION 2 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a comment here to keep the features added/deleted per each version?
0ff9ad5
to
07b8cd3
Compare
Once ROCm/rocMLIR#690 lands, the ABI for MLIR-generated kernels will change. This commit prepares MIGraphX for the change by conditionally selecting the new ABI if MLIR reports a sufficiently high API version in its headers.
07b8cd3
to
15804eb
Compare
This is a companion PR to ROCm/rocMLIR#690 and should not be merged until that lands. These changes will need to be revisited if the MLIR solver ever supports dynamic shapes.
In the ROCm runtime (and probably CUDA as well), all kernel arguments are aligned. Therefore, enable using bare pointers for memref arguments to kernels when these memrefs have static shape and a trivial layout. This is a substantial optimization to launching kernels that use memrefs with known, static sizes, since it causes the kernel launch packet to no longer include information already known to the kernel, which can enable packing the kernel launch arguments into launch packets instead of having to allocate an entire separate structure to hold unneeded memref information. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D130716
Keeping with the external changes that enable using bare pointer memref args in gpu kernels, turn on that option for our pipelines and runners by default, but add options to disable bare pointers for cases (either currently existing or upcoming) where memrefs of unknown shape come in to the picture. Fixes ROCm/rocMLIR-internal#583
15804eb
to
9f35ba7
Compare
The changes needed to make this work upstream are at https://reviews.llvm.org/D130716 and have landed - a copy of that commit is on this branch