Better performace: GPU + Workers

조회 수: 3 (최근 30일)
Nycholas Maia
Nycholas Maia 2017년 5월 5일
댓글: Joss Knight 2017년 5월 15일
How can I know what is the best optimization method for me?
  1. Run the code only inside the GPU? Or run only inside the multiple workers/cores?
  2. Is possible to join/mix theses two methods to get a even better performance?

채택된 답변

Joss Knight
Joss Knight 2017년 5월 13일
It depends what you're optimizing. Use of the GPU only really make sense if the objective function is a large enough operation to fully utilize the GPU (e.g. it is multiplying a very large matrix by a vector, such as in iterative solvers). Use of a parallel pool with GPU computation only gains you anything if you have multiple GPUs, but is perfectly possible if you are implementing your own objective function.
Alternatively, if you are on linux, you can try using MPS to allow overlapping use of the same GPU on multiple workers. This can potentially make it viable to use the GPU with smaller operations.
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 5월 14일
"Is not good always use GPU in small or medium operations too?"
Not always. There is communications overhead with the GPU.
Joss Knight
Joss Knight 2017년 5월 15일
Well, my answer to that would be no, the GPU SMs are a lot slower than a CPU core, so you need a lot of parallelism to make it worthwhile.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by