title: Can multiple tensorflow inferences run on one GPU in parallel?
body: <p>I am trying to run Tensorflow as a serve on one NVIDIA Tesla V100 GPU. As a server, my program need to accept multiple requests concurrently. So, my questions are the following:</p>
  
  <ol>
  <li><p><strong>When multiple requests arrive at the same time, suppose we are not using batching, are these requests run on the GPU sequentially or in parallel?</strong> I understand independent processes have seperate CUDA contexts, which are run sequentially on the GPU. But these requests are actually different threads in the same process and should share one CUDA context. So according to the <a href="https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#concurrent-kernel-execution" rel="noreferrer">documentation</a>, the GPU can run multiple kernels concurrently. If this is the true, does it mean if I have a large amount of requests arrive at the same time, the GPU utilization can go up to 100%? But this never happen in my experiment. </p></li>
  <li><p><strong>What is the difference between running one session in different threads vs. running different sessions in different threads?</strong> Which is the proper way to implement a Tensorflow server? Which one does Tensorflow Serving use?</p></li>
  </ol>
  
  <p>Any advice will be appreciated. Thank you!</p>