luhenry commented on a change in pull request #30810:
URL: https://github.com/apache/spark/pull/30810#discussion_r547395790



##########
File path: mllib-local/src/main/scala/org/apache/spark/ml/linalg/BLAS.scala
##########
@@ -267,7 +282,7 @@ private[spark] object BLAS extends Serializable {
       x: DenseVector,
       beta: Double,
       y: DenseVector): Unit = {
-    f2jBLAS.dspmv("U", n, alpha, A.values, x.values, 1, beta, y.values, 1)
+    javaBLAS.dspmv("U", n, alpha, A.values, x.values, 1, beta, y.values, 1)

Review comment:
       The advantage of f2j over native is the absence of the overhead of 
switching between java and native. This overhead is particularly costly when 
the size of the inputs is small or whether the f2j implementation is just "good 
enough". The vector implementation is much faster than f2j on both small and 
large inputs (see 
https://github.com/luhenry/vectorizedblas/releases/tag/v0.1.11 -> 
jmh-results.csv for detailed numbers). It would then be wasteful not to take 
advantage of it when it's available.




----------------------------------------------------------------
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.

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