Skip to content

Pass on nthreads to xgboost functions in scDblFinder#140

Merged
plger merged 1 commit into
plger:develfrom
csoneson:set-nthreads
May 20, 2026
Merged

Pass on nthreads to xgboost functions in scDblFinder#140
plger merged 1 commit into
plger:develfrom
csoneson:set-nthreads

Conversation

@csoneson
Copy link
Copy Markdown
Contributor

We recently had some cases where scDblFinder() would grab all the cores on the machine, and run very slowly. Passing the nthreads parameter to the xgboost functions (which I believe would otherwise resort to parallel::detectCores()) seems to improve the situation and it finishes quickly (although as far as I can see it still uses a bit more CPU than specified via BPPARAM). The code below was enough to trigger the issue (both with versions 1.24.10 and 1.25.4):

library(scDblFinder)
library(SingleCellExperiment)
sce <- mockDoubletSCE(ncells = c(2000, 3000, 5000), ngenes = 10000)
sce <- scDblFinder(sce, BPPARAM=BiocParallel::SerialParam())

Is this something that you have also run into?

cc @mbstadler

@plger
Copy link
Copy Markdown
Owner

plger commented May 20, 2026

Hi,
Thanks for raising the issue... no I hadn't seen this, can I ask whether it's on mac/win/linux, and what version of xgboost you're running?

@plger
Copy link
Copy Markdown
Owner

plger commented May 20, 2026

Looks like this also changed with xgboost>3, and might even depend on how the package was compiled... but as I see no downside to your edits will just merge, so you can forget my question...

@plger plger merged commit 001e120 into plger:devel May 20, 2026
1 of 2 checks passed
@csoneson
Copy link
Copy Markdown
Contributor Author

I saw this on Linux, with xgboost version 3.2.1.1

@plger
Copy link
Copy Markdown
Owner

plger commented May 20, 2026

if things look okay on the devel builds I'll port to release after

@csoneson
Copy link
Copy Markdown
Contributor Author

Thank you!

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.

2 participants