I have a very computationally intense task, which has high efficiency requirement. It includes to calculate 3 states, which have no dependency with each other and can run independently. So I use the multiprocessing of the python to speed up the codes, but it still needs a lot of time. Hence I hope to utilitze the advantage of GPU on computation. But I have the question whether multiprocesses can run parallely on single GPU? My main programming language is python. Can anyone gives some advice? Thank you!
Asked
Active
Viewed 680 times
0
-
You won't be using the `multiprocessing` module, you will need to interface the GPU with the appropriate libraries applicable for your hardware, see [thread](https://stackoverflow.com/questions/56220260/how-to-run-python-on-amd-gpu). – metatoaster Apr 04 '22 at 06:50
-
1Are you sure the problem isn't the algorithm itself? A bad algorithm will be slow on GPUs if not slower. Just using lots of threads won't make a bad algorithm faster, it can even be *slower* if it requires a lot of synchronization and coordination. As for a single GPU, so do most gaming machines. GPUs are faster because they have a parallel architecture that uses hundreds of very small, specialized cores. Of course, if your algorithm requires a lot of synchronization, a 100-way sync will be a lot worse than a 4-way sync – Panagiotis Kanavos Apr 04 '22 at 06:51
-
You could improve performance far more than any GPU if you wrote efficient code with minimal synchronization. For example, splitting your data into chunks and using one core to process each chunk *without* any communication with other cores, locks or using common memory locations (which require locks and synchronization). This is a prerequisite for GPU programming as well – Panagiotis Kanavos Apr 04 '22 at 06:53