srowen commented on code in PR #49986:
URL: https://github.com/apache/spark/pull/49986#discussion_r1958955170


##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -3436,6 +3437,20 @@ object SparkContext extends Logging {
     supplement(DRIVER_JAVA_OPTIONS)
     supplement(EXECUTOR_JAVA_OPTIONS)
   }
+
+  private def supplementBlasOptions(conf: SparkConf): Unit = {
+    conf.getOption("spark.ml.allowNativeBlas").foreach { allowNativeBlas =>
+      def supplement(key: OptionalConfigEntry[String]): Unit = {

Review Comment:
   This is repeated so many times now - I wonder if a simple refactor is in 
order to have one 'supplement' function?



##########
mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala:
##########
@@ -39,8 +39,11 @@ private[spark] object BLAS extends Serializable {
   // For level-3 routines, we use the native BLAS.
   private[spark] def nativeBLAS: NetlibBLAS = {
     if (_nativeBLAS == null) {
-      _nativeBLAS =
-        try { NetlibNativeBLAS.getInstance } catch { case _: Throwable => 
javaBLAS }
+      _nativeBLAS = System.getProperty("spark.ml.allowNativeBlas", "true") 
match {

Review Comment:
   This has to be a sys property because of how early it has to be initialized?



##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala:
##########
@@ -1049,6 +1049,10 @@ private[spark] class Client(
 
     javaOpts += s"-Djava.net.preferIPv6Addresses=${Utils.preferIPv6}"
 
+    sparkConf.getOption("spark.ml.allowNativeBlas").foreach { allowNativeBlas 
=>
+      javaOpts += s"-Dspark.ml.allowNativeBlas=$allowNativeBlas"

Review Comment:
   Do other resource managers like k8s need this? not sure



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to