Transformer Attention Acceleration via Tensor Grouping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning models, particularly transformer models, face challenges in efficiently processing large datasets due to the computational expense of tensor multiplications, leading to high latency, power usage, and heat generation.

Innovation Solution

The proposed system optimizes attention calculations by identifying tensor dimensions based on the characteristics of a tensor multiplication engine, grouping query and key data into tensors with these dimensions, and performing tensor multiplications using the engine to generate output data.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If tensor multiplications are performed using standard machine learning models, then computational accuracy is maintained, but computational expense, latency, and power usage increase significantly

Engineering Contradiction:
Improvecomputational efficiencyVSAvoidpower usage
Core Design Contradiction:
ProductivityVSUse of energy by moving object

Solution Approach 1:

The patent applies parameter changes by identifying and utilizing specific tensor dimension parameters that match the capabilities of the tensor multiplication engine. By transforming the attention calculation parameters (tensor dimensions) to align with the engine's optimal performance characteristics, the system achieves higher computational efficiency and lower power consumption without sacrificing accuracy.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent creates an optimized copy of the attention calculation process that is specifically tailored for the tensor multiplication engine. Instead of directly executing standard transformer attention calculations, the system creates a customized computation path that copies and adapts the necessary operations to match the engine's strengths, thereby reducing computational expense and power usage.

Inventive Principle:
Principle #26Copying

2Quantity of substance

If large tensor multiplications are performed to process large datasets, then processing completeness is maintained, but heat generation and resource requirements increase

Engineering Contradiction:
Improvedata processing capacityVSAvoidheat generation
Core Design Contradiction:
Quantity of substanceVSObject-generated harmful factors

Solution Approach 1:

The patent applies segmentation by breaking down large tensor multiplication tasks into smaller, more manageable segments that align with the tensor multiplication engine's optimal processing units. By segmenting the computation into discrete tensor blocks that match the engine's capabilities, the system processes large datasets efficiently while minimizing heat generation through optimized resource utilization.

Inventive Principle:
Principle #1Segmentation

3Reliability

If standard attention calculations are used in transformer models, then model accuracy is maintained, but latency and computational resources increase

Engineering Contradiction:
Improvemodel accuracyVSAvoidlatency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by pre-identifying the optimal tensor dimensions and characteristics of the target tensor multiplication engine before executing attention calculations. This preliminary analysis allows the system to configure the computation in advance to match the engine's capabilities, thereby reducing execution latency while maintaining model accuracy without requiring trial-and-error adjustments during runtime.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20250124103A1Systems and methods for transformer attention acceleration based on tensor grouping
Publication Date: 2025.04.17 QUALCOMM INC
  • US20250124103A1 patent drawing
  • US20250124103A1 patent drawing
  • US20250124103A1 patent drawing

AI summary

Systems and techniques for attention calculation optimization are described. An attention calculation system identifies tensor dimensions based on a characteristic of a tensor multiplication engine. In some examples, the tensor dimensions are matrix dimensions, for instance if the characteristic indicates that the tensor multiplication engine is optimized for matrix multiplication. The attention calculation system groups at least a subset of query data into at least one query tensor having the tensor dimensions. The attention calculation system groups at least a subset of key data into at least one key tensor having the tensor dimensions. The attention calculation system determines, using the tensor multiplication engine, a tensor multiplication including the at least one query tensor and the at least one key tensor to generate output data.