US 12,481,640 B2
Data type conversion method, storage medium, device, and printed circuit board
Weilun Chen, Xi'an (CN)
Assigned to CAMBRICON (XI'AN) SEMICONDUCTOR CO., LTD., Xi'an (CN)
Appl. No. 18/692,019
Filed by Cambricon (Xi'an) Semiconductor Co., Ltd., Xi'an (CN)
PCT Filed Jun. 20, 2022, PCT No. PCT/CN2022/099771
§ 371(c)(1), (2) Date Mar. 14, 2024,
PCT Pub. No. WO2023/040389, PCT Pub. Date Mar. 23, 2023.
Claims priority of application No. 202111101381.9 (CN), filed on Sep. 18, 2021.
Prior Publication US 2025/0130987 A1, Apr. 24, 2025
Int. Cl. G06F 7/00 (2006.01); G06F 7/02 (2006.01); G06F 16/00 (2019.01); G06F 16/23 (2019.01)
CPC G06F 16/2365 (2019.01) [G06F 7/02 (2013.01)] 12 Claims
OG exemplary drawing
 
1. A method for converting first input data from a first data type to a second data type to generate second input data, during training of a machine learning model, wherein the first data type comprises a first exponent bit and a first mantissa bit, the second data type comprises a second exponent bit and a second mantissa bit, and the method comprises: determining whether a number of bits of the first exponent bit is the same as a number of bits of the second exponent bit, wherein a normalized number of the first data type has a value range between 2 second interval number and first upper limit a denormalized number of the first data type has a value range between 2 second lower limit and 2 second first interval number, a normalized number of the second data type has a value range between 2 second interval number and 2 second upper limit, and a denormalized number of the second data type has a value range between 2 second lower limit and 2 second interval number, performing following steps, for the generating of the second input data, if the number of bits of the first exponent bit is the same as the number of bits of the second exponent bit: determining comparison data for a number of bit difference between the first mantissa bit and the second mantissa bit in the first mantissa bit; generating random data, wherein a number of bits of the random data is the number of bit difference; determining whether the comparison data is greater than the random data; and carrying the second mantissa bit if the comparison data is greater than the random data; performing following steps, for the generating of the second input data, if the number of bits of the first exponent bit is different from the number of bits of the second exponent bit: identifying a value interval of the first input data; setting the second mantissa bit based on the value interval; and setting the second exponent bit based on the value interval; and performing, using the second input data, one or more operations of the training of the machine learning model, wherein data type precision of the second data type is lower than data type precision of the first data type.