Skip to content

fix: build against rmm 26.10 (use rmm's device_uvector declaration)#1606

Open
maxwbuckley wants to merge 1 commit into
NVIDIA:mainfrom
maxwbuckley:fix/rmm-abi-namespace-fwd-decl
Open

fix: build against rmm 26.10 (use rmm's device_uvector declaration)#1606
maxwbuckley wants to merge 1 commit into
NVIDIA:mainfrom
maxwbuckley:fix/rmm-abi-namespace-fwd-decl

Conversation

@maxwbuckley

Copy link
Copy Markdown

Description

Building libcuopt from source against rmm 26.10 fails to compile because cpp/src/pdlp/utilities/problem_checking.cuh hand-rolls a forward declaration of rmm::device_uvector in the plain rmm namespace:

namespace rmm {
template <typename T>
class device_uvector;
}  // namespace rmm

rmm 26.10 places device_uvector in an ABI inline namespace (rmm::RMM_ABI_NAMESPACE, see rmm/detail/export.hpp), so this hand-rolled declaration creates a second, distinct rmm::device_uvector. Every use then becomes ambiguous:

cpp/src/pdlp/utilities/problem_checking.cuh(36): error: "rmm::device_uvector" is ambiguous
cpp/src/utilities/copy_helpers.hpp(82): error: "rmm::device_uvector" is ambiguous

with cascading namespace "cuopt::raft" has no member "add_op" and thrust "this pragma must immediately precede a declaration" errors in the same translation units.

This is the only manual rmm forward declaration in the tree. cuOpt already opts out of thrust's and cub's ABI namespaces (-DTHRUST_DISABLE_ABI_NAMESPACE / -DCUB_DISABLE_NAMESPACE_MAGIC); rmm's ABI inline namespace is newer and has no such opt-out, so the plain forward declaration no longer matches rmm's real declaration.

Change

Replace the hand-rolled forward declaration with #include <rmm/device_uvector.hpp>, so rmm's own (correctly ABI-namespaced) declaration is used.

Testing

Built libcuopt (LP + MIP) from source against rmm/raft 26.10 + CCCL 3.4.0 (CUDA 13.3, GCC 14, sm_120a):

  • Before: the device_uvector is ambiguous errors above.
  • After: clean compile + link. solve_LP returns correct optima — afiro-464.7531 (known optimum), and a set of small LPs match HiGHS to ≤ 1e-6 relative error — and the MIP path runs.

Fixes #1605.

@maxwbuckley
maxwbuckley requested a review from a team as a code owner July 23, 2026 09:09
@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 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.

…orward decl

As of rmm 26.10, rmm::device_uvector is defined inside the ABI inline namespace
rmm::RMM_ABI_NAMESPACE (rmm/detail/export.hpp). cuOpt's manual
  namespace rmm { template <typename T> class device_uvector; }
forward declaration in problem_checking.cuh injects a *second*, distinct
rmm::device_uvector into the plain rmm namespace, so every use becomes ambiguous
('rmm::device_uvector is ambiguous'), which fails the build against rmm 26.10.

Replace the hand-rolled forward declaration with #include <rmm/device_uvector.hpp>
so the correctly ABI-namespaced declaration is used. (cuOpt already disables the
analogous thrust/cub ABI namespaces via -DTHRUST_DISABLE_ABI_NAMESPACE /
-DCUB_DISABLE_NAMESPACE_MAGIC; rmm's ABI namespace is newer and has no such opt-out.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Max Buckley <maxwbuckley@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 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: CHILL

Plan: Enterprise

Run ID: 60622ac7-f581-4340-8601-7e905461832b

📥 Commits

Reviewing files that changed from the base of the PR and between d47fcd6 and 2ca07f2.

📒 Files selected for processing (1)
  • cpp/src/pdlp/utilities/problem_checking.cuh
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/src/pdlp/utilities/problem_checking.cuh

📝 Walkthrough

Walkthrough

The problem-checking header now includes RMM’s official device_uvector declaration instead of defining a manual forward declaration.

Changes

RMM declaration alignment

Layer / File(s) Summary
Use the official RMM header
cpp/src/pdlp/utilities/problem_checking.cuh
Replaces the hand-rolled rmm::device_uvector forward declaration with rmm/device_uvector.hpp.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: mlubin, yuwenchen95

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main fix: using rmm's device_uvector declaration for rmm 26.10.
Description check ✅ Passed The description directly matches the code change and the reported build failure against rmm 26.10.
Linked Issues check ✅ Passed The change satisfies #1605 by replacing the manual forward declaration with the official rmm header.
Out of Scope Changes check ✅ Passed The PR is narrowly scoped to the rmm device_uvector declaration fix and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@maxwbuckley
maxwbuckley force-pushed the fix/rmm-abi-namespace-fwd-decl branch from d47fcd6 to 2ca07f2 Compare July 23, 2026 09:12
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.

[BUG] Source build fails against rmm 26.10: hand-rolled rmm::device_uvector forward declaration is ambiguous

1 participant