-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[R] Fix nthread in DMatrix constructor. #7127
Conversation
Is it possible to make |
That's either a new API or a breaking change. |
@trivialfis I don't think changing the signature for |
I was told that the C function in R is also considered as part of the interface when working on #6819 . That's why the old predict C function for R is still here. |
Codecov Report
@@ Coverage Diff @@
## master #7127 +/- ##
==========================================
- Coverage 82.71% 82.19% -0.52%
==========================================
Files 13 13
Lines 3963 3999 +36
==========================================
+ Hits 3278 3287 +9
- Misses 685 712 +27
Continue to review full report at Codecov.
|
@@ -103,7 +103,7 @@ XGB_DLL SEXP XGDMatrixCreateFromMat_R(SEXP mat, SEXP missing) { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The for loop in lines 96-102 is still using multiple threads. We must revise the loop also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually using the default.
XGDMatrixCreateFromMat_omp_R, that takes in the extra parameter nthread
Maybe a new JSON based API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The default" is set by OMP_NUM_THREADS
, not nthread
.
Also, let's create a new API function, |
Let's just change the signature for |
Close #7098 .
Restricting the construction of DMatrix to be single threaded.