ARMv8 Microkernel for Binary Ternary Matrix Multiplication

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current CPU-oriented algorithms for ternary and ternary-binary convolution and matrix multiplication are not computationally efficient, limiting the recognition quality and performance of neural networks on mobile devices.

Innovation Solution

The implementation of microkernels on ARMv8 processors for binary, ternary, and ternary-binary matrix multiplication using two-bit encoding for ternary values and one-bit encoding for binary values, leveraging SIMD instructions and specific ARM architecture operations to perform efficient matrix multiplication.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If GeMM-based algorithms are used for matrix multiplication on CPU, then computational efficiency is improved, but memory overhead increases due to im2col transformation

Engineering Contradiction:
Improvecomputational efficiencyVSAvoidmemory overhead
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments the matrix multiplication process into microkernels that operate on small blocks of data (e.g., 4x4 or 8x8 blocks). This segmentation allows processing data in chunks that fit within cache memory, eliminating the need for large intermediate matrices required by im2col transformation while maintaining computational efficiency through block-wise operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transforms the traditional GeMM approach by introducing a new dimension of processing through SIMD vectorization. Instead of processing scalar values sequentially, the invention processes multiple data elements simultaneously in parallel lanes, effectively adding a dimension of parallelism that reduces memory access requirements while maintaining high throughput.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Productivity

If binary quantization is used to reduce memory footprint, then speed and memory efficiency are improved, but recognition quality drops significantly

Engineering Contradiction:
Improveinference speedVSAvoidrecognition quality
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent applies different quantization strategies to different parts of the neural network based on their importance and sensitivity to quantization error. Critical layers maintain higher precision while less sensitive layers use aggressive binarization, allowing the system to achieve high speed with minimal quality loss by optimizing local quality requirements for different network components.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent creates a composite quantization scheme that combines binary weights with higher-precision activations or vice versa. This composite approach allows the network to benefit from the speed of binary operations while maintaining sufficient precision through the higher-bit components, achieving a balance between inference speed and recognition quality.

Inventive Principle:
Principle #40Composite materials

3Measurement precision

If ternary quantization is used instead of binary, then recognition quality is improved, but computational complexity increases

Engineering Contradiction:
Improverecognition qualityVSAvoidcomputational complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent extracts the computationally intensive parts of ternary operations and replaces them with optimized sequences of binary operations. By taking out the complex ternary multiplication and replacement logic, the invention uses a series of simpler binary XOR and population count operations that achieve the same result with lower computational complexity and better hardware utilization.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent substitutes traditional ternary arithmetic operations with bitwise logical operations and population count instructions native to ARM processors. This substitution replaces complex mechanical arithmetic with simpler bitwise operations that leverage the processor's existing instruction set, reducing computational complexity while maintaining ternary functionality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

4Adaptability or versatility

If standard ARM instructions are used for matrix multiplication, then compatibility is maintained, but computational performance is insufficient for real-time inference

Engineering Contradiction:
Improveprocessor compatibilityVSAvoidinference throughput
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent implements dynamic instruction selection that adapts to the available processor features. The system detects whether SIMD extensions or specialized instructions are available and dynamically chooses the appropriate instruction set, allowing the same software to achieve high performance on capable processors while maintaining compatibility with standard ARM processors through fallback to basic instructions.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent creates a universal matrix multiplication implementation that works across different ARM processor variants. By designing microkernels that can operate with both standard ARM instructions and optimized SIMD instructions, the invention achieves multi-functionality that maintains broad compatibility while delivering high performance when advanced instructions are available.

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

Data Source

PatentUS20240054180A1Fast matrix multiplication for binary and ternary convolutional neural networks on arm central processing unit
Publication Date: 2024.02.15 SMART ENGINES SERVICE LLC
  • US20240054180A1 patent drawing
  • US20240054180A1 patent drawing
  • US20240054180A1 patent drawing

AI summary

No computationally efficient CPU-oriented algorithms of ternary and ternary-binary convolution and/or matrix multiplication are available. Accordingly, a microkernel is disclosed for high-performance matrix multiplication of binary, ternary, and ternary-binary matrices for central processing units (CPUs) with the Advanced Reduced Instruction Set Computer (RISC) Machine (ARM) v8 architecture.