PredCount and SegCount Instructions for Vector Loop Dependency Resolution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing vector processing systems face challenges in vectorizing loops due to dependencies between iterations, such as loop-carried data dependencies and memory-address aliasing, which limits the extent of parallelism that can be exploited, requiring extensive manual recoding and hindering widespread adoption.

Innovation Solution

The introduction of PredCount and SegCount instructions allows for dynamic determination of parallelism at runtime, enabling processors to execute instructions that determine active elements and segment counts within vectors, thereby facilitating vectorization of loops with dependencies by executing PredCount and SegCount instructions to manage predicate vectors and segment counts, allowing for efficient parallel processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If vector processing is used to improve parallelism, then processing speed is improved, but device complexity increases due to the need for specialized vector instructions and runtime dependency management

Engineering Contradiction:
Improveprocessing speedVSAvoiddevice complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent segments the vector processing into multiple stages: dependency detection, predicate generation, and segmented execution. The SegCount instruction divides vectors into segments based on runtime dependencies, allowing parallel execution of independent segments while maintaining correctness. This segmentation approach enables vector processing speedup without requiring complete redesign of the processor architecture.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces predicate vectors as intermediary structures that mediate between dependency analysis and execution. The PredCount and SegCount instructions generate predicate vectors that control which elements of the input vector are processed in parallel. These predicates act as intermediaries that enable selective parallel execution without requiring complex hardware dependency tracking.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If manual recoding is avoided to improve ease of operation, then adoption is improved, but parallelism exploitation is limited due to unvectorizable loops

Engineering Contradiction:
Improveease of operationVSAvoidparallelism exploitation
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent enables loops to self-determine their vectorizability through runtime dependency analysis. The SegCount instruction automatically analyzes runtime dependencies and determines the appropriate segmentation without requiring manual intervention. This self-service approach allows standard loops to be automatically vectorized when safe, improving both ease of operation and parallelism exploitation.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent introduces dynamic vectorization that adapts to runtime conditions. The SegCount instruction performs runtime dependency analysis and dynamically determines which iterations can be vectorized. This dynamic approach allows the system to exploit parallelism when dependencies permit while maintaining correctness when dependencies prevent vectorization, without requiring manual recoding.

Inventive Principle:
Principle #15Dynamics

3Productivity

If runtime dependency analysis is performed to improve measurement precision of parallelism opportunities, then productivity is improved, but loss of time increases due to additional runtime overhead

Engineering Contradiction:
ImproveproductivityVSAvoidruntime overhead
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies partial dependency analysis by focusing only on the critical aspects of loop dependencies needed for safe vectorization. The SegCount instruction performs selective analysis rather than complete dependency tracking, identifying only the segments that can be safely parallelized. This partial action approach reduces runtime overhead while still capturing sufficient parallelism opportunities to improve productivity.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS9182959B2Predicate count and segment count instructions for processing vectors
Publication Date: 2015.11.10 APPLE INC
  • US9182959B2 patent drawing
  • US9182959B2 patent drawing
  • US9182959B2 patent drawing

AI summary

The described embodiments comprise a PredCount instruction and a SegCount instruction. When executed by a processor, the PredCount instruction causes the processor to analyze a predicate vector to determine a number of active elements in the predicate vector that exhibit a predetermined condition (e.g., that are set to a predetermined value) and to return a result indicating that number. When executed by a processor, the SegCount instruction causes the processor to determine a number of times that a GeneratePredicates instruction would be executed to generate a full set of predicates using active elements of an input vector.