Work-Group Size Determination via Spatial Locality Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for determining work-group size in OpenCL frameworks do not effectively optimize resource usage and load balance across computing units, particularly in terms of spatial locality and memory access patterns, leading to suboptimal performance.
Innovation Solution
A method and apparatus that calculate spatial locality and footprints of work items within a work-group, converting memory references to symbol expressions, partially evaluating these expressions, and determining work-group size based on reuse distance and memory line size to maximize spatial locality and adhere to resource constraints.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If work-group size is increased to improve parallel processing throughput, then productivity increases, but resource usage efficiency deteriorates due to poor spatial locality and imbalanced load distribution
Solution Approach 1:
The patent dynamically determines work-group size by analyzing memory access patterns and spatial locality characteristics of the kernel being executed. Instead of using a fixed or arbitrarily chosen work-group size, the system calculates the actual memory footprint and access behavior to adaptively set the optimal work-group size, thereby improving both productivity and resource efficiency simultaneously
Solution Approach 2:
The patent changes the parameter of work-group size based on calculated spatial locality metrics and memory footprint analysis. By transforming the static work-group size parameter into a dynamic one that adapts to the specific kernel's memory access characteristics, the system resolves the contradiction between throughput and efficiency
2Speed
If work-group size is increased to process more work items simultaneously, then processing speed improves, but load balance between computing units deteriorates
Solution Approach 1:
The system dynamically adjusts work-group size to maintain stable load distribution across computing units. By continuously analyzing memory access patterns and adjusting work-group dimensions accordingly, the system ensures that each computing unit receives an appropriate workload, preventing both overload and underutilization while maintaining high processing speed
3Loss of energy
If work-group size is reduced to improve spatial locality and memory access efficiency, then resource usage improves, but productivity decreases due to fewer work items processed per work-group
Solution Approach 1:
The patent changes the work-group size parameter based on calculated spatial locality values and memory footprint analysis. By transforming this parameter from a fixed value to a dynamically determined one, the system optimizes the balance between memory access efficiency and processing throughput, achieving both improved resource usage and maintained productivity
4Device complexity
If work-group size is arbitrarily set without analysis, then device complexity and implementation simplicity are maintained, but performance optimization deteriorates
Solution Approach 1:
The system performs self-service by automatically analyzing its own memory access patterns and determining optimal work-group size without requiring external manual configuration. The kernel itself provides the necessary information about its memory access behavior, and the system uses this information to self-optimize the work-group size, eliminating the need for complex external analysis tools while achieving performance optimization
Data Source
AI summary
Methods and apparatuses for determining a work-group size are provided. The method of determining a work-group size includes calculating a first value denoting spatial locality of a memory that is shared by one or more work items included in a work-group, calculating a second value denoting footprints of the one or more work items included in the work-group based on the first value, and determining the work-group size based on the first and second values.


