Skip to content

Commit

Permalink
add OpenBlas multi-threading introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
Peng Meng committed Jul 6, 2017
1 parent 7ef8b80 commit a4d4f50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conf/spark-env.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
# - SPARK_NICENESS The scheduling priority for daemons. (Default: 0)
# - SPARK_NO_DAEMONIZE Run the proposed command in the foreground. It will not output a PID file.
# Options for native BLAS, like Intel MKL, OpenBLAS, and so on.
# You shoud enable these options if use native BLAS (SPARK-21305).
# You shoud enable these options if using native BLAS (see SPARK-21305).
# - MKL_NUM_THREADS=1 Disable multi-threading of Intel MKL
# - OPENBLAS_NUM_THREADS=1 Disable multi-threading of OpenBLAS
6 changes: 4 additions & 2 deletions docs/ml-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ To configure `netlib-java` / Breeze to use system optimised binaries, include
project and read the [netlib-java](https://github.com/fommil/netlib-java) documentation for your
platform's additional installation instructions.

The most popular native BLAS such as [Intel MKL](https://software.intel.com/en-us/mkl), OpenBLAS, are based on multi-threading, which will conflict with Spark.
To use multi-threading based native BLAS, you must set it to use single thread first (SPARK-21305).
The most popular native BLAS such as [Intel MKL](https://software.intel.com/en-us/mkl), [OpenBLAS](http://www.openblas.net), are based on multi-threading.
For example, when OpenBLAS is loaded, it will create a thread pool with `MAX_CPU_NUMBER` threads, and the threads are using spinlock by default, which will conflict with Spark.

If using a native BLAS based on multi-threading, for the best performance you must set it to use single thread first ([SPARK-21305](https://issues.apache.org/jira/browse/SPARK-21305)).

To use MLlib in Python, you will need [NumPy](http://www.numpy.org) version 1.4 or newer.

Expand Down

0 comments on commit a4d4f50

Please sign in to comment.