Floating-Point Precision Conversion With Stochastic Rounding

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In mixed-precision computing scenarios, converting high-precision data to low-precision data results in conversion errors due to rounding operations, particularly in AI training, leading to precision loss and increased hardware overheads.

Innovation Solution

A floating-point data precision conversion method that utilizes a prefix code field to indicate the bit width of the second exponent field, combined with a simple rounding mode, to balance precision and bit width, and performs rounding operations on retained coded values without additional device support, reducing hardware overheads.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Manufacturing precision

If rounding operation is performed on high-precision data during format conversion to low-precision data, then conversion from high-precision to low-precision is achieved, but conversion error occurs and mean invariance is reduced

Engineering Contradiction:
Improveconversion precisionVSAvoidmean invariance
Core Design Contradiction:
Manufacturing precisionVSMeasurement precision

Solution Approach 1:

The patent introduces a stochastic rounding mode that performs preliminary randomization on the discarded bits before final rounding. This preliminary action adds controlled randomness to the conversion process, which prevents systematic bias accumulation and maintains mean invariance across multiple conversions from high-precision to low-precision formats.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent changes the rounding parameter from deterministic to stochastic by introducing a random number generator. The rounding operation uses a probability-based approach where the rounded value depends on both the discarded bits and a random number, transforming the conversion process to maintain statistical properties like mean invariance while achieving the required precision reduction.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If complex rounding mode with additional device support is used, then rounding accuracy is improved, but hardware overhead increases

Engineering Contradiction:
Improverounding accuracyVSAvoidhardware overhead
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent introduces a random number generator as an intermediary component that feeds into the rounding operation. This intermediary provides the necessary stochastic element for accurate stochastic rounding while keeping the overall hardware architecture simple and modular, avoiding the need for complex rounding logic.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The rounding operation uses readily available components (random number generator and comparator) to achieve accurate stochastic rounding. The system serves itself by using the discarded bits in combination with a simple random number to determine the rounded value, eliminating the need for complex dedicated rounding hardware.

Inventive Principle:
Principle #25Self-service

3Productivity

If multiple conversion operations are performed in AI training, then low-precision computing efficiency is achieved, but error accumulation occurs

Engineering Contradiction:
Improvecomputing efficiencyVSAvoidtraining precision
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The stochastic rounding mode provides a feedback mechanism through its probability-based rounding behavior. By using a random number generator that produces consistent statistical properties across multiple operations, the system maintains mean invariance over time, preventing error accumulation in iterative AI training processes while preserving computing efficiency.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20250278241A1Floating-point data precision conversion method and apparatus
Publication Date: 2025.09.04 HUAWEI TECH CO LTD
  • US20250278241A1 patent drawing
  • US20250278241A1 patent drawing
  • US20250278241A1 patent drawing

AI summary

The present disclosure relates to floating-point data precision conversion methods and apparatuses. One example method includes determining a first bit width and a first coded value of the prefix code field, a first bit width and a first coded value of the second exponent field, and a first bit width of a second mantissa field based on a first coded value of a first exponent field, determining a to-be-retained coded value and a to-be-discarded coded value in a first mantissa field, where the to-be-retained coded value includes a coded value that starts from a most significant bit in the first mantissa field and whose bit width is the same as the first bit width of the second mantissa field, and performing a rounding operation on the to-be-retained coded value based on the to-be-discarded coded value to obtain a first coded value of the second mantissa field.