Runtime Profitability Control for Speculative Parallelization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for parallelizing programs on multi-core chips are inefficient due to conservative compiler approaches that fail to identify loops without inter-loop data dependences, leading to uncontrolled parallelization overheads that can harm performance.

Innovation Solution

A method for speculative parallelization that analyzes source code to identify candidate loops for parallelization, determines profitability based on overhead vs. speedup, and dynamically selects between parallelized and non-parallelized versions during execution, adjusting for transaction failures and resource limitations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If speculative parallelization is applied to loops, then execution speedup may be achieved, but parallelization overhead may harm performance

Engineering Contradiction:
Improveexecution speedupVSAvoidparallelization overhead
Core Design Contradiction:
SpeedVSLoss of energy

Solution Approach 1:

The system dynamically determines at runtime whether to execute loops in parallel or sequential mode based on actual performance measurements. The compiler generates both parallel and sequential versions of candidate loops, and the runtime system selects the optimal version based on measured execution times, making the parallelization strategy adaptive rather than static.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the execution parameter (parallel vs. sequential) based on measured performance characteristics. By monitoring execution times and transaction failure counts, the system adjusts the parallelization state to optimize performance, transitioning between different execution modes as conditions change.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If compiler parallelizes loops conservatively, then correctness is ensured, but potential speedup is lost due to missed parallelization opportunities

Engineering Contradiction:
ImprovecorrectnessVSAvoidpotential speedup
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The compiler performs preliminary analysis to identify candidate loops for parallelization and generates both parallel and sequential versions. The runtime system then performs preliminary measurements to determine which version should be executed, allowing the system to explore parallelization opportunities without compromising correctness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system incorporates feedback mechanisms that monitor execution performance, transaction failure counts, and runtime characteristics. This feedback is used to dynamically adjust parallelization decisions, allowing the system to learn from actual execution behavior and improve its parallelization strategy over time.

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If both parallelized and non-parallelized versions are generated, then dynamic selection is enabled, but code complexity increases

Engineering Contradiction:
Improvedynamic selection capabilityVSAvoidcode complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system extracts the decision-making logic for parallelization selection into a separate runtime mechanism. The compiler generates candidate versions but delegates the actual selection to the runtime system based on measured performance characteristics, separating compilation-time analysis from runtime decision-making.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The runtime system acts as an intermediary between the compiled code and execution. It measures performance characteristics, determines optimal execution modes, and controls which version (parallel or sequential) should be executed, mediating the complexity between compiler analysis and actual program execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8359587B2Runtime profitability control for speculative automatic parallelization
Publication Date: 2013.01.22 ORACLE AMERICAN INC
  • US8359587B2 patent drawing
  • US8359587B2 patent drawing
  • US8359587B2 patent drawing

AI summary

A compilation method and mechanism for parallelizing program code. A method for compilation includes analyzing source code and identifying candidate code for parallelization. The method includes parallelizing the candidate code, in response to determining said profitability meets a predetermined criteria; and generating object code corresponding to the source code. The generated object code includes both a non-parallelized version of the candidate code and a parallelized version of the candidate code. During execution of the object code, a dynamic selection between execution of the non-parallelized version of the candidate code and the parallelized version of the candidate code is made. Changing execution from said parallelized version of the candidate code to the non-parallelized version of the candidate code, may be in response to determining a transaction failure count meets a pre-determined threshold. Additionally, changing execution from one version to the other may be in further response to determining an execution time of the parallelized version of the candidate code is greater than an execution time of the non-parallelized version of the candidate code.