Compiler Precision Selection for Shader Performance

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Developers face challenges in improving the performance of graphic shader programs due to the large number of shader programs in games, which affects processing performance and power consumption, and manual conversion to half precision is impractical.

Innovation Solution

A compiler is used to identify computations in shader programs where precision can be lowered without degrading image quality, automatically rewriting computations to half precision while providing notifications for potential precision loss and weighing power consumption benefits.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual conversion to half precision is performed, then precision optimization is achieved, but development time and complexity increase significantly

Engineering Contradiction:
Improveprecision optimizationVSAvoidconversion complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The compiler automatically performs precision analysis and conversion to half precision without requiring manual intervention from developers. The system self-services by analyzing shader programs, identifying computations suitable for half precision, and generating optimized code automatically, thereby resolving the contradiction between achieving precision optimization and avoiding increased complexity

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The compiler changes the precision parameter of computations from single precision to half precision automatically. By modifying this fundamental parameter through automated analysis and transformation, the system achieves optimization without requiring developers to manually adjust each computation, thus reducing overall complexity

Inventive Principle:
Principle #35Parameter changes

2Productivity

If all computations are converted to half precision, then performance improvement is achieved, but image quality degradation occurs

Engineering Contradiction:
ImproveperformanceVSAvoidimage quality
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The compiler applies half precision selectively to specific computations rather than uniformly to all computations. By analyzing each computation's sensitivity to precision loss, the system applies lower precision only where acceptable and maintains higher precision where image quality depends on it, thus achieving performance improvement without unacceptable quality degradation

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system performs partial conversion to half precision, converting only those computations that can tolerate the reduced precision without degrading image quality. This partial action approach allows performance benefits to be realized while avoiding the excessive conversion that would cause quality loss

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If precision analysis is performed manually, then control over precision loss is achieved, but time consumption increases

Engineering Contradiction:
Improveprecision controlVSAvoidanalysis time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The compiler performs precision analysis automatically as part of its compilation process, eliminating the need for manual analysis by developers. The system self-services by evaluating precision risks, generating reports, and suggesting optimizations without time-consuming manual intervention, thus maintaining reliability while reducing analysis time

Inventive Principle:
Principle #25Self-service

Data Source

PatentEP3963443B1Acceleration of shader programs by compiler precision selection
Publication Date: 2024.05.08 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3963443B1 patent drawingFigure 1
  • EP3963443B1 patent drawingFigure 2
  • EP3963443B1 patent drawingFigure 3

AI summary

Methods and devices for lowering precision of computations used in shader programs may include receiving program code for a shader program to use with a graphics processing unit (GPU) that supports half precision storage and arithmetic in shader programs. The methods and devices may include performing at least one pass on the program code to select a set of operations within the program code to lower a precision of a plurality of computations used by the set of operations and evaluating a risk of precision loss for lowering the precision to a half precision for each computation of the plurality of computations. The methods and devices may include generating edited program code by rewriting the computation to the half precision in response to the risk of precision loss being a precision loss threshold.