Compiler Pipelining for Loops with Local Storage
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compiler technologies face performance losses when dealing with loops that declare private variables for large data arrays, as the internal storage capabilities of accelerator hardware like FPGAs are limited, leading to memory-based treatment of these variables.
Innovation Solution
A compiler is developed to automatically transform source code into pipeline execution code for loops with local variables, allocating each loop iteration its own copy and using communication arcs with buffer storage to enable pipelined execution, thereby overcoming storage limitations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If loops with private variables for large data arrays are executed using traditional memory-based storage, then the accelerator hardware can handle the data, but performance losses occur due to limited internal storage capabilities
Solution Approach 1:
The patent segments the loop execution into multiple pipeline stages, where each stage processes a portion of the data array. By dividing the loop into pipeline stages with internal buffers, the system can process large data arrays without requiring all data to be stored in internal memory simultaneously, thus resolving the contradiction between performance and internal storage capacity.
Solution Approach 2:
The patent introduces a temporal dimension to the storage problem by using pipeline buffering. Instead of requiring all data to be stored in internal memory at once (spatial solution), the system uses time-multiplexed buffering across pipeline stages. This dimensional transformation allows large data arrays to be processed efficiently without exceeding internal storage limits.
2Productivity
If pipeline execution is implemented for loops with local variables, then throughput is improved by parallel execution, but device complexity increases due to buffer storage requirements
Solution Approach 1:
The patent implements a universal buffering mechanism that serves multiple purposes: it provides pipeline staging for parallel execution, manages data flow between stages, and handles dependency tracking. By making the buffer structure multi-functional, the system achieves high throughput without proportionally increasing complexity, as the same infrastructure serves multiple needs.
Solution Approach 2:
The patent introduces communication arcs with buffers as intermediary structures between pipeline stages. These buffers act as mediators that decouple the stages from each other, allowing independent optimization of each stage while maintaining overall coordination. This intermediary layer simplifies the overall system design by providing a standardized interface for data exchange.
3Quantity of substance
If private variables are treated as memory-based variables, then storage limitations are avoided, but execution cycles increase due to lack of registerization
Solution Approach 1:
The patent performs preliminary buffering of data in pipeline stages before the main loop execution begins. By pre-loading data into the pipeline buffers and establishing the execution schedule in advance, the system can execute loop iterations more efficiently without frequent memory accesses, thus reducing execution cycles while maintaining adequate storage space.
Data Source
Figure 1~2A
Figure 2B
Figure 2C~2D
AI summary
Systems, apparatuses and methods may provide for technology that detects one or more local variables in source code, wherein the local variable(s) lack dependencies across iterations of a loop in the source code, automatically generate pipeline execution code for the local variable(s), and incorporate the pipeline execution code into an output of a compiler. In one example, the pipeline execution code includes an initialization of a pool of buffer storage for the local variable(s).