alexnet_dorefa could not utilize all GPUs, training is slow
@ppwwyyxx
1. What you did:
(1) If you're using examples, what's the command you run: python ./alexnet-dorefa.py --gpu 0,1,2,3,4,5,6,7,8 --dorefa 1,2,6 --data ImageNet_2012
(2) **If you're using examples, have you made any changes to the examples? ** No change except set the number of GPU to 8x
2. What you observed:
(1) Include the ENTIRE logs here:
We see the training process started and the dataset was allocated all over all 8xGPU (NVIDIA Tesla V100). However, only one GPU is used for training at a time and its utilization is very low

4. Your environment:
- Latest Tensorpack, install via pip
- Output of this command:
python -c 'import tensorpack.tfutils as u; print(u.collect_env_info())'import tensorpack.tfutils as u
Hi, Is the top 1 accuracy calculation used in the alexnet-dorefa.py correct? I am using a different architecture like MobileNet and 1,1,32 dorefa structure to train and the top 1 accuracy seems quite good.
The speed is not slow when I run it. You can follow https://tensorpack.readthedocs.io/tutorial/performance-tuning.html#figure-out-the-bottleneck to see whether your training is bottlenecked by data loading.
I din't mean speed but the top 1 accuracy calculation whether it is correct in the tensorpack package? I see some issue with the implementation of top 1 accuracy and top 5 accuracy. Can you check if the implementation is correct or not ?
I mean speed because the original post is about speed.
If you believe there is an issue, please point out where. Otherwise I don't know what to check.
The speed is not slow when I run it. You can follow https://tensorpack.readthedocs.io/tutorial/performance-tuning.html#figure-out-the-bottleneck to see whether your training is bottlenecked by data loading.
@ppwwyyxx: Thanks for tips. I will deep dive into the link. I also thought that is due to data loading from CPU to GPU. I have upto 40 cores so the data loading should be fast. I will get back to you later when I have more information.
@ppwwyyxx: btw, I installed tensorflow-1.14 and tensorpack-0.9.8 via "conda" environment. Is it same to the one that you used to runDoReFa alexnet or others (virtualenv, install from source, docker etc.)
I use tensorflow 1.14 from pip but I don't think tensorflow version matters here.
If I use the 1 bit activation for my last layer, I see there is an error in the accuracy calculation. Is that right? How is the calculation becoming wrong?
@roshan-gopalakrishnan I could not understand what you're asking and it also seems unrelated to this issue.
I use tensorflow 1.14 from pip but I don't think tensorflow version matters here.
@ppwwyyxx: I remove anaconda3 (conda) and use system "pip3" to directly install tensorflow-1.15. The training performance is tremendously improved. With 8xGPU V100 and 40 cores CPU, training one epoch took 14 minutes which is pretty good. Thank for your help.