Skip to content

UCT/IB: Support relaxed-only memory keys - #11649

Merged
roiedanino merged 19 commits into
openucx:masterfrom
roiedanino:cx10-ordering-capabilities
Aug 2, 2026
Merged

UCT/IB: Support relaxed-only memory keys#11649
roiedanino merged 19 commits into
openucx:masterfrom
roiedanino:cx10-ordering-capabilities

Conversation

@roiedanino

@roiedanino roiedanino commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What?

Add support for devices that require relaxed-only memory keys.

  • Discover the relevant device ordering capabilities.
  • Keep the existing yes, no, try, and auto values for UCX_IB_PCI_RELAXED_ORDERING.
  • Make explicit yes require relaxed ordering, omit strict-order companion keys and rkeys, and return an error when relaxed ordering is unavailable.
  • Preserve try as the best-effort mode that retains strict-order companion keys when available.
  • Keep auto as the default and honor a firmware relaxed-only requirement before considering CPU preference.
  • Reject no when the device requires relaxed-only operation.

Why?

Some devices do not support strong-order memory keys. Creating a strict-order companion key on those devices would fail memory registration and prevent UCX from operating.

UCX must recognize this requirement, avoid creating incompatible keys, and reject configuration choices that cannot be satisfied.

How?

Track whether relaxed ordering is enabled and whether it is mandatory as separate memory-domain states.

When relaxed ordering is mandatory, apply relaxed ordering to required registrations, use the default key for atomic operations, omit strict-order companion keys and exported rkeys, and gate paths that depend on strict-order keys. When it is optional, preserve the existing dual-key behavior.

@roiedanino
roiedanino force-pushed the cx10-ordering-capabilities branch from b9d83f5 to 6fcde5e Compare July 12, 2026 13:28
@roiedanino

Copy link
Copy Markdown
Contributor Author

@svc-nvidia-pr-review

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread src/uct/ib/base/ib_md.c
Comment thread src/uct/ib/base/ib_md.c Outdated
Comment thread src/uct/ib/mlx5/gga/gga_mlx5.c Outdated
Comment thread test/gtest/uct/ib/test_ib_md.cc
@roiedanino roiedanino self-assigned this Jul 12, 2026
@roiedanino
roiedanino requested a review from tvegas1 July 13, 2026 07:06
@roiedanino
roiedanino marked this pull request as ready for review July 13, 2026 07:06
@roiedanino
roiedanino requested review from evgeny-leksikov and iyastreb and removed request for tvegas1 July 13, 2026 07:08
Comment thread src/uct/ib/base/ib_md.c Outdated
@roiedanino
roiedanino force-pushed the cx10-ordering-capabilities branch from 6aa0a43 to a5fb08f Compare July 15, 2026 16:58
@roiedanino roiedanino changed the title UCT/IB: Support relaxed-only memory keys feat(ib): make UCX_IB_PCI_RELAXED_ORDERING=yes enforce mandatory relaxed ordering Jul 15, 2026
@roiedanino roiedanino changed the title feat(ib): make UCX_IB_PCI_RELAXED_ORDERING=yes enforce mandatory relaxed ordering UCT/IB: Support relaxed-only memory keys Jul 15, 2026
Signed-off-by: Roie Danino <rdanino@nvidia.com>
@roiedanino
roiedanino force-pushed the cx10-ordering-capabilities branch from a5fb08f to e40d287 Compare July 15, 2026 17:04
Comment thread src/uct/ib/base/ib_md.c Outdated
uct_ib_device_name(&md->dev),
is_required ? "firmware" :
"IB_PCI_RELAXED_ORDERING=yes");
return is_required ? UCS_ERR_IO_ERROR : UCS_ERR_UNSUPPORTED;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why IO_ERROR? IMO this branch always should return UNSUPPORTED

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be UCS_ERR_UNSUPPORTED, because it would mean UCX will try to fall back to mlx5 dv / ibv instead of failing as expected (mlx5dv / ibv won't be able to query fw for that limitation)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but dv / ibv also !have_relaxed_order -> UCS_ERR_UNSUPPORTED, fallback fails too, UCP fails
do I miss anything?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not when the requirement comes from firmware, when the env is set to auto, it's only being handled in devx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, the error goes from FW due to incompatible parameter set by user (IB_PCI_RELAXED_ORDERING=yes), right? can we move this check to IB_PCI_RELAXED_ORDERING=yes since it's unsupported by FW

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_required means FW supports only relaxed-order MKEYs. If false, relaxed ordering is not mandatory, support is determined separately by is_supported

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it mean that we do not support IB_PCI_RELAXED_ORDERING=yes if is_required (FW supports only relaxed-order MKEYs)? if so, then need to move this FW requirement check to the place where we parse IB_PCI_RELAXED_ORDERING

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't mean that, the error occurs only when relaxed-only mode is required but IBV_ACCESS_RELAXED_ORDERING is unavailable (contradiction).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah.. ok, could you pls simplify ucs_error(...)? maybe break on 2 message under different conditions.

Comment thread src/uct/ib/base/ib_md.h
Comment thread src/uct/ib/mlx5/dv/ib_mlx5dv_md.c Outdated
Comment thread src/uct/ib/mlx5/dv/ib_mlx5dv_md.c Outdated
Comment thread src/uct/ib/mlx5/dv/ib_mlx5dv_md.c Outdated
Signed-off-by: Roie Danino <rdanino@nvidia.com>
Signed-off-by: Roie Danino <rdanino@nvidia.com>
Comment thread src/uct/ib/mlx5/dv/ib_mlx5dv_md.c Outdated
cmd_hca_cap, cap, mkc_order_write_after_write_ro_only);
ucs_debug("%s: mkey ordering: read-after-write=%d relaxed-only=%d",
uct_ib_device_name(dev),
UCT_IB_MLX5DV_GET(cmd_hca_cap, cap,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if that's leftovers

Signed-off-by: Roie Danino <rdanino@nvidia.com>
@roiedanino
roiedanino requested a review from gleon99 July 30, 2026 08:32
@roiedanino

Copy link
Copy Markdown
Contributor Author

@evgeny-leksikov @gleon99 Is this one good to go?

@roiedanino
roiedanino merged commit a956862 into openucx:master Aug 2, 2026
161 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants