SIMD Instruction Generation via Tensor Loop Dimension Matching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing process of converting an input tensor formula into an SIMD instruction relies on brute-force search, which is inefficient due to large value spaces, resulting in a lengthy process and low efficiency in generating matching SIMD instructions.
Innovation Solution
An SIMD instruction generation method that selects a second SIMD instruction model based on the length of each loop dimension of a tensor formula, generating a parameter value to convert the tensor formula into an SIMD instruction, thereby improving efficiency by matching the tensor formula with pre-generated information about SIMD instruction models.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If brute-force search is used to convert tensor formula into SIMD instruction, then all possible parameter combinations can be enumerated, but the generation time becomes excessively long and efficiency is low
Solution Approach 1:
The patent pre-generates multiple groups of SIMD instruction model information before actual conversion needs occur. Each group contains constraint conditions for different loop dimension lengths. When conversion is needed, the system directly queries these pre-generated models instead of performing brute-force search, dramatically reducing generation time while maintaining completeness.
Solution Approach 2:
The system pre-classifies SIMD instruction models according to different loop dimension length constraints and stores them in a queryable format. This preliminary organization allows rapid matching during actual conversion without re-enumerating all parameter combinations, resolving the contradiction between comprehensive search and fast generation.
2Reliability
If brute-force search enumerates all parameter combinations, then matching SIMD instructions can be found, but computational resources and processing complexity increase significantly
Solution Approach 1:
The patent segments the large parameter space by classifying SIMD instruction models according to loop dimension length constraints. Instead of searching through all possible parameter combinations, the system divides models into groups based on specific constraint conditions (e.g., loop dimension lengths of 16, 32, 64, etc.), making the search process manageable and efficient.
Solution Approach 2:
The system changes the approach from searching parameter values to querying pre-classified model groups based on constraint conditions. By transforming the search key from generic parameter enumeration to specific constraint-based queries (loop dimension lengths), the system reduces computational complexity while maintaining matching accuracy.
Data Source
AI summary
An SIMD instruction generation and processing method and a related device are provided. The method may include: obtaining a length of each loop dimension of a first tensor formula; selecting, from a plurality of groups of information about a first SIMD instruction model based on the length of each loop dimension of a first tensor formula, information about a second SIMD instruction model matching the first tensor formula; generating, based on a length of at least one loop dimension of the first tensor formula and the second SIMD instruction model, a first SIMD instruction obtained after the first tensor formula is converted. The information about a second SIMD instruction model is selected from the plurality of groups of information about a first SIMD instruction model based on the length of each loop dimension of the tensor formula.


