-
Notifications
You must be signed in to change notification settings - Fork 280
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
ch4/ucx: Use UCX active message API #4934
Conversation
test:mpich/ch4/ucx |
test:mpich/ch4/ucx |
Manual testing is showing an odd failure in |
I should note this is in the |
I think at some point jenkins server crashed. Rerun-the tests: test:mpich/ch4/ucx |
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.
This PR looks fine to me. Just a minor comment.
test:mpich/ch4/ucx |
Just for info, the AM APIs were added in UCX 1.7.0. |
There also might be a bug when using the AM API and sending to self. Need to see if it consistent with other versions of the library. |
test:mpich/ch4/ucx |
So this version copies all the data to a temporary buffer before calling the ch4 level callback. That fixes the alignment issues from ubsan, but it adds some significant overhead. Regardless of how we decide to move forward, this is a useful proof-of-concept to use for my talk later this month. Maybe I can convince them to make AM buffers well-aligned, unlike the libfabric folks and FI_MULTI_RECV... |
Yes! Do that 😃 |
A new AM API was added recently that is worth some investigation, too. openucx/ucx#5125 They even have an rdnv + am_recv concept that could map well to ch4-level interfaces. |
@raffenet Did you tried to talk to the folks in the last ucx meeting? Should we move forward? Refresh test -- |
They suggested a minimum version check like we do for other libraries. I'll add an autoconf patch to the PR, then we can more forward with it. |
99505eb
to
c6567a8
Compare
test:mpich/ch4/ucx |
9b7aa2f
to
fac1afc
Compare
test:mpich/ch4/ucx |
Updated external UCX lib in Jenkins. |
4854d68
to
0e6f071
Compare
test:mpich/ch4/ucx |
Yup. Working on it. It means we'll be tied to the newest version of UCX (released ~30 days ago), but that's probably not a big issue for MPICH 4.0. |
Ideally, we can consider both implementations and do a runtime selection. But probably it is not worth the trouble considering we have an embedded version and the default is to pick OFI -- oops, I guess that's not true, but it really makes sense for us to pick OFI as default. So another impact is we need to add more logic in configure that we need to check the versions of external ucx, and when they are too old, we need to use embedded ucx (but still pick ucx as a preference). |
To be more specific, the UCX AM interfaces didn't actually change. But the way they work changed in between versions WHILE STILL CLAIMING TO BE COMPATIBLE. There is no documentation about the change in semantics. There is no way to know how to deal with the new behavior. The old AM interface is unusable. It would have been better if they just deleted it from the library altogether. |
be2ac88
to
e76f47d
Compare
While testing a fix from the UCX folks for the backward compatibility issue, I confirmed there was still a bug in the AM code, which the last patch should hopefully fix. |
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. A couple of minor comments. I am eager to merge this.
AC_MSG_RESULT([$pac_have_ucx]) | ||
|
||
# if an old ucx was specified by the user, throw an error | ||
if test "$pac_have_ucx" = "no" -a -n "$with_ucx" -a "$with_ucx" != "yes" ; then |
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.
Maybe we need to move this check into the "non-embedded" branch later.
I think we always need an error message in this case ($pack_have_ucx = no
). For better error messages, we may have to run two tests, one just probe ucx header, the second one check versions and we need tell the user what is the required minimum version.
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.
OK, will do.
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.
You think throw an error when system UCX is found but is not new enough? That is, tell the user to provide embedded rather than fallback automatically? Obviously we want to throw an error if they specify an old installation. I am thinking of the --with-ucx
case.
(char *) msg_hdr->payload + (info->length - msg_hdr->data_sz - sizeof(*msg_hdr)); | ||
/* need to copy the message data for alignment purposes */ | ||
tmp = MPL_malloc(length, MPL_MEM_BUFFER); | ||
MPIR_Memcpy(tmp, data, length); |
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.
So UCX also doesn't guarantee any minimum alignment?
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.
That's right. With the new API (>= 1.10.0) there is RNDV support for AMs so that we can save an extra copy. I think we can work on integrating that, but it is still quite new so this PR is probably a good starting point for now.
FYI: the ofi |
test:mpich/ch4/most ✅ |
|
||
# if a too old UCX was found, throw an error | ||
if test "$ucx_happy" = "no" ; then | ||
AC_MSG_ERROR([UCXinstallation does not meet minimum version requirement (v1.7.0). Please upgrade your installation, or use --with-ucx=embedded.]) |
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.
missing a space here 🤦. will fixup before merge if approved.
@@ -46,6 +46,19 @@ AM_COND_IF([BUILD_CH4_NETMOD_UCX],[ | |||
else | |||
dnl PAC_PROBE_HEADER_LIB must've been successful | |||
AC_MSG_NOTICE([CH4 UCX Netmod: Using an external ucx]) | |||
|
|||
AC_MSG_CHECKING([if UCX meets minimum version requirement]) |
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.
moved version check to this block, which will throw an error if the external lib is not new enough, regardless of whether the user specified it or not.
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 to me.
I am going to run a custom asan
test to see where we stand.
test:mpich/custom --enable-g=asan |
Looks like dtpools data corruption + 1 slow test failure. I'm curious what is happening in the dtpools cases. I wonder if disabling the UCX memory hooks will change anything. Will try a quick experiment. Will merge this in the meantime. |
Require UCX version 1.7.0 or later. This ensures atomic and active message APIs utilized by MPICH are provided.
Replace layering of active messages over tagged send/recv interface with UCP active messages. This is an initial, functional implementation. It should work the same as before, but eliminates a probe operation in netmod progress that can slowdown applications significantly when there is a buildup of unexpected messages.
We now require UCX v1.7.0 to build MPICH. These RMA API checks from versions < v1.4.0 are no longer needed.
In the case of ch4/ucx self transport, active messages are sent and handled immediately by the target. In the case of rendezvous, it means message data is copied immediately upon CTS issue. Make sure the recv request is fully setup before CTS to avoid unexpected crashes.
@hzhou I also added a commit to note the UCX version requirement in |
I can reproduce the failures with the embedded module. Disabling hooks (UCX_MEM_MMAP_HOOK_MODE=none) does fix them. Oddly enough, I could not reproduce them with an external library. Need to double check versions. |
👍 Is that an environment variable that we can set for the |
Yes. |
Pull Request Description
Replace layering of active messages over tagged send/recv interface
with UCP active messages. This is an initial, functional
implementation. It should work the same as before, but eliminates a
probe operation in netmod progress that can slowdown applications
significantly when there is a buildup of unexpected messages.
Expected Impact
Author Checklist
module: short description
and follows good practice