Branch Convergence Detection in Parallel Thread Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for determining branch convergence in program instructions fail to accurately identify convergence points, leading to inefficiencies in parallel execution of multiple threads, particularly in data processing apparatuses that execute multiple threads running the same kernel, resulting in lost parallelism and suboptimal resource utilization.
Innovation Solution
A method that identifies basic blocks with multiple execution paths and adds convergence markers to the compiled program, using an immediate post-dominator technique and a priority queue to recognize potential convergence points, ensuring that threads diverging due to different conditions can reconverge efficiently, thereby optimizing parallel execution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If threads execute in parallel lock-step to improve resource utilization, then performance is improved, but when threads diverge due to different conditions, parallelism is lost
Solution Approach 1:
The patent applies preliminary action by performing convergence analysis during the compilation phase rather than during execution. The compiler statically analyzes the control flow graph to identify potential convergence points and inserts synchronization instructions in advance, allowing threads to execute in parallel lock-step when possible while maintaining the ability to handle divergence when conditions require different execution paths.
Solution Approach 2:
The patent implements feedback by using runtime information about thread execution states to dynamically adjust parallelism. The system monitors whether threads have converged at identified convergence points and uses this feedback to determine when to resume lock-step parallel execution versus when to allow independent thread execution, thus adapting the degree of parallelism based on actual runtime conditions.
2Reliability
If synchronization points are inserted to synchronize divergent threads for SIMD processing, then proper execution is ensured, but execution efficiency is reduced due to waiting
Solution Approach 1:
The patent performs preliminary convergence analysis during compilation to identify optimal synchronization points before execution. By statically analyzing the control flow graph and determining where threads are guaranteed to converge, the system inserts synchronization instructions only where necessary, avoiding unnecessary waiting and maintaining execution efficiency while ensuring proper synchronization where required.
Solution Approach 2:
The patent applies local quality by making synchronization behavior selective rather than universal. Instead of synchronizing all threads at all points, the system identifies specific convergence points where synchronization is needed and applies it only locally at those points. This allows threads to execute independently in regions where divergence is expected, minimizing waiting time while ensuring proper execution at critical synchronization points.
3Productivity
If existing methods determine branch convergence, then some convergence points are identified, but convergence points are missed leading to suboptimal parallel execution
Solution Approach 1:
The patent segments the program into basic blocks and constructs a detailed control flow graph to analyze thread convergence. By breaking down the program structure into discrete basic blocks with single entry and exit points, the system can systematically track all possible execution paths and identify convergence points with higher precision than existing methods, ensuring no convergence points are missed and maximizing parallel execution opportunities.
Data Source
Figure 1
Figure 2
Figure 3A~3C
AI summary
A method of compiling a sequence of program instructions, a method of parallel execution of a sequence of program instructions and apparatuses and software supporting such methods are disclosed. The sequence of program instructions is analysed in terms of basic blocks forming a control flow graph and execution paths through that control flow graph are identified. When more than one execution path leads to a given basic block, or when a loop path is found leading from a given basic block back to the same basic block, a potential convergence point may be identified. A convergence marker is added to the computer program associated with the basic blocks identified in this way and then when the program is executed, the convergence markers found are used to trigger a determination of a subset of the multiple execution threads which are executed following that convergence marker.