zhengruifeng commented on pull request #32857:
URL: https://github.com/apache/spark/pull/32857#issuecomment-858366098


   
[test](https://github.com/apache/spark/pull/32857/commits/7e8f195fc056ce39b5032fb85706615ada1f66c4)
 :
   
   ```
     test("sparse gemm") {
       val rng = new scala.util.Random(0)
       val m = 1e3.toInt
       val n = 1e3.toInt
       val k = 1e3.toInt
       val alpha = rng.nextDouble
       val beta = rng.nextDouble
   
       val a = Array.tabulate(m * k) { _ =>
         if (rng.nextDouble < 0.9) 0.0 else rng.nextDouble
       }
       val A = Matrices.dense(m, k, a).toSparse
   
       val B = Matrices.dense(k, n, Array.fill(k * n)(rng.nextDouble)).toDense
   
       val C = Matrices.dense(m, n, Array.fill(k * n)(rng.nextDouble)).toDense
   
       val tic1 = System.nanoTime
       Iterator.range(0, 1000).foreach { i => BLAS.gemm(alpha, A, B, beta, C) }
       val toc1 = System.nanoTime
   
       // scalastyle:off println
       println(f"new sparse gemm duration: ${(toc1 - tic1) * 1e-9}%.3f")
       // scalastyle:on println
     }
   
   ```
   
   
   results:  master: 92.080;          this pr: 79.319


-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to