apeforest commented on a change in pull request #17449: Implemented large 
tensor flag for opperf testing
URL: https://github.com/apache/incubator-mxnet/pull/17449#discussion_r373707455
 
 

 ##########
 File path: benchmark/opperf/nd_operations/nn_conv_operators.py
 ##########
 @@ -60,131 +81,286 @@ def run_pooling_operators_benchmarks(ctx=mx.cpu(), 
dtype='float32', profiler='na
     pool2d_benchmark_res = []
     for pool_type in pool_types:
         for global_pool in global_pool_types:
-            for pool1d_data in [(32, 3, 256), (32, 3, 64)]:
-                pool1d_benchmark_res += 
run_performance_test([getattr(MX_OP_MODULE, "Pooling")],
-                                                             run_backward=True,
-                                                             dtype=dtype,
-                                                             ctx=ctx,
-                                                             profiler=profiler,
-                                                             inputs=[{"data": 
pool1d_data,
-                                                                      
"kernel": 3,
-                                                                      
"pool_type": pool_type,
-                                                                      
"global_pool": global_pool,
-                                                                      
"stride": 1,
-                                                                      "pad": 1}
-                                                                     ],
-                                                             warmup=warmup,
-                                                             runs=runs)
-            for pool2d_data in [(32, 3, 256, 256), (32, 3, 64, 64)]:
-                pool2d_benchmark_res += 
run_performance_test([getattr(MX_OP_MODULE, "Pooling")],
-                                                             run_backward=True,
-                                                             dtype=dtype,
-                                                             ctx=ctx,
-                                                             profiler=profiler,
-                                                             inputs=[{"data": 
pool2d_data,
-                                                                      
"kernel": (3, 3),
-                                                                      
"pool_type": pool_type,
-                                                                      
"global_pool": global_pool,
-                                                                      
"stride": (1, 1),
-                                                                      "pad": 
(0, 0)}
-                                                                     ],
-                                                             warmup=warmup,
-                                                             runs=runs)
+            if large_tensor == 'on':
+                for pool1d_data in [(1, 1, 2**32), (2**31, 1, 3)]:
+                    pool1d_benchmark_res += 
run_performance_test([getattr(MX_OP_MODULE, "Pooling")],
+                                                                 
run_backward=True,
+                                                                 dtype=dtype,
+                                                                 ctx=ctx,
+                                                                 
profiler=profiler,
+                                                                 
inputs=[{"data": pool1d_data,
+                                                                          
"kernel": 3,
+                                                                          
"pool_type": pool_type,
+                                                                          
"global_pool": global_pool,
+                                                                          
"stride": 1,
+                                                                          
"pad": 1}
+                                                                        ],
+                                                                 warmup=warmup,
+                                                                 runs=runs)
+                for pool2d_data in [(2**29, 1, 3, 3), (2**28, 1, 4, 4)]:
+                    pool2d_benchmark_res += 
run_performance_test([getattr(MX_OP_MODULE, "Pooling")],
+                                                                 
run_backward=True,
+                                                                 dtype=dtype,
+                                                                 ctx=ctx,
+                                                                 
profiler=profiler,
+                                                                 
inputs=[{"data": pool2d_data,
+                                                                          
"kernel": (3, 3),
+                                                                          
"pool_type": pool_type,
+                                                                          
"global_pool": global_pool,
+                                                                          
"stride": (1, 1),
+                                                                          
"pad": (0, 0)}
+                                                                        ],
+                                                                 warmup=warmup,
+                                                                 runs=runs)
+            else:
 
 Review comment:
   It seems the only difference between the if and else branch is the `inputs` 
argument. Can we only generate different inputs in the if/else branch and pass 
them to the same operator function?

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


With regards,
Apache Git Services

Reply via email to