singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] chrishkchris commented on a change in pull request #651: Simply example APIs
Date Sat, 04 Apr 2020 14:42:15 GMT
chrishkchris commented on a change in pull request #651: Simply example APIs
URL: https://github.com/apache/singa/pull/651#discussion_r403477723
 
 

 ##########
 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:
   yes, okay I will add command line input argument and change to num_gpus
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message