nudles commented on a change in pull request #651: Simply example APIs
URL: https://github.com/apache/singa/pull/651#discussion_r403476030
 
 

 ##########
 File path: examples/autograd/cifar10_multiprocess.py
 ##########
 @@ -17,28 +17,16 @@
 # under the License.
 #
 
-from singa import opt
 from resnet_cifar10 import *
 import multiprocessing
 
-
-def data_partition(dataset_x, dataset_y, rank_in_global, world_size):
-    data_per_rank = dataset_x.shape[0] // world_size
-    idx_start = rank_in_global * data_per_rank
-    idx_end = (rank_in_global + 1) * data_per_rank
-    return dataset_x[idx_start:idx_end], dataset_y[idx_start:idx_end]
-
-
 if __name__ == '__main__':
 
     # Generate a NCCL ID to be used for collective communication
     nccl_id = singa.NcclIdHolder()
 
-    sgd = opt.SGD(lr=0.005, momentum=0.9, weight_decay=1e-5)
-
-    gpu_per_node = 4
-    max_epoch = 100
-    batch_size = 32
+    # number of GPUs to be used
+    gpu_per_node = 2
 
 Review comment:
   can we use 
[argparse](https://github.com/apache/singa/blob/master/examples/mnist/train.py#L128)
 to get the number of gpus from the command line?

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