Virtual GPU Context Switching Overhead Reduction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

GPUs experience inefficiencies due to stall periods and high overhead costs associated with context switching between programs, leading to idle execution units and poor granularity control, especially in multi-tasking environments.

Innovation Solution

Implementing multiple virtual GPUs within a single GPU structure, allowing shared hardware resources with separate computation results storage, which reduces the need for full context switching and enables finer granularity control by allowing instruction execution during shorter windows of time.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If context switching is performed between programs on GPU execution units, then program execution flexibility is improved, but overhead cost and power consumption increase significantly

Engineering Contradiction:
Improveprogram execution flexibilityVSAvoidpower consumption
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent creates virtual GPU instances that copy essential GPU state information (registers, program counters, working data) into external storage before context switching. This copying mechanism allows rapid restoration of program state without requiring full context switch overhead, reducing power consumption while maintaining execution flexibility.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent performs preliminary actions by saving GPU state information to external storage before context switching occurs. This advance preparation reduces the cost of subsequent context switches by eliminating the need to clear and reinitialize all GPU state, thereby reducing power consumption while maintaining program execution flexibility.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If context switching is performed frequently between programs, then multi-tasking capability is improved, but execution unit downtime increases

Engineering Contradiction:
Improvemulti-tasking capabilityVSAvoidexecution unit downtime
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

By copying GPU state to external storage, the patent enables rapid context switches without prolonged execution unit downtime. The copied state can be quickly restored, allowing frequent task switching while minimizing idle time.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent maintains continuity of useful action by preserving GPU state in external storage during context switches. This allows execution units to be quickly reconfigured for new tasks without significant downtime, enabling continuous productive work across multiple programs.

Inventive Principle:
Principle #20Continuity of useful action

3Reliability

If full context switching is performed, then program isolation is improved, but switching cost and complexity increase

Engineering Contradiction:
Improveprogram isolationVSAvoidswitching cost
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent extracts only the essential GPU state information (registers, program counters, working data) that needs to be preserved during context switching, rather than managing the entire GPU state. This extraction reduces switching complexity and cost while maintaining sufficient program isolation through selective state preservation.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentEP2549382B1Virtual GPU
Publication Date: 2019.03.20 APPLE INC
  • EP2549382B1 patent drawingFigure 1
  • EP2549382B1 patent drawingFigure 2
  • EP2549382B1 patent drawingFigure 3

AI summary

Techniques and structures relating to virtual graphics processing units (VGPUs) are disclosed. A VGPU may appear to software as an independent hardware GPU. However, two or more VGPUs can be implemented on the same GPU through the use of control structures and by duplicating some (but not all) hardware elements of the GPU. For example, additional registers and storage space may be added in a GPU supporting multiple VGPUs. Different execution priorities may be set for tasks and threads that correspond to the different supported VGPUs. Memory address space for the VGPUs may also be managed, including use of virtual address space for different VGPUs. Halting and resuming execution of different VGPUs may allow for finer-grained execution control, and for better GPU efficiency.