ARMv8 Microkernel for Binary Ternary Matrix Multiplication
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Productivity
If binary quantization is used to reduce memory footprint, then speed and memory efficiency are improved, but recognition quality drops significantly
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.
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.
3Measurement precision
If ternary quantization is used instead of binary, then recognition quality is improved, but computational complexity increases
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.
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.
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
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.
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.
Data Source
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.


