singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] chrishkchris opened a new pull request #555: SINGA-490 Optimization on GPU Malloc and Cudastream
Date Thu, 31 Oct 2019 03:58:08 GMT
chrishkchris opened a new pull request #555: SINGA-490 Optimization on GPU Malloc and Cudastream
URL: https://github.com/apache/singa/pull/555
 
 
   The performance is improved after some optimization on GPU Malloc and Cudastream:
   
   See the performance (1) after, and (2) before the modification
   
   (1) After Modification:
   ```
   ubuntu@ip-172-31-34-140:~/singa/examples/autograd$ python3 mnist_cnn.py
   Starting Epoch 0:
   Training loss = 588.176819, training accuracy = 0.791072
   Evaluation accuracy = 0.940405, Elapsed Time = 4.002963s
   Starting Epoch 1:
   Training loss = 231.185471, training accuracy = 0.923209
   Evaluation accuracy = 0.956631, Elapsed Time = 3.601223s
   Starting Epoch 2:
   Training loss = 161.976379, training accuracy = 0.946438
   Evaluation accuracy = 0.960537, Elapsed Time = 3.605442s
   Starting Epoch 3:
   Training loss = 134.834137, training accuracy = 0.955460
   Evaluation accuracy = 0.968249, Elapsed Time = 3.614901s
   Starting Epoch 4:
   Training loss = 116.559952, training accuracy = 0.961146
   Evaluation accuracy = 0.976763, Elapsed Time = 3.612387s
   Starting Epoch 5:
   Training loss = 104.692467, training accuracy = 0.965181
   Evaluation accuracy = 0.974760, Elapsed Time = 3.613288s
   Starting Epoch 6:
   Training loss = 95.187668, training accuracy = 0.968850
   Evaluation accuracy = 0.977163, Elapsed Time = 3.617763s
   Starting Epoch 7:
   Training loss = 86.809250, training accuracy = 0.970834
   Evaluation accuracy = 0.979868, Elapsed Time = 3.622240s
   Starting Epoch 8:
   Training loss = 80.897118, training accuracy = 0.972936
   Evaluation accuracy = 0.980769, Elapsed Time = 3.619576s
   Starting Epoch 9:
   Training loss = 77.061165, training accuracy = 0.974253
   Evaluation accuracy = 0.981270, Elapsed Time = 3.624166s
   ubuntu@ip-172-31-34-140:~/singa/examples/autograd$ python3 resnet.py
   Start intialization............
   100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████|
100/100 [01:16<00:00,  1.31it/s]
   Throughput = 41.99441623128245 per second
   Total=0.7620060682296753, forward=0.228380126953125, softmax=0.0019501876831054688, backward=0.5316757535934448,
sgd=0.01689112663269043
   ```
   
   (2) Before Modification: 
   ```
   ubuntu@ip-172-31-34-140:~/singa/examples/autograd$ python3 mnist_cnn.py
   Starting Epoch 0:
   Training loss = 587.402832, training accuracy = 0.793206
   Evaluation accuracy = 0.941807, Elapsed Time = 4.122746s
   Starting Epoch 1:
   Training loss = 234.969131, training accuracy = 0.921391
   Evaluation accuracy = 0.961138, Elapsed Time = 4.029378s
   Starting Epoch 2:
   Training loss = 166.122360, training accuracy = 0.945504
   Evaluation accuracy = 0.972556, Elapsed Time = 4.036772s
   Starting Epoch 3:
   Training loss = 135.528732, training accuracy = 0.954959
   Evaluation accuracy = 0.973157, Elapsed Time = 4.045134s
   Starting Epoch 4:
   Training loss = 119.345100, training accuracy = 0.960145
   Evaluation accuracy = 0.971354, Elapsed Time = 4.051367s
   Starting Epoch 5:
   Training loss = 104.030357, training accuracy = 0.965198
   Evaluation accuracy = 0.976362, Elapsed Time = 4.049580s
   Starting Epoch 6:
   Training loss = 95.427139, training accuracy = 0.967783
   Evaluation accuracy = 0.982973, Elapsed Time = 4.048486s
   Starting Epoch 7:
   Training loss = 87.675827, training accuracy = 0.970134
   Evaluation accuracy = 0.982572, Elapsed Time = 4.045773s
   Starting Epoch 8:
   Training loss = 81.529778, training accuracy = 0.972002
   Evaluation accuracy = 0.980469, Elapsed Time = 4.047782s
   Starting Epoch 9:
   Training loss = 78.076904, training accuracy = 0.973903
   Evaluation accuracy = 0.982372, Elapsed Time = 4.053918s
   ubuntu@ip-172-31-34-140:~/singa/examples/autograd$ python3 resnet.py
   Start intialization............
   100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████|
100/100 [01:22<00:00,  1.21it/s]
   Throughput = 38.95291017265649 per second
   Total=0.8215047311782837, forward=0.2588650298118591, softmax=0.0019469261169433594, backward=0.5606927752494812,
sgd=0.016621625423431395
   ```
   
   

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