Dynamic MAC Scheduler for AI Engine Utilization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The static mappings between layers of a neural network model and MAC units in AI engines lead to low utilization of MAC units, resulting in idle resources due to non-multiple MAC requirements, sparsity, and latency in data or instruction fetch, which affects the performance of AI engines.

Innovation Solution

Implementing a dynamic scheduling mechanism using an O(1) scheduler that maintains status information of MAC units through a bit array, allowing for the allocation of idle MAC units to process feature map slices based on availability, and utilizing linked lists to efficiently manage feature map slices and weights without physical partitioning of SRAM.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If static mappings are used between layers and MAC units, then the mapping is simple and deterministic, but MAC unit utilization is low due to idle resources

Engineering Contradiction:
ImproveMAC unit utilizationVSAvoidscheduling mechanism complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent implements dynamic scheduling that allows MAC units to be reassigned to different feature map slices based on real-time availability and workload, transforming the static mapping into a dynamic allocation system that adapts to varying computational demands and improves resource utilization

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent introduces a scheduler as an intermediary component that manages the allocation between feature map slices and MAC units, using data structures like bit arrays and linked lists to coordinate resource distribution and resolve the contradiction between simple mapping and high utilization

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If the number of MACs required is not a multiple of total MAC units, then some MACs become idle, but increasing MAC units increases hardware cost

Engineering Contradiction:
ImproveMAC unit utilizationVSAvoidnumber of MAC units
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent makes MAC units universal by allowing them to process different feature map slices from different layers through dynamic scheduling, enabling the same set of MAC units to handle variable workload requirements without needing additional hardware for each specific case

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

3Adaptability or versatility

If static mappings are used, then resource allocation is deterministic, but MAC units cannot adapt to sparsity and latency variations

Engineering Contradiction:
Improveadaptability to sparsity and latencyVSAvoididle time due to latency
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent implements feedback mechanisms where the scheduler monitors MAC unit completion status and dynamically reallocates idle MAC units to pending feature map slices, creating a closed-loop system that adapts to sparsity patterns and latency variations in real-time

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11562214B2Methods for improving AI engine MAC utilization
Publication Date: 2023.01.24 BAIDU USA LLC
  • US11562214B2 patent drawing
  • US11562214B2 patent drawing
  • US11562214B2 patent drawing

AI summary

Embodiments of the invention disclose an integrated circuit and a method for improving utilization of multiply and accumulate (MAC) units on the integrated circuit in an artificial intelligence (AI) engine. In one embodiment, the integrated circuit can include a scheduler for allocating the MAC units to execute a neural network model deployed on the AI engine to process input data. The scheduler includes status information for the MAC units, and can select one or more idle MAC units based on the status information for use to process the feature map slice. The integrated circuit can dynamically map idle MAC units to an input feature map, thereby improving utilization of the MAC units. A pair of linked list, each with a reference head, can be provided in a static random access memory (SRAM) to store only feature map slices and weights for a layer that is currently being processed. When processing a next layer, the two reference heads can be swapped so that output feature map slices for the current layer can be used as input feature maps for the next layer.