Replace Gather + RowMul by SparseLengthsWeightedSum
Replace Gather + RowMul by SparseLengthsWeightedSum

Summary:
Improving performace using command SparseLenghtsWeightedSum. Results for my run:
Before:

  8.98474 RowMul
  6.89952 Gather
  0.80991 LengthsSum
  2.02056 SparseLengthsWeightedSum
  Total: 18.71

After:

  1.075 Gather
  6.54999 SparseLengthsWeightedSum
  Total: 7.62

Log of run: P56992396

With skip_backward. Command:

  CLASSPATH=/mnt/vol/gfsetlprocstore-oregon/users/cxj/hivereader-wrapper-1.0-SNAPSHOT-standalone.jar OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 MKL_DYNAMIC=FALSE ./buck-out/gen/caffe2/caffe2/fb/dper/tools/speed_benchmark.par -loader_param /mnt/vol/gfsfblearner-altoona/flow/data/2017-01-22/d832bb7b-5598-422e-9fee-b3299a9c8c1f -negDownsampleRate 0.1 -hidden 'unary(dot{"num_dense": 6, "pooling_method": "PositionWeighted"}(128, 64)128-128, 1)' -model_type mlp_sparse -warmup_runs 10 -main_runs 1000 -run_individual -skip_backward 2>&1 | tee /tmp/log.txt

Before: P56993234$7509
After: P56992503$7344

Command:

  ./fblearner/nn/ads/canary all

https://our.intern.facebook.com/intern/fblearner/details/13320564/?notif_channel=cli

Cloned "caffe2 ads sparse nn canary" run: https://our.intern.facebook.com/intern/fblearner/details/13322337/

Reviewed By: xianjiec

Differential Revision: D4451073

fbshipit-source-id: 0a4e9693d7b8b0372b2efefa61154e987a493210

davinwang/caffe2,bwasti/caffe2,pietern/caffe2,pietern/caffe2,xzturn/caffe2,bwasti/caffe2,pietern/caffe2,Yangqing/caffe2,Yangqing/caffe2,bwasti/caffe2,Yangqing/caffe2,sf-wind/caffe2,davinwang/caffe2,xzturn/caffe2,Yangqing/caffe2,pietern/caffe2,xzturn/caffe2,pietern/caffe2,davinwang/caffe2,sf-wind/caffe2,davinwang/caffe2,davinwang/caffe2,sf-wind/caffe2,bwasti/caffe2,xzturn/caffe2,sf-wind/caffe2,bwasti/caffe2,Yangqing/caffe2,xzturn/caffe2,sf-wind/caffe2,caffe2/caffe2