Fix Libfabric MR caching issues #13327
Merged
+202
−95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix a set of bugs in both the OFI BTL and OFI MTL around caching MRs. The Libfabric EFA provider used to (erroneously) cache explicitly created MRs and will stop doing so in Libfabric 2.2. This caused a performance regression in both the OFI MTL (with HMEM) and BTL (always) over EFA because bad behaviors had snuck in OMPI w.r.t assuming the provider caches MRs. So we stop disabling the BTL rcache for EFA and add an rcache for HMEM MRs for the OFI MTL. The OFI MTL requires the provider not require FI_MR_LOCAL, so we don't need to worry about caching general MRs there.
While I was fixing that, noticed two other issues in the OFI code that I cleaned up. First, we should use the state of FI_MR_HMEM instead of a provider name for avoiding creating HMEM MRs in the OFI MTL. Second, in the case that the OFI BTL is used without the OFI MTL, we were not properly coupling the OMPI memory monitor with the Libfabric memory monitor.