hmp2g
hmp2g copied to clipboard
How to make the program use the GPU as much as possible?
trafficstars
I am using GPU to run this program, but the GPU usage is very low. How can I increase the GPU usage to make the program execute faster? What settings in the code need to be changed to make the best possible use of the GPU? 谢谢您
Try changing "device" and "gpu_party" in launch json:
{
// --- Part1: config HMP core ---
"config.py->GlobalConfig": {
............
"device": "cuda:0",
"gpu_party": "off",
............
},
}
The former setting intialize gpu in main.py and set the device flag in "config.py->GlobalConfig". The latter setting disables gpu memory sharing between HMP experiments, which slightly increases speed and safety. Then, in wherever you'd like to use gpu:
from config import GlobalConfig as cfg
...
model.to(cfg.device)
tensor.to(cfg.device)