Skip to content

Commit 3a58704

Browse files
committed
fix.
1 parent efd2411 commit 3a58704

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

demo/guide-python/distributed_extmem_basic.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ def initializer(device: str) -> None:
185185
lop, sidx = mp.current_process().name.split("-")
186186
idx = int(sidx) # 1-based indexing from loky
187187
os.environ["CUDA_VISIBLE_DEVICES"] = str(idx - 1)
188+
# It's important to use RMM with `CudaAsyncMemoryResource`. for GPU-based
189+
# external memory to improve performance. If XGBoost is not built with RMM
190+
# support, a warning is raised when constructing the `DMatrix`.
188191
setup_rmm()
189192

190193
with get_reusable_executor(
@@ -207,10 +210,6 @@ def initializer(device: str) -> None:
207210
if args.device == "cuda":
208211
import cupy as cp
209212

210-
# It's important to use RMM with `CudaAsyncMemoryResource`. for GPU-based
211-
# external memory to improve performance. If XGBoost is not built with RMM
212-
# support, a warning is raised when constructing the `DMatrix`.
213-
setup_rmm()
214213
with tempfile.TemporaryDirectory() as tmpdir:
215214
main(tmpdir, args)
216215
else:

0 commit comments

Comments
 (0)