Tensor Reshape and Broadcast Optimization for Reduced Data Movement

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing machine learning models using TensorFlow and XLA compilers face inefficiencies due to unnecessary data movement caused by reshape operations, particularly in group and ghost batch normalization techniques, leading to increased memory burden and computational overhead.

Innovation Solution

Implement compiler optimizations in the XLA compiler to transform patterns of reshape, reduce, and broadcast operations, reducing the size of reshapes and aligning tensors with vector memory requirements, thereby minimizing data movement.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If reshape operations are used to transform tensor shapes in group and ghost batch normalization, then the models can be implemented, but unnecessary data movement occurs increasing memory burden and computational overhead

Engineering Contradiction:
Improvemodel implementation capabilityVSAvoiddata movement volume
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent combines multiple reshape operations into a single reshape operation by merging consecutive dimension transformations. When a tensor undergoes multiple reshape operations in sequence, the compiler merges these into one operation with a composite shape transformation, thereby reducing the number of times data is copied and moved in memory.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The compiler performs preliminary analysis of the computation graph to identify and optimize reshape operation patterns before execution. By pre-computing the optimal reshaping strategy and merging operations, the system avoids unnecessary data movement during actual model execution, reducing memory burden and computational overhead.

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If multiple reshape operations are applied sequentially, then the desired tensor transformations are achieved, but computational overhead increases due to repeated data movement

Engineering Contradiction:
Improvetensor shape transformation accuracyVSAvoidcomputational efficiency
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent merges multiple sequential reshape operations into a single operation that achieves the same dimensional transformation. Instead of applying reshape A then reshape B, the system computes the composite transformation and applies it in one operation, maintaining the required tensor shape accuracy while reducing computational overhead from repeated data movements.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The optimization maintains continuous and efficient data flow by eliminating interruptions caused by multiple sequential reshape operations. By consolidating these operations, the system ensures uninterrupted computational processing, improving productivity while preserving the precise tensor shape transformations needed for model correctness.

Inventive Principle:
Principle #20Continuity of useful action

3Speed

If tensors are reshaped to match vector memory alignment requirements, then hardware performance improves, but data movement is required increasing memory burden

Engineering Contradiction:
Improvevector instruction execution speedVSAvoiddata movement volume
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The compiler performs preliminary analysis to determine the optimal reshape operations that will align tensor data with vector memory requirements before execution. By pre-computing the correct reshaping strategy, the system ensures data is already in the proper alignment and format when executed, improving vector instruction speed without requiring additional data movement during execution.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The optimization changes the parameters of reshape operations to specifically target vector memory alignment. By adjusting the output shape parameters of reshape operations, the system transforms tensors into formats that naturally align with vector memory boundaries, enabling faster vector instructions without requiring additional data movement or copying operations.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20260105367A1Reshape and broadcast optimizations to avoid unnecessary data movement
Publication Date: 2026.04.16 GOOGLE LLC
  • US20260105367A1 patent drawing
  • US20260105367A1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for transforming patterns of operations on tensors in a computational graph to reduce the memory burden incurred when reshape operations are performed, in particular when deployed to hardware platforms that have vector instructions or vector memory requiring alignment of operands.