Repository navigation
UCS/RCACHE: Default merging rcache regions to on - #12267
william-gallagher-nv merged 3 commits into
Conversation
|
🤖 Starting review — findings will be posted here when done. |
|
🤖 CI Triage Agent — TL;DR: The job never built anything — it died in the Azure Pipelines "Initialize containers" step because Full analysisSummary: Build Root cause: Infrastructure/Docker-state inconsistency on the build agent. The log shows Implicated commit: unknown — not a code regression; commit 31921df / PR #12267 code was never compiled or executed in this build. File: unknown (failure is in the Azure agent container-initialization step, before any repo file is used; pipeline definition: Suggested fix: Re-run the failed job — this class of failure is transient. If it recurs on Related: #12094 (CI: Jenkins integration testing) — only loosely related CI infrastructure work; no existing issue tracks this specific Docker |
31921df to
15ae738
Compare
|
🤖 Starting review — findings will be posted here when done. |
Switches UCX_RCACHE_MERGE_ADJACENT default from 'n' to 'y'. Regions of memory that are adjacent in memory will be merged into a single region when possible.
15ae738 to
46561ab
Compare
|
🤖 Starting review — findings will be posted here when done. |
| size_t size, | ||
| ucs_memory_type_t mem_type) | ||
| { | ||
| mapped_buffer target = mapped_buffer(size, receiver(), 0, |
There was a problem hiding this comment.
minor: direct initialization is enough here, no need for the temporary copy.
| mapped_buffer target = mapped_buffer(size, receiver(), 0, | |
| mapped_buffer target(size, receiver(), 0, UCS_MEMORY_TYPE_HOST); |
| ucp_context_h context = sender().ucph(); | ||
| ucs_rcache_t *rcache = context->rcache; | ||
| ucp_mem_map_params_t params; | ||
| const size_t size = ucs_get_page_size(); |
There was a problem hiding this comment.
minor: this block duplicates the allocate + register-first-half setup of test_adjacent_registration; maybe extract a small helper for it?
|
Residual coverage note: |
|
@nbellalou please review |
|
@nbellalou Can you take a look when you get a chance? |
|
🤖 Starting review — findings will be posted here when done. |
| ucs_offsetof(ucs_rcache_config_t, purge_on_fork), UCS_CONFIG_TYPE_BOOL}, | ||
|
|
||
| {"RCACHE_MERGE_ADJACENT", "n", "Merge adjacent registration cache regions", | ||
| {"RCACHE_MERGE_ADJACENT", "y", "Merge adjacent registration cache regions", |
There was a problem hiding this comment.
ucp_mem_rcache_can_merge_cb() short-circuits to 1 for host memory, without the same-allocation check used for GPU memory (alloc_base/alloc_len). With the default flipped, two unrelated host allocations that happen to be adjacent will be de-registered and re-registered as one region, and later freeing one of them invalidates the registration of the other.
Was this measured on host registration-heavy workloads? Should host merging also be limited to the same allocation, like GPU memory?
|
🤖 CI Triage Agent — TL;DR: The ASAN/BlueField gtest job failed on a LeakSanitizer report ( Full analysisSummary: Root cause: All 17 leaked allocations have allocation stacks that bottom out in the test's setup path (
In other words a UCT ep/iface pair from the pre-speed-change configuration is dropped without being discarded ( Implicated commit: Most likely File: Suggested fix:
Related: PR #12267 (the PR under test), PR #12362 / #12334 / #12360 (recent commits touching the failing test and EP reconfiguration), PR #11901 "TEST/UCP: Make |
There was a problem hiding this comment.
@william-gallagher-nv why changing the default behavior now ? Did you run perf tests demonstrating that auto merging is a good trade-off in the general case ?
@nbellalou, after discussion with @gleon99 we decided to change the default behavior to be "opt out". This provides a better user experience by allowing applications with large numbers of memory registrations to work without extra configuration. The cost of merging is one time cost and is amortized over the life of the registration. I did some testing with OSU
Merging adjacent regions is slightly faster than not merging for the smaller scale OSU |
|
@gleon99 Can you take a look and give maintainer approval? |
What?
Change default to enable merging adjacent rcache regions. Opt out available by setting
UCX_RCACHE_MERGE_ADJACENT=n. Testing is added to ensure that merging of adjacent regions does not occur when disabled.Why?
The ability merge adjacent rcache regions was added in #11958. The
UCX_RCACHE_MERGE_ADJACENTenvironmental variable was added with the original PR. This PR toggles the default to merging adjacent regions. Defaulting to enabling the merging of adjacent regions provides a better user experience for applications that register large numbers of memory regions.