Per-instance Preamble for GPU Shader Memory Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In graphics processing, the need to handle multiple instances of graphics data leads to increased memory traffic and power consumption due to the requirement for large uniform buffer objects that often exceed the capacity of on-chip constant memory, resulting in reduced performance.

Innovation Solution

The implementation of per-instance preambles allows for targeted loading of instance-specific uniforms into constant RAM at shader runtime, reusing common data and reducing the need for on-chip memory allocation, thereby minimizing memory traffic and power consumption.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If large uniform buffer objects are allocated to handle multiple instances of graphics data, then the capacity to store instance-specific data is improved, but memory traffic and power consumption increase

Engineering Contradiction:
Improvecapacity to store instance-specific dataVSAvoidpower consumption
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The uniform buffer is segmented into two distinct parts: (1) a compact per-instance uniform buffer stored in on-chip constant memory that contains only instance-specific parameters, and (2) a shared uniform buffer stored in off-chip memory that contains common data reused across all instances. This segmentation allows the system to minimize on-chip memory usage while reducing memory traffic by loading only instance-specific data per instance, thereby lowering power consumption without sacrificing storage capacity.

Inventive Principle:
Principle #1Segmentation

2Quantity of substance

If large uniform buffer objects are allocated to handle multiple instances of graphics data, then the capacity to store instance-specific data is improved, but memory traffic increases

Engineering Contradiction:
Improvecapacity to store instance-specific dataVSAvoidmemory traffic
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The uniform buffer is segmented into two distinct parts: (1) a compact per-instance uniform buffer stored in on-chip constant memory that contains only instance-specific parameters, and (2) a shared uniform buffer stored in off-chip memory that contains common data reused across all instances. This segmentation allows the system to minimize on-chip memory usage while reducing memory traffic by loading only instance-specific data per instance, thereby lowering power consumption without sacrificing storage capacity.

Inventive Principle:
Principle #1Segmentation

3Quantity of substance

If on-chip constant memory capacity is increased to store all instance uniforms, then memory efficiency is improved, but device complexity and cost increase

Engineering Contradiction:
Improveon-chip constant memory capacityVSAvoiddevice complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The uniform buffer is segmented into two distinct parts: (1) a compact per-instance uniform buffer stored in on-chip constant memory that contains only instance-specific parameters, and (2) a shared uniform buffer stored in off-chip memory that contains common data reused across all instances. This segmentation allows the system to minimize on-chip memory usage while reducing memory traffic by loading only instance-specific data per instance, thereby lowering power consumption without sacrificing storage capacity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system extracts and separates the instance-specific uniform data from the complete uniform buffer, placing only the necessary per-instance parameters in on-chip constant memory. The remaining shared data is kept in off-chip memory and loaded once and reused across all instances. This extraction minimizes the on-chip memory requirement and avoids the complexity and cost associated with large on-chip memory allocations.

Inventive Principle:
Principle #2Taking out (Extraction)

4Quantity of substance

If per-instance uniforms are loaded for each instance, then memory efficiency is improved, but execution time increases due to repeated loading

Engineering Contradiction:
Improvememory efficiencyVSAvoidexecution time
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

The system performs preliminary loading of the shared uniform buffer from off-chip memory into on-chip constant memory before executing the shader program. This preliminary action ensures that common data is already in fast on-chip memory when the shader needs to access it, eliminating repeated loading delays and improving execution time while maintaining memory efficiency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system maintains continuous useful action by keeping the shared uniform buffer in on-chip constant memory throughout the execution of multiple instances, allowing rapid repeated access without additional loading. This continuity eliminates idle time between instance processing and maximizes the utilization of on-chip memory bandwidth, improving overall execution efficiency.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS9799094B1Per-instance preamble for graphics processing
Publication Date: 2017.10.24 QUALCOMM INC
  • US9799094B1 patent drawing
  • US9799094B1 patent drawing
  • US9799094B1 patent drawing

AI summary

A method for processing data in a graphics processing unit (GPU) including receiving an instance identifier for an instance and a shader program comprising a preamble code block and a main shader code block, assigning, the instance identifier to a general purpose register at wave creation, allocating address space within the constant memory for instance uniforms, and determining the preamble code block has not been executed and the wave is a first wave of the instance to be executed, based on determining the preamble code block has not been executed and the wave is the first wave to be executed, executing the preamble code block to store the plurality of instance uniforms in the constant memory and based, at least in part, on executing the preamble code block, executing the wave of the plurality of waves using at least one of the plurality of instance constants stored inconstant memory.