nvshare: Practical GPU Sharing Without Memory Size Constraints

Presenter: Georgios Alexopoulos, University of Athens
Date: 27 March 2024

Abstract

GPUs are essential for accelerating Machine Learning (ML) workloads. A common practice is deploying ML jobs as containers managed by an orchestrator such as Kubernetes. Kubernetes schedules GPU workloads by exclusively assigning a device to a single job, which leads to massive GPU underutilization, especially for interactive development jobs with significant idle periods.

Current GPU sharing approaches assign a fraction of GPU memory to each colocated job to avoid memory contention and out-of-memory errors. However, this is impractical, as it requires a priori knowledge of memory usage and does not fully address GPU underutilization.

We propose nvshare, which transparently enables page faults (i.e.,exceptions that are raised when an entity attempts to access a resource) to allow virtual GPU memory oversubscription. In this way we permit each application to utilize the entire physical GPU memory (Video RAM).

To prevent thrashing (a situation in which page faults dominate execution time) in a reliable manner, nvshare serializes overlapping GPU bursts from different applications. We compared nvshare with KubeShare, a state-of-the-art GPU sharing solution.

Our results indicate that both perform equally well in convential sharing cases where total GPU memory usage fits into VRAM. For memory oversubscription scenarios, which KubeShare does not support, nvshare outperforms the sequential execution baseline by up to 1.35x.

Our tool has been adopted in both research and industrial settings.

  • Video demonstration: https://www.youtube.com/watch?v=9n-5sc5AICY
  • Github repository: https://github.com/grgalex/nvshare