Tensor Preprocessing for Efficient Parallel Code Generation
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Manufacturing precision
If custom coding is used for each hardware platform, then platform-specific optimization is improved, but portability across platforms deteriorates
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.
3Productivity
If preprocessing transformations are applied during compilation, then code optimization is improved, but compilation complexity deteriorates
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.
Data Source
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.


