Replace `GatherRangesToDense` operator in Dper from c2 to pt.
Summary: Replace `GatherRangesToDense` operator in Dper from c2 to pt.
Test Plan:
```
buck test //caffe2/torch/fb/sparsenn:test mode/dev-sand -c fbcode.nvcc_arch=v100 -c fbcode.enable_nccl_a2a=1
```
```
Started reporting to test run: https://our.intern.facebook.com/intern/testinfra/testrun/3659174735981484
✓ ListingSuccess: caffe2/torch/fb/sparsenn:test - main (22.179)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_all_dropout_empty_input (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (27.738)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_batch_one_hot_lengths (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (27.764)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_gather_ranges (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (27.787)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_lengths_to_offsets (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (27.804)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_clip_chunks (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (27.806)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_offsets_to_ranges_empty_batch (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (27.947)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_multiple_runs (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (28.008)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_batch_one_hot (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.036)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_sort_id_score_list_by_score (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.080)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_gather_ranges_to_dense_caffe2_without_key (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.119)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_offsets_range (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.147)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_gather_ranges_to_dense_caffe2 (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.179)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_lengths_range (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.241)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_transform (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (28.252)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_all_dropout (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.265)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_bucketize (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.274)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_batch_box_cox (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.305)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_sigrid_hash_op (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.314)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_cumsum (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.314)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_ranges (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (28.393)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_rowwise_prune_op_32bit_indices (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.411)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_no_dropout (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (28.520)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_tracing (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (28.945)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_scale_gradient_backward (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (33.231)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_offsets_to_ranges (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (19.864)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_create (caffe2.torch.fb.sparsenn.tests.sigrid_transforms_test.SigridTransformsOpsTest) (19.634)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_prior_correction_calibration_accumulate (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.113)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_scale_gradient (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.204)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_offsets_to_lengths (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.533)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_offsets_to_lengths_empty_batch (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.487)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_clip_ranges (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.807)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_gather_ranges_to_dense_without_max_mismatched_ratio (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (21.576)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_rowwise_prune_op_64bit_indices (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (22.209)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_embedding_bag_4bit_rowwise_sparse (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (22.072)
✓ Pass: caffe2/torch/fb/sparsenn:test - test_prior_correction_calibration_prediction (caffe2.torch.fb.sparsenn.tests.sparsenn_operators_test.SparseNNOperatorsTest) (24.934)
Summary
Pass: 35
ListingSuccess: 1
Finished test run: https://our.intern.facebook.com/intern/testinfra/testrun/3659174735981484
```
```
buck build mode/opt //caffe2/benchmarks/operator_benchmark/fb/pt:gather_ranges_to_dense_benchmark_test
aibench-cli adhoc -c 'buck run //caffe2/benchmarks/operator_benchmark/fb/pt:gather_ranges_to_dense_benchmark_test'
```
```
# Benchmarking PyTorch: gather_ranges_to_dense
# Mode: Eager
# Name: gather_ranges_to_dense_batch_size13_max_lengths14_opcaffe2_gather_ranges_to_dense
# Input: batch_size: 13, max_lengths: 14, op: caffe2_gather_ranges_to_dense
Forward Execution Time (us) : 10.428
# Benchmarking PyTorch: gather_ranges_to_dense
# Mode: Eager
# Name: gather_ranges_to_dense_batch_size13_max_lengths14_optorch_gather_ranges_to_dense
# Input: batch_size: 13, max_lengths: 14, op: torch_gather_ranges_to_dense
Forward Execution Time (us) : 8.986
```
Reviewed By: dzhulgakov
Differential Revision: D24831789
fbshipit-source-id: 110edc86335ae357da435babf87da1a3e537c631