Tensor Cache Compression for ML Inference Precision and Throughput

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning models, particularly large language models, face challenges in sharing contexts across applications due to context-specific data, and existing quantization techniques introduce errors and limit performance and precision, with hardware implementations often using A8W8 quantization schemes.

Innovation Solution

The system employs key tensor and value tensor cache compression using 16 b storage, reduces activations to 8 b or lower, and implements non-uniform compression schemes like private and shared exponents, along with smart direct memory access modifications to enhance compression and decompression efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If quantization techniques are used to reduce memory requirements, then memory usage is reduced, but quantization errors increase and precision is limited

Engineering Contradiction:
Improvememory usageVSAvoidquantization precision
Core Design Contradiction:
Quantity of substanceVSMeasurement precision

Solution Approach 1:

The patent segments the quantization process into multiple stages with different precision levels. Weights are quantized to 8-bit while activations maintain 16-bit precision during computation, and the KV cache uses 16-bit storage. This segmentation allows memory reduction in weight storage while preserving precision in computation-critical areas.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Different parts of the neural network are assigned different quantization levels based on their specific requirements. The patent applies A8W8 quantization (8-bit activations, 8-bit weights) in certain layers while maintaining 16-bit precision in the KV cache and intermediate computations, creating local quality variations that optimize both memory efficiency and precision where needed.

Inventive Principle:
Principle #3Local quality

2Quantity of substance

If A8W8 quantization scheme is used in hardware implementation, then memory requirements are reduced, but performance and precision are limited

Engineering Contradiction:
Improvememory requirementsVSAvoidcomputational performance
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent implements dynamic precision management where the system adaptively switches between different precision modes (A8W8, A16W8, A16W16) based on computational requirements. The KV cache maintains 16-bit precision dynamically during attention computations to ensure performance, while weight storage uses compressed 8-bit format, creating a dynamic balance between memory efficiency and computational performance.

Inventive Principle:
Principle #15Dynamics

3Measurement precision

If context-specific data is stored per application, then model accuracy is maintained, but model sharing between applications becomes difficult

Engineering Contradiction:
Improvemodel accuracyVSAvoidmodel shareability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent creates a universal KV cache structure that can serve multiple applications simultaneously. The system implements a shared memory architecture where the same hardware resources and cache structures are universally utilized by different applications, allowing one machine learning model to be shared across multiple applications while maintaining context-specific data through proper memory management and isolation mechanisms.

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

4Productivity

If KV cache size is increased for better performance, then model performance is improved, but memory consumption increases

Engineering Contradiction:
Improvemodel performanceVSAvoidmemory consumption
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent changes the bit-width parameter of the KV cache from the conventional 8-bit to 16-bit precision. This parameter change allows the system to maintain larger effective cache sizes within the same physical memory footprint by reducing the memory bandwidth and storage requirements per element, thereby improving model performance without proportionally increasing memory consumption.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20260003778A1Systems and methods for compressing, decompressing, and processing data for use by machine learning models
Publication Date: 2026.01.01 META PLATFORMS TECHNOLOGIES LLC
  • US20260003778A1 patent drawing
  • US20260003778A1 patent drawing
  • US20260003778A1 patent drawing

AI summary

Systems and methods for tensor cache compression and/or decompression are disclosed. An example method includes receiving a tensor or dynamically generated data. The example method includes compressing the tensor (or the dynamically generated data) by applying a compression scheme to values of the tensor (or dynamically generated data). The example method also includes storing a compressed tensor into a tensor cache (or compressed dynamically generated data into a respective cache). The example method includes reading the compressed tensor from the tensor cache (or the compressed dynamically generated data from the respective cache), and decompressing the compressed tensor (or compressed dynamically generated data) by applying a decompression scheme to values of the compressed tensor (or compressed dynamically generated data). The example method further includes forwarding a decompressed tensor (or decompressed dynamically generated data) to a compute unit.