knowledgedefinednetworking / DRL-GNN

BSD 3-Clause "New" or "Revised" License
191 stars 35 forks source link

Why do not use GPU instead of CPU? #15

Closed Zihao2001 closed 1 year ago

Zihao2001 commented 1 year ago

Hello, I am learning your papers and codes. I am confused that why the GPU will not be applied (os.environ['CUDA_VISIBLE_DEVICES'] = '-1'). By the way, I then change '-1' to '0', the training speed is still slow. Could you please explain this to me? I am not very familiar to GNN.

paulalmasan commented 1 year ago

In general terms, DRL is a sequential process that alternates between generating experiences and training the DRL with them. In our work, the training part is not as computationally intensive as the experience generation and we decided to use the CPU. We observed that using the GPU adds an extra step of copying the experience data to the GPU back and forth, resulting in longer training times. There are many training architectures or frameworks that are trying to improve the training time in DRL and they could be adapted to our particular DRL+GNN architecture.

Zihao2001 commented 1 year ago

Understood, thank you very much for replying to me.