Neural Network Code Generation via Hardware-Aware Mapping

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Deep neural network operations face inefficiencies in data loading and processing due to varying device performance and tiling methods, which affect the dimensional data division and dataflow order, leading to suboptimal performance and resource utilization.

Innovation Solution

A processor-implemented method and apparatus that generate a target mapping model based on hardware information and neural network structure, optimizing the mapping model by calculating mapping parameters, memory access size, and pruning inadequate models to maximize performance and resource utilization, thereby generating an optimized code for neural network operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If different tiling methods are used to divide dimensional data, then device performance and resource utilization may improve, but the complexity of determining optimal tiling increases

Engineering Contradiction:
Improvedevice performanceVSAvoidtiling method complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system changes parameters such as tiling dimensions, dataflow configurations, and mapping strategies to optimize neural network operation performance. By systematically varying these parameters and evaluating their impact on device performance, the system identifies optimal configurations without manually designing complex tiling methods.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The code generation apparatus automatically generates optimized codes by self-evaluating different tiling methods and mapping models. The system uses performance prediction models to assess various configurations and selects the best one autonomously, eliminating the need for external manual optimization expertise.

Inventive Principle:
Principle #25Self-service

2Productivity

If data is divided and loaded using different tiling methods, then resource utilization may improve, but the number of data reload operations increases

Engineering Contradiction:
Improveresource utilizationVSAvoiddata reload time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-calculating optimal tiling configurations and mapping models before executing neural network operations. By determining the best data division strategy in advance using performance prediction, the system minimizes redundant data reload operations during actual execution, thus reducing time loss.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses feedback from performance prediction models to evaluate different tiling methods and their impact on data reload frequency. By continuously assessing the relationship between tiling configurations and reload operations, the system selects configurations that maximize resource utilization while minimizing unnecessary data reloading.

Inventive Principle:
Principle #23Feedback

3Productivity

If mapping models are optimized based on hardware information and neural network structure, then operation performance improves, but the complexity of model selection increases

Engineering Contradiction:
Improveoperation performanceVSAvoidmodel selection complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The code generation apparatus autonomously performs model selection by evaluating multiple mapping models against hardware information and neural network structure. The system uses built-in performance prediction capabilities to automatically identify the optimal mapping model without requiring external intervention or complex manual selection processes.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system introduces an intermediate performance prediction model that mediates between hardware information, neural network structure, and mapping model selection. This intermediary component simplifies the selection process by providing performance estimates for different mapping models, enabling automated selection without direct complex analysis of all possible configurations.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20210279587A1Method and apparatus for neural network code generation
Publication Date: 2021.09.09 SAMSUNG ELECTRONICS CO LTD
  • US20210279587A1 patent drawing
  • US20210279587A1 patent drawing
  • US20210279587A1 patent drawing

AI summary

A method and an apparatus for generating a code for a neural network operation are disclosed. The method includes receiving information on hardware configured to perform a neural network operation of the neural network, generating, using a processor, a target mapping model mapping the neural network operation on processing elements available to perform the neural network operation based on the information and a structure of the neural network, and generating a code to configure the hardware to perform the neural network operation based on the target mapping model.