Skip to content

Commit af693a9

Browse files
bdicehcho3
andauthored
Add RMM patch to update include paths and allocation interface (#110)
* Add RMM patch to update include paths and allocation interface * Bump build number * Rerun CI * Turn off R package build --------- Co-authored-by: Hyunsu Cho <[email protected]>
1 parent 9375771 commit af693a9

File tree

2 files changed

+138
-62
lines changed

2 files changed

+138
-62
lines changed

recipe/meta.yaml

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set version = "3.0.5" %}
2-
{% set build_number = 4 %}
2+
{% set build_number = 5 %}
33
{% set python_min = "3.10" %}
44
{% set posix = 'm2-' if win else '' %}
55

@@ -19,6 +19,7 @@ source:
1919
- patches/0003-Mark-wheels-as-any-platform-compatible.patch
2020
- patches/0004-Disable-glibc-version-check.patch
2121
- patches/0005-Patch-CMake-config-to-support-CUDA-13.0.patch
22+
- patches/0006-Update-RMM-include-paths-and-allocation-interface.patch # [linux and cuda_compiler_version != "None"]
2223

2324
build:
2425
number: {{ build_number }}
@@ -166,67 +167,67 @@ outputs:
166167
imports:
167168
- xgboost
168169

169-
- name: r-xgboost
170-
script: >-
171-
{{ "install-r-xgboost.sh" if not win else "install-win-wrapper.bat" }}
172-
build:
173-
skip: true # [r_base in ("4.1", "4.2")]
174-
string: {{ string_prefix }}_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
175-
rpaths:
176-
- lib/R/lib
177-
force_use_keys:
178-
- librmm # [linux and cuda_compiler != "None"]
179-
missing_dso_whitelist:
180-
# Conda-build raises the missing `ld64.so.2` linkage erroneously.
181-
# xref: https://github.com/conda/conda-build/issues/5403
182-
- $RPATH/ld64.so.2 # [ppc64le]
183-
requirements:
184-
build:
185-
- {{ compiler('c') }} # [unix]
186-
- {{ compiler('cxx') }} # [unix]
187-
- {{ compiler('m2w64_c') }} # [win]
188-
- {{ compiler('m2w64_cxx') }} # [win]
189-
- {{ stdlib('c') }} # [unix]
190-
- {{ stdlib('m2w64_c') }} # [win]
191-
- llvm-openmp # [osx]
192-
- libgomp # [linux or win]
193-
- {{ posix }}bash # [win]
194-
- {{ posix }}make
195-
- cross-r-base {{ r_base }} # [build_platform != target_platform]
196-
- r-base # [build_platform != target_platform]
197-
- r-matrix # [build_platform != target_platform]
198-
- r-data.table # [build_platform != target_platform]
199-
- r-magrittr # [build_platform != target_platform]
200-
- r-jsonlite # [build_platform != target_platform]
201-
- r-knitr # [build_platform != target_platform]
202-
host:
203-
- {{ pin_subpackage('libxgboost', max_pin='x.x.x') }}
204-
- libgomp # [win]
205-
- libxgboost =*={{ string_prefix }}_h*_{{ PKG_BUILDNUM }}
206-
- r-base
207-
- r-matrix
208-
- r-data.table
209-
- r-magrittr
210-
- r-jsonlite
211-
- r-knitr
212-
run:
213-
- {{ pin_subpackage('libxgboost', max_pin='x.x.x') }}
214-
- libgomp # [win]
215-
- libxgboost =*={{ string_prefix }}_h*_{{ PKG_BUILDNUM }}
216-
- r-base
217-
- r-matrix
218-
- r-data.table
219-
- r-magrittr
220-
- r-jsonlite
221-
test:
222-
requires:
223-
- r-base
224-
files:
225-
- test-r-xgboost.r
226-
commands:
227-
- $R -e "library('xgboost')" # [unix]
228-
- "\"%R%\" -e \"library('xgboost')\"" # [win]
229-
- Rscript test-r-xgboost.r # [unix]
170+
#- name: r-xgboost
171+
# script: >-
172+
# {{ "install-r-xgboost.sh" if not win else "install-win-wrapper.bat" }}
173+
# build:
174+
# skip: true # [r_base in ("4.1", "4.2")]
175+
# string: {{ string_prefix }}_r{{ r_base | replace('.', '') }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
176+
# rpaths:
177+
# - lib/R/lib
178+
# force_use_keys:
179+
# - librmm # [linux and cuda_compiler != "None"]
180+
# missing_dso_whitelist:
181+
# # Conda-build raises the missing `ld64.so.2` linkage erroneously.
182+
# # xref: https://github.com/conda/conda-build/issues/5403
183+
# - $RPATH/ld64.so.2 # [ppc64le]
184+
# requirements:
185+
# build:
186+
# - {{ compiler('c') }} # [unix]
187+
# - {{ compiler('cxx') }} # [unix]
188+
# - {{ compiler('m2w64_c') }} # [win]
189+
# - {{ compiler('m2w64_cxx') }} # [win]
190+
# - {{ stdlib('c') }} # [unix]
191+
# - {{ stdlib('m2w64_c') }} # [win]
192+
# - llvm-openmp # [osx]
193+
# - libgomp # [linux or win]
194+
# - {{ posix }}bash # [win]
195+
# - {{ posix }}make
196+
# - cross-r-base {{ r_base }} # [build_platform != target_platform]
197+
# - r-base # [build_platform != target_platform]
198+
# - r-matrix # [build_platform != target_platform]
199+
# - r-data.table # [build_platform != target_platform]
200+
# - r-magrittr # [build_platform != target_platform]
201+
# - r-jsonlite # [build_platform != target_platform]
202+
# - r-knitr # [build_platform != target_platform]
203+
# host:
204+
# - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }}
205+
# - libgomp # [win]
206+
# - libxgboost =*={{ string_prefix }}_h*_{{ PKG_BUILDNUM }}
207+
# - r-base
208+
# - r-matrix
209+
# - r-data.table
210+
# - r-magrittr
211+
# - r-jsonlite
212+
# - r-knitr
213+
# run:
214+
# - {{ pin_subpackage('libxgboost', max_pin='x.x.x') }}
215+
# - libgomp # [win]
216+
# - libxgboost =*={{ string_prefix }}_h*_{{ PKG_BUILDNUM }}
217+
# - r-base
218+
# - r-matrix
219+
# - r-data.table
220+
# - r-magrittr
221+
# - r-jsonlite
222+
# test:
223+
# requires:
224+
# - r-base
225+
# files:
226+
# - test-r-xgboost.r
227+
# commands:
228+
# - $R -e "library('xgboost')" # [unix]
229+
# - "\"%R%\" -e \"library('xgboost')\"" # [win]
230+
# - Rscript test-r-xgboost.r # [unix]
230231

231232
about:
232233
home: https://github.com/dmlc/xgboost
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Bradley Dice <[email protected]>
3+
Date: Thu, 21 Nov 2025 00:00:00 +0000
4+
Subject: [PATCH] Update RMM include paths and allocation interface
5+
6+
RMM 25.12 reorganizes the mr/ directory by removing the device/ subdirectory
7+
and changes allocate/deallocate method signatures to be stream-ordered.
8+
9+
RMM allocation APIs are changing to align with the new CCCL memory resource
10+
interface. This updates include paths from rmm/mr/device/*.hpp to rmm/mr/*.hpp
11+
and updates allocate/deallocate calls to use the new parameter order.
12+
13+
Ref: https://github.com/rapidsai/rmm/issues/2141
14+
Ref: https://github.com/rapidsai/rmm/issues/2126
15+
---
16+
src/common/device_vector.cuh | 10 +++++-----
17+
tests/cpp/helpers.cc | 6 +++---
18+
2 files changed, 8 insertions(+), 8 deletions(-)
19+
20+
diff --git a/src/common/device_vector.cuh b/src/common/device_vector.cuh
21+
index 352ebf371..453addffb 100644
22+
--- a/src/common/device_vector.cuh
23+
+++ b/src/common/device_vector.cuh
24+
@@ -9,9 +9,9 @@
25+
#if defined(XGBOOST_USE_RMM) && XGBOOST_USE_RMM == 1
26+
#include <rmm/device_uvector.hpp> // for device_uvector
27+
#include <rmm/exec_policy.hpp> // for exec_policy_nosync
28+
-#include <rmm/mr/device/device_memory_resource.hpp> // for device_memory_resource
29+
-#include <rmm/mr/device/per_device_resource.hpp> // for get_current_device_resource
30+
-#include <rmm/mr/device/thrust_allocator_adaptor.hpp> // for thrust_allocator
31+
+#include <rmm/mr/device_memory_resource.hpp> // for device_memory_resource
32+
+#include <rmm/mr/per_device_resource.hpp> // for get_current_device_resource
33+
+#include <rmm/mr/thrust_allocator_adaptor.hpp> // for thrust_allocator
34+
#include <rmm/version_config.hpp> // for RMM_VERSION_MAJOR
35+
36+
#include "xgboost/global_config.h" // for GlobalConfigThreadLocalStore
37+
@@ -410,7 +410,7 @@ class LoggingResource : public rmm::mr::device_memory_resource {
38+
39+
void *do_allocate(std::size_t bytes, rmm::cuda_stream_view stream) override { // NOLINT
40+
try {
41+
- auto const ptr = mr_->allocate(bytes, stream);
42+
+ auto const ptr = mr_->allocate(stream, bytes);
43+
GlobalMemoryLogger().RegisterAllocation(bytes);
44+
return ptr;
45+
} catch (rmm::bad_alloc const &e) {
46+
@@ -420,8 +420,8 @@ class LoggingResource : public rmm::mr::device_memory_resource {
47+
}
48+
49+
void do_deallocate(void *ptr, std::size_t bytes, // NOLINT
50+
- rmm::cuda_stream_view stream) override {
51+
- mr_->deallocate(ptr, bytes, stream);
52+
+ rmm::cuda_stream_view stream) noexcept override {
53+
+ mr_->deallocate(stream, ptr, bytes);
54+
GlobalMemoryLogger().RegisterDeallocation(bytes);
55+
}
56+
57+
diff --git a/tests/cpp/helpers.cc b/tests/cpp/helpers.cc
58+
index 7e2e79ba5..d71a353aa 100644
59+
--- a/tests/cpp/helpers.cc
60+
+++ b/tests/cpp/helpers.cc
61+
@@ -26,9 +26,9 @@
62+
#if defined(XGBOOST_USE_RMM) && XGBOOST_USE_RMM == 1
63+
#include <memory>
64+
#include <vector>
65+
-#include "rmm/mr/device/per_device_resource.hpp"
66+
-#include "rmm/mr/device/cuda_memory_resource.hpp"
67+
-#include "rmm/mr/device/pool_memory_resource.hpp"
68+
+#include "rmm/mr/per_device_resource.hpp"
69+
+#include "rmm/mr/cuda_memory_resource.hpp"
70+
+#include "rmm/mr/pool_memory_resource.hpp"
71+
#endif // defined(XGBOOST_USE_RMM) && XGBOOST_USE_RMM == 1
72+
73+
bool FileExists(const std::string& filename) {
74+
--
75+
2.47.0

0 commit comments

Comments
 (0)