Neural Network Memory Layout Conversion with Fewer Transposes

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Converting neural networks between different memory layouts, such as channel-first and channel-last formats, results in additional transposes that increase latency and degrade model performance due to inefficient resource utilization.

Innovation Solution

A method and system for converting neural networks by minimizing additional transposes through topological traversal and maintaining maps of memory layouts, allowing efficient conversion between different memory formats.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If layout conversions using additional transposes are performed to convert neural networks between different deep learning frameworks, then semantic correctness is achieved, but execution latency increases and model performance degrades

Engineering Contradiction:
Improvesemantic correctnessVSAvoidexecution latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by performing layout conversion at model compilation or deployment time rather than during execution. The conversion graph is built in advance, mapping source layout operations to target layout operations, so that the actual conversion is already prepared and can be executed efficiently during inference without adding runtime latency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces an intermediary conversion graph that acts as a mediator between the source neural network model and the target framework. This conversion graph contains intermediate operations that translate operations from one memory layout to another, allowing the system to bridge different frameworks (e.g., TensorFlow to PyTorch) without requiring direct conversion, thus maintaining semantic correctness while enabling efficient execution.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Adaptability or versatility

If additional transposes are performed during memory layout conversion, then framework compatibility is achieved, but resource utilization becomes inefficient

Engineering Contradiction:
Improveframework compatibilityVSAvoidresource efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies parameter changes by dynamically adjusting the memory layout parameters (channel-first vs. channel-last) based on the target framework requirements. The conversion graph allows the system to change layout parameters systematically across different frameworks, achieving broad compatibility while optimizing resource usage by selecting appropriate layout configurations for each framework rather than using fixed conversion patterns.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If conventional layout conversion methods are used, then framework interoperability is enabled, but computational overhead increases

Engineering Contradiction:
Improveframework interoperabilityVSAvoidcomputational overhead
Core Design Contradiction:
Adaptability or versatilityVSUse of energy by moving object

Solution Approach 1:

The patent reduces computational overhead by performing the expensive layout conversion operations in advance during model compilation or deployment. The conversion graph is constructed beforehand, identifying all necessary transpose operations and their dependencies, so that during actual model execution, the conversions are already optimized and can be performed with minimal additional computational overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent ensures continuity of useful action by integrating layout conversion operations seamlessly into the model execution pipeline. Rather than performing conversions as separate, discrete steps that interrupt computation, the conversion operations are embedded within the computational graph itself, allowing the system to maintain continuous computation flow with minimal interruptions, thus reducing overall computational overhead.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS20250292068A1Conversion of neural networks between different memory layouts
Publication Date: 2025.09.18 QUALCOMM INC
  • US20250292068A1 patent drawing
  • US20250292068A1 patent drawing
  • US20250292068A1 patent drawing

AI summary

Certain aspects of the present disclosure provide methods and apparatuses for machine learning model conversion. An example method generally includes receiving a request to execute operations using a source model including a plurality of source model tensors with a first memory layout. A plurality of target model tensors are generated, with each respective target model tensor being associated with a respective source model tensor. The source model is converted from a source architecture associated with the first memory layout to a target architecture associated with a second memory layout on a per-tensor basis based on a type of a machine learning model layer associated with each source model tensor. A model output is generated, and a converted model is generated based on the plurality of target model tensors and the generated model output. Operations are executed using the converted model.