Multithread Code Translation via Work-Item Coalescing Loops

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing multithread program translation methods for heterogeneous processing platforms face inefficiencies due to the need for serial execution of work items across a limited number of processing elements, leading to increased instruction overhead and reduced parallelism.

Innovation Solution

The method involves work item serialization by enclosing kernel code with work-item coalescing loops, dividing the code into statements based on synchronization points, and generating loop groups to ensure balanced instruction distribution across work groups, thereby optimizing execution on processors with a small number of processing elements.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If work items are serialized and executed on a limited number of processing elements, then the program can run on devices with fewer processing elements, but the instruction overhead increases and parallelism decreases

Engineering Contradiction:
Improvecompatibility with limited processing elementsVSAvoidparallelism and execution efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The kernel code is divided into multiple statements based on synchronization points (barrier functions). Each statement is then enclosed by work-item coalescing loops that serialize work items within that statement. This segmentation allows different statements to be executed in parallel across different processing elements, while maintaining serialization within each statement to ensure proper synchronization. The division into statements based on barrier functions creates natural parallelism opportunities between statements while maintaining correctness within statements.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If work-item coalescing loops are added to enclose kernel code, then execution on processors with small number of processing elements is enabled, but the number of iterative statements increases

Engineering Contradiction:
Improveexecution capability on limited processing elementsVSAvoidnumber of iterative statements and instruction overhead
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The kernel code is divided into multiple statements based on synchronization points (barrier functions). Each statement is then enclosed by work-item coalescing loops that serialize work items within that statement. This segmentation allows different statements to be executed in parallel across different processing elements, while maintaining serialization within each statement to ensure proper synchronization. The division into statements based on barrier functions creates natural parallelism opportunities between statements while maintaining correctness within statements.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The translation process performs preliminary analysis to identify synchronization points (barrier functions) in the kernel code before generating the translated code. Based on this analysis, the code is pre-divided into statements and appropriate work-item coalescing loops are inserted. This preliminary action optimizes the structure before execution, reducing the need for additional runtime overhead and minimizing the number of iterative statements required.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If statements are divided based on synchronization points and loop groups are generated, then balanced instruction distribution is achieved, but the translation process complexity increases

Engineering Contradiction:
Improveinstruction distribution balance and execution efficiencyVSAvoidtranslation process complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The translation process performs preliminary analysis to identify synchronization points (barrier functions) in the kernel code before generating the translated code. Based on this analysis, the code is pre-divided into statements and appropriate work-item coalescing loops are inserted. This preliminary action optimizes the structure before execution, reducing the need for additional runtime overhead and minimizing the number of iterative statements required.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The translation process analyzes the kernel code to identify synchronization points and uses this information to dynamically determine how to divide the code into statements and generate loop groups. This feedback-driven approach ensures that the translation adapts to the specific structure of the input code, achieving balanced instruction distribution while managing translation complexity through intelligent analysis rather than rigid rules.

Inventive Principle:
Principle #23Feedback

Data Source

PatentEP2799986B1Apparatus and method for translating multithread program code
Publication Date: 2020.01.22 SAMSUNG ELECTRONICS CO LTD
  • EP2799986B1 patent drawingFigure 1
  • EP2799986B1 patent drawingFigure 2A
  • EP2799986B1 patent drawingFigure 2B

AI summary

A method and apparatus for translating a multithread program code are provided. The method includes: dividing a multithread program code into a plurality of statements according to a synchronization point; generating at least one loop group by combining one or more adjacent statements based on a number of instructions included in the plurality of statements; expanding or renaming variables in each of the plurality of statements so that each statement included in the at least one loop group is executed with respect to a work item of a different work group; and enclosing each of the generated at least one loop group respectively with a work item coalescing loop.