Skip to content

UCX: provide an option to enable/disable UCX rcache#1762

Open
ZhenlongMa wants to merge 1 commit into
ai-dynamo:mainfrom
ZhenlongMa:topic/disable-memory-hook
Open

UCX: provide an option to enable/disable UCX rcache#1762
ZhenlongMa wants to merge 1 commit into
ai-dynamo:mainfrom
ZhenlongMa:topic/disable-memory-hook

Conversation

@ZhenlongMa

@ZhenlongMa ZhenlongMa commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What?

Disable UCX registration caches by default in the UCX backend.

Why?

NIXL always passes the local memory handle (memh) explicitly to UCX operations, so UCX does not need to rely on memory hooks for this path.

Installing memory hooks is intrusive and can lead to correctness or stability issues, especially for dynamic memory workloads. Disabling rcache by default avoids installing those hooks while preserving the existing explicit memory registration flow.

How?

This PR adds a build-time enable_rcache Meson option. When it is not set, NIXL configures UCX with:

  • RCACHE_ENABLE=n
  • GDR_COPY_RCACHE=n
  • ROCM_COPY_RCACHE=n

so that all kinds of rcache are disabled.

Summary by CodeRabbit

  • Chores
    • Added build configuration option to control UCX registration caching behavior. Users building from source can now enable or disable this feature during compilation (default: disabled).

@ZhenlongMa ZhenlongMa requested review from a team, brminich, gleon99 and yosefe as code owners June 11, 2026 13:47
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

👋 Hi ZhenlongMa! Thank you for contributing to ai-dynamo/nixl.

Your PR reviewers will review your contribution then trigger the CI to test your changes.

🚀

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 9e16a275-49be-44b5-a8ed-c4cdea64f094

📥 Commits

Reviewing files that changed from the base of the PR and between 49feac6 and a509b23.

📒 Files selected for processing (3)
  • meson.build
  • meson_options.txt
  • src/plugins/ucx/ucx_utils.cpp

📝 Walkthrough

Walkthrough

The PR adds a build-time configuration option to selectively enable or disable UCX registration caching. A new enable_rcache Meson option defaults to false; when enabled, it injects a preprocessor define that conditionally gates rcache-related configuration in the UCX context initialization.

Changes

UCX Registration Cache Feature Gating

Layer / File(s) Summary
Build option and preprocessor integration
meson_options.txt, meson.build
New boolean enable_rcache option added with default false; when enabled, generates -DNIXL_UCX_ENABLE_RCACHE preprocessor define for C/C++ compilation.
UCX rcache configuration gating
src/plugins/ucx/ucx_utils.cpp
UCX rcache overrides (RCACHE_ENABLE, GDR_COPY_RCACHE, ROCM_COPY_RCACHE) are conditionally applied only when the preprocessor define is not defined.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

external-contribution, size/XS

Suggested reviewers

  • yosefe
  • brminich
  • gleon99

Poem

🐰 A cache for UCX, now gated with care,
Build options define what's compiled where,
Preprocessor guards keep features aligned,
Registration caching, thoughtfully designed! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'UCX: provide an option to enable/disable UCX rcache' accurately summarizes the main change: adding a build-time option to control UCX rcache behavior.
Description check ✅ Passed The description includes all required template sections (What, Why, How) with comprehensive details about the rationale, implementation approach, and configuration options.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@ZhenlongMa

ZhenlongMa commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi reviewers,
This PR has been waiting for review for about two weeks. Just wanted to check if there is any additional work or changes needed from my side.
Thanks.

@iyastreb

Copy link
Copy Markdown
Contributor

LGTM
Disabling GDR/rocm rcache may change registration cost, but I think it's not too risky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants