zhengruifeng commented on pull request #28349: URL: https://github.com/apache/spark/pull/28349#issuecomment-619509562
dataset: [epsilon_normalized.t](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html), numInstances=100,000, numFeatures=2,000 testCode: ``` import org.apache.spark.ml.classification._ import org.apache.spark.storage.StorageLevel val df = spark.read.option("numFeatures", "2000").format("libsvm").load("/data1/Datasets/epsilon/epsilon_normalized.t").withColumn("label", (col("label")+1)/2) df.persist(StorageLevel.MEMORY_AND_DISK) df.count val svc = new LinearSVC().setBlockSize(1).setMaxIter(10) svc.fit(df) val results = Seq(1, 4, 16, 64, 256, 1024, 4096).map { size => val start = System.currentTimeMillis; val model = svc.setBlockSize(size).fit(df); val end = System.currentTimeMillis; (size, model.coefficients, end - start) } ``` results: ```scala scala> results.map(_._2).foreach{vec => println(vec.toString.take(150))} [0.7494819225920858,-0.08640022531296566,2.3231273313690615,0.02563502913888478,0.041697717260290056,-0.008274929181709273,1.7654515767910142,0.073740 [0.7494819225920862,-0.08640022531296565,2.323127331369061,0.025635029138884782,0.041697717260290056,-0.008274929181709285,1.7654515767910144,0.073740 [0.7494819225920858,-0.08640022531296568,2.32312733136906,0.025635029138884782,0.04169771726029004,-0.008274929181709273,1.7654515767910144,0.07374022 [0.7494819225920852,-0.08640022531296565,2.3231273313690615,0.025635029138884782,0.04169771726029004,-0.00827492918170927,1.7654515767910142,0.0737402 [0.7494819225920866,-0.08640022531296565,2.3231273313690615,0.025635029138884782,0.041697717260290056,-0.008274929181709282,1.7654515767910144,0.07374 [0.7494819225920862,-0.08640022531296565,2.3231273313690615,0.025635029138884866,0.04169771726029005,-0.008274929181709245,1.7654515767910144,0.073740 [0.7494819225920862,-0.08640022531296568,2.323127331369061,0.025635029138884782,0.041697717260290056,-0.00827492918170928,1.7654515767910144,0.0737402 scala> results.map(_._3) res13: Seq[Long] = List(43328, 8726, 8413, 9151, 9029, 8630, 9212) ``` speed: blockSize=1: ![svc_dur_1](https://user-images.githubusercontent.com/7322292/80302195-1fd71b80-87db-11ea-9a86-1192c66b4a32.png) blockSize=1024 ![svc_dur_1024](https://user-images.githubusercontent.com/7322292/80302268-8e1bde00-87db-11ea-9fc7-9794853c499e.png) RAM: blockSize=1 ![block_svc_1](https://user-images.githubusercontent.com/7322292/80302205-31b8be80-87db-11ea-92f5-4a39ee311ca8.png) blockSize=1024 ![block_svc_1024](https://user-images.githubusercontent.com/7322292/80302213-3ed5ad80-87db-11ea-93d3-e13467d75000.png) **Native BLAS is NOT used in this test** ---------------------------------------------------------------- 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