Tensor Preprocessing for Efficient Parallel Code Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The compilation of machine learning and cognitive network applications for parallel processing hardware platforms is challenging due to compilers' inability to recognize and optimize parallelism, leading to inefficient code generation and a reluctance to port applications across platforms.

Innovation Solution

The approach involves cross-compiling to an intermediate language called TILE, followed by preprocessing operations such as output reduction and fraction removal to optimize code generation, enabling more efficient compilation and flexible targeting of multiple hardware platforms.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If compilers are used to generate code for parallel processing hardware platforms, then code generation automation is improved, but the ability to recognize and optimize parallelism deteriorates

Engineering Contradiction:
Improvecode generation automationVSAvoidparallelism optimization
Core Design Contradiction:
Extent of automationVSProductivity

Solution Approach 1:

The compilation process is divided into multiple passes: a first pass that performs preprocessing transformations on tensor operations, and a second pass that generates optimized parallel code. This segmentation allows each pass to focus on specific optimization tasks, resolving the contradiction between automation and parallelism optimization.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies preprocessing transformations to tensor operations before the main code generation process. By performing preliminary actions on the source code (such as optimizing tensor contractions and identifying parallel computation opportunities), the compiler can generate more efficient parallel code in the subsequent pass, thus improving both automation and parallelism optimization.

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If custom coding is used for each hardware platform, then platform-specific optimization is improved, but portability across platforms deteriorates

Engineering Contradiction:
Improveplatform-specific optimizationVSAvoidportability
Core Design Contradiction:
Manufacturing precisionVSAdaptability or versatility

Solution Approach 1:

The patent introduces a platform-agnostic intermediate representation that can target multiple hardware platforms. The preprocessing transformations are designed to be universally applicable across different platforms, allowing the same optimized code to be deployed on various parallel processing hardware while maintaining platform-specific optimization through the intermediate representation.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Productivity

If preprocessing transformations are applied during compilation, then code optimization is improved, but compilation complexity deteriorates

Engineering Contradiction:
Improvecode optimizationVSAvoidcompilation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The compilation process is divided into multiple passes: a first pass that performs preprocessing transformations on tensor operations, and a second pass that generates optimized parallel code. This segmentation allows each pass to focus on specific optimization tasks, resolving the contradiction between automation and parallelism optimization.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10592213B2Preprocessing tensor operations for optimal compilation
Publication Date: 2020.03.17 INTEL CORP
  • US10592213B2 patent drawing
  • US10592213B2 patent drawing
  • US10592213B2 patent drawing

AI summary

Techniques to preprocess tensor operations prior to code generation to optimize compilation are disclosed. A computer readable representation of a linear algebra or tensor operation is received. A code transformation software component performs transformations include output reduction and fraction removal. The result is a set of linear equations of a single variable with integer coefficients. Such a set lends itself to more efficient code generation during compilation by a code generation software component. Use cases disclosed include targeting a machine learning hardware accelerator, receiving code in the form of an intermediate language generated by a cross-compiler with multiple front ends supporting multiple programming languages, and cloud deployment and execution scenarios.