-
Notifications
You must be signed in to change notification settings - Fork 214
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
make tbb threads configurable #185
Conversation
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.
address comments please
make test |
Precommit failures associated with problems on host and not changes in this PR |
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.
all Ok. the number of tbb threads is configurable and can be set automatically.
What are reasons to read the environment variable in the library instead of an application? Do you need something additionally in the DAAL to assign the number of threads via Java API? |
cause the number of cores for each task is configurable in Spark. We want the TBB threads to be changed accordingly when cores per task changed. Thus we read it from the configurable env variable. A new Java API is an alternative. The similar logic for configurable TBB threads is still needed. |
I'm OK with changing of the number of cores/threads, but doing it via environment variable introduces latent behavior for every user of the library. What do you need additionally in the Environment class to perform that you want? |
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.
I'm OK with changing of the number of cores/threads, but doing it via environment variable introduces latent behavior for every user of the library
Guys, I went through some related code and found it's not an easy task for me to add APIs for all algorithms. Task KMeans as example. The entry point is SampleKMeans.scala. In this class, we need to make changes as below, And for other algorithms, we need all these steps too. So please suggest. |
Looks like you don't need to do item 2. All you need is to set the number of threads for Environment class. See this Java example for that please. |
Hello @zjf2012
|
Do the approach with setting of the number of threads via Environment class (how it done in the Java example I mentioned) works for you? |
No activity from contributor - I suggest to close PR in week. |
Description
make TBB threads configurable so that other resource managers or frameworks, like Spark, can manage resource when use DAAL. What we did is DAAL on Spark. The typical way to run workload on Spark is,
As you can see, it’s the reason why we make TBB threads configurable.
Changes proposed in this pull request:
java -Dtbb-threads=10 ...