Tensor Shape Inference for Neural Network Resource Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Training and inferencing processes for neural networks require significant memory and computing resources, which are not efficiently utilized due to the need for explicit tensor shape specifications and manual shape constraints, leading to increased complexity and programmer effort.

Innovation Solution

A deep learning compiler that uses a tensor shape solver to infer tensor shapes automatically by replacing symbolic dimensions with specific values, reducing programmer effort and enabling efficient resource utilization through implicit shape representation and constraint-based inference.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If explicit tensor shape specifications are required, then memory and computing resources can be allocated, but programmer effort and complexity increase significantly

Engineering Contradiction:
Improveresource allocation efficiencyVSAvoidprogrammer effort
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system performs self-service by automatically inferring tensor shapes through constraint propagation and solving mechanisms. The shape inference engine autonomously determines tensor dimensions by analyzing operational constraints and data flow relationships without requiring explicit programmer specifications, thereby reducing programming complexity while maintaining resource allocation efficiency

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent applies preliminary action by performing shape inference during the compilation phase before actual execution. The compiler analyzes the computational graph, propagates shape constraints, and resolves tensor dimensions in advance, allowing the system to prepare resource allocation plans beforehand without burdening the programmer with explicit shape specifications

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If manual shape constraints are used, then tensor operations can be performed, but the process requires significant programmer effort and time

Engineering Contradiction:
Improvetensor operation executionVSAvoidprogrammer time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The shape inference system operates autonomously to determine tensor shapes by analyzing operational constraints and propagating shape information through the computational graph. This self-service mechanism eliminates the need for programmers to manually specify shapes, significantly reducing programmer time while maintaining ease of tensor operation execution

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system implements feedback mechanisms where shape information is propagated bidirectionally through the computational graph. Constraints from operations feed back to refine shape inferences, and inferred shapes feed forward to enable subsequent operations. This automated feedback loop replaces manual constraint specification, reducing programmer effort and time

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If symbolic dimensions are used, then flexibility is maintained, but resource utilization efficiency decreases

Engineering Contradiction:
Improvetensor shape flexibilityVSAvoidresource utilization efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent transforms symbolic dimension parameters into concrete values through constraint solving. The system maintains symbolic representations during analysis to preserve flexibility, then applies parameter changes by resolving these symbols to specific dimension values once constraints are satisfied, thereby achieving both adaptability and resource utilization efficiency

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The compiler performs preliminary shape resolution by analyzing constraints and determining concrete tensor shapes before code generation. This preliminary action allows the system to maintain symbolic flexibility during compilation while producing optimized code with concrete dimension values, improving resource utilization efficiency without sacrificing adaptability

Inventive Principle:
Principle #10Preliminary action

4Device complexity

If automatic shape inference is implemented, then programmer effort is reduced, but computing overhead during compilation increases

Engineering Contradiction:
Improveprogramming complexityVSAvoidcompilation computing resources
Core Design Contradiction:
Device complexityVSPower

Solution Approach 1:

The shape inference process is segmented into distinct phases: constraint extraction, constraint propagation, and constraint solving. Each phase processes a specific subset of the computational graph and constraints, dividing the overall computing workload into manageable segments. This segmentation reduces peak computing resource requirements during compilation while maintaining automatic shape inference capabilities

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20230121044A1Techniques for determining dimensions of data
Publication Date: 2023.04.20 NVIDIA CORP
  • US20230121044A1 patent drawing
  • US20230121044A1 patent drawing
  • US20230121044A1 patent drawing

AI summary

Apparatuses, systems, and techniques to determine dimensions of one or more sets of data. In at least one embodiment, a processor causes one or more dimensions of one or more sets of data to be determined using one or more dimensional constraints of the one or more sets of data.