-
Notifications
You must be signed in to change notification settings - Fork 222
Use daal::static_threader_reduce in Linear Regression and dispatch grainSize hyperparameter #3217
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
base: main
Are you sure you want to change the base?
Use daal::static_threader_reduce in Linear Regression and dispatch grainSize hyperparameter #3217
Conversation
/intelci: run |
The failing sklearnex test is due to small numerical differences, guess it's safe to just change the thresholds there. But the test itself is not well designed: better would be to compare against a reference implementation like SciPy's, the same way it's done in other tests within sklearnex. |
@@ -58,6 +58,7 @@ class lr_train_params_test : public lr_test<TestType, lr_train_params_test<TestT | |||
this->max_cols_batched_ = GENERATE(50); | |||
this->small_rows_threshold_ = GENERATE(15, 70); | |||
this->small_rows_max_cols_batched_ = GENERATE(40); | |||
this->grain_size_ = GENERATE(1, 10); |
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.
Please add a test also for single-threaded mode, since it has if-else conditions for it.
enum ErrorCode | ||
{ | ||
ok = 0, /// No error | ||
memAllocationFailed = 1, /// Memory allocation failed | ||
intOverflow = 2, /// Integer overflow | ||
badCast = 3 /// Cannot cast base daal::Reducer to derived class | ||
}; | ||
/// Status of the computation. | ||
ErrorCode errorCode; |
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.
Please remove those implementation details from the Reducer
class.
Because:
Reducer
is an interface class and should not contain any implementation specifics.- It was my mistake when I defined those error codes in Covariance. It would be better to use the values defined here instead https://github.com/uxlfoundation/oneDAL/blob/main/cpp/daal/include/services/error_indexes.h#L71. It is also possible to extend this enum if needed.
Description
Use daal::static_threader_reduce in Linear Regression algorithm to compute X^tX and X^tY matrices the same way it was done for Covariance algorithm (#3126).
Also add grainSize hyperparameter that controls the minimum number of blocks allocated to a single thread to the list of dispatched Linear Regression hyperparameters.
Checklist to comply with before moving PR from draft:
PR completeness and readability
Testing
Performance