Deep Learning Compiler Kernel Fusion for Neural Network Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Training and inferencing using neural networks require significant memory and computing resources, which can be inefficiently utilized in existing systems.

Innovation Solution

A deep learning compiler that combines operations such as reduction, elementwise, and copy operations into a single software kernel, optimizing resource usage by generating a schedule that groups dependent reduction operations and rewrites higher-level operations into more efficient forms, such as reshape and sum reduction operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of energy

If operations are performed separately in existing systems, then implementation simplicity is maintained, but memory and computing resource usage increases

Engineering Contradiction:
Improvecomputing resource usageVSAvoidoperation combination complexity
Core Design Contradiction:
Loss of energyVSDevice complexity

Solution Approach 1:

The patent combines multiple independent operations (reduction operations, elementwise operations, and copy operations) into a single unified software kernel. This merging eliminates redundant memory accesses and computing operations by performing all operations in one executed kernel, directly reducing computing resource usage and memory bandwidth requirements.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The unified software kernel serves multiple functions simultaneously - it performs reduction operations, elementwise operations, and copy operations within a single execution context. This multi-functionality allows the same kernel to handle diverse computational tasks without requiring separate specialized kernels for each operation type.

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

2Quantity of substance

If multiple separate operations are executed, then operational flexibility is maintained, but memory bandwidth and computing resources increase

Engineering Contradiction:
Improvememory usageVSAvoidoperation flexibility
Core Design Contradiction:
Quantity of substanceVSAdaptability or versatility

Solution Approach 1:

By merging reduction, elementwise, and copy operations into a single kernel, the patent reduces the total quantity of memory operations. Intermediate results are kept in registers or shared memory within the kernel rather than being written to and read from global memory multiple times, thereby reducing overall memory usage and bandwidth requirements.

Inventive Principle:
Principle #5Merging (Combining)

3Productivity

If operations are performed independently, then ease of implementation is maintained, but training and inferencing efficiency decreases

Engineering Contradiction:
Improvetraining and inferencing efficiencyVSAvoidcompiler optimization complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The deep learning compiler performs preliminary analysis and optimization of operation schedules before kernel generation. It identifies opportunities to combine operations and reorders them for optimal performance, preparing the operation graph in advance so that the resulting unified kernel executes efficiently during training and inferencing without requiring complex runtime decisions.

Inventive Principle:
Principle #10Preliminary action

4Loss of energy

If higher-level operations are used directly, then programming simplicity is maintained, but resource efficiency decreases

Engineering Contradiction:
Improvecomputing resource efficiencyVSAvoidoperation rewriting complexity
Core Design Contradiction:
Loss of energyVSDevice complexity

Solution Approach 1:

The compiler transforms higher-level operations into more efficient lower-level operations by changing their computational parameters and representation. For example, it rewrites matrix operations into optimized tensor operations with specific stride and tiling parameters, and converts high-level reduction operations into efficient GPU reduction primitives, thereby improving resource efficiency while maintaining the same mathematical functionality.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20220350683A1Techniques for combining operations
Publication Date: 2022.11.03 NVIDIA CORP
  • US20220350683A1 patent drawing
  • US20220350683A1 patent drawing
  • US20220350683A1 patent drawing

AI summary

Apparatuses, systems, and techniques to combine operations. In at least one embodiment, a processor causes two or more dependent reduction operations to be combined into a software kernel.