Vector Predicate Mask Generation for Conditional Data Dependencies

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Modern processors face challenges in vectorizing code due to lexically backward loop carried data dependencies, which prevents compilers from achieving maximum performance with SIMD operations, especially in cases where data dependencies are conditionally executed and dynamic.

Innovation Solution

The introduction of instructions like vkSetTillFirstTrue and vkSetTillFirstTrueInclusive, which generate predicate masks based on vector comparisons to enable partial execution and handle data dependencies, allowing for vectorization of code with conditional checks.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If compilers attempt to vectorize code with lexically backward loop carried data dependencies, then SIMD operations can be executed, but the vectorization cannot achieve maximum performance due to conditional data dependencies

Engineering Contradiction:
Improvevectorization performanceVSAvoiddata dependency complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the vector execution into multiple parts using writemasks. Each writemask controls which elements of the vector are executed, allowing the compiler to divide the vector operation into segments that respect data dependencies while still executing in parallel where possible. This enables partial vectorization of code that would otherwise require sequential execution.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by executing only the necessary portion of vector operations. Through writemasks, the system executes vector instructions for only those elements where data dependencies are satisfied, rather than requiring full vector execution. This allows some SIMD operations to proceed while maintaining correctness for dependent elements.

Inventive Principle:
Principle #16Partial or excessive action

2Ease of operation

If writemask registers are manually managed, then precise control over element execution is achieved, but the complexity of mask management increases

Engineering Contradiction:
Improvemask management easeVSAvoidregister management complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent implements self-service by providing instructions that automatically generate appropriate writemasks based on source operands and immediate values. The processor hardware performs the mask generation operation, eliminating the need for software to manually construct and manage complex mask patterns. This reduces the burden on compilers while maintaining precise control over element-wise execution.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent applies preliminary action by pre-generating writemasks before the main vector computation. Instructions like VKSETTILLFIRSTTRUE and VKSETTILLFIRSTTRUEINCLUSIVE create the necessary masks in advance, based on control variables and dependency conditions, so that subsequent vector operations can proceed with the masks already in place, simplifying the overall control flow.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If full vector execution is performed, then maximum SIMD throughput is achieved, but elements with unmet data dependencies produce incorrect results

Engineering Contradiction:
ImproveSIMD throughputVSAvoidexecution correctness
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent uses writemasks as intermediaries between the vector execution unit and the destination register. The writemask acts as a mediator that selectively enables or disables writing of computation results to specific elements. This allows the execution unit to perform full vector operations for throughput while the writemask ensures only correct results are committed, filtering out results from elements with unmet dependencies.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent applies local quality by allowing different execution behaviors for different elements within the same vector operation. Each element can have its own execution state controlled by the writemask, enabling some elements to execute fully while others are suppressed or partially executed based on their specific data dependency requirements, all within a single SIMD instruction.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10372450B2Systems, apparatuses, and methods for setting an output mask in a destination writemask register from a source write mask register using an input writemask and immediate
Publication Date: 2019.08.06 INTEL CORP
  • US10372450B2 patent drawing
  • US10372450B2 patent drawing
  • US10372450B2 patent drawing

AI summary

Embodiments of systems, apparatuses, and methods for performing in a computer processor generation of a predicate mask based on vector comparison in response to a single instruction are described.