Method and device for splitting operators, and storage medium
AssigneeMontage Technology Co., Ltd.
InventorsMi Yang, Yu Cai
Life of this patent
Estimating the term…
Abstract
A method for splitting operators, a device for splitting operators and a non-transitory computer readable storage medium are provided. The method includes: S1: obtaining buffer information required by target operators; and S2: splitting the target operators to obtain a splitting result of the target operators, and obtaining a storage layout of the target operators in the first memory, based on the buffer information required by the target operators and a storage capacity of the first memory; the splitting result of the target operators and the storage layout of the target operators are used to implement a mapping of a target artificial intelligence model to an artificial intelligence hardware accelerator.
Claims15
A method for splitting operators, wherein the method is applied to a compilation stage of an artificial intelligence hardware accelerator, the artificial intelligence hardware accelerator comprises a first memory, and the method comprises:
- S1:
- obtaining buffer information required by target operators;
- and
- S2:
- splitting the target operators to obtain a splitting result of the target operators and obtaining a storage layout of the target operators in the first memory, based on the buffer information required by the target operators and a storage capacity of the first memory;
- wherein the splitting result of the target operators and the storage layout of the target operators are used to implement a mapping of a target artificial intelligence model to the artificial intelligence hardware accelerator;
- wherein S2 further comprises:
- S21:
- splitting data to be split of the target operators in one or more target dimensions so as to obtain a splitting result of the data to be split;
- and
- S22:
- obtaining the storage layout of the target operators in the first memory based on the splitting result of the data to be split;
- wherein the data to be split comprises input data, weight data, and output data of the target operators, and S21 further comprises:
- S211:
- configuring a first storage space in the first memory for the output data;
- and
- S212A:
- if the first storage space is not successfully configured, splitting the weight data in a first target dimension to obtain a splitting result of the weight data, and configuring a second storage space in the first memory for the weight data after splitting, based on the splitting result of the weight data;
- then, if the second storage space is successfully configured, splitting the input data in a second target dimension to obtain a splitting result of the input data, and configuring a third storage space in the first memory for the input data after splitting, based on the splitting result of the input data;
- or
- S212B:
- if the first storage space is successfully configured, splitting the input data in the second target dimension to obtain the splitting result of the input data, and configuring the third storage space in the first memory for the input data after splitting, based on the splitting result of the input data;
- or
- wherein the artificial intelligence hardware accelerator further comprises a second memory, and the data to be split comprises weight data, input data, and output data of the target operators;
- wherein the output data needs to be moved to the second memory, and S21 further comprises:
- S211′:
- splitting the weight data in the first target dimension to obtain a splitting result of the weight data and configuring the second storage space in the first memory for the weight data after splitting, based on the splitting result of the weight data;
- S212′:
- after the second storage space is successfully configured, splitting the input data in the second target dimension to obtain the splitting result of the input data, and configuring the third storage space in the first memory for the input data after splitting, based on the splitting result of the input data;
- and
- S213′:
- after the third storage space is successfully configured, configuring a first storage space in the first memory for the output data.
Dependencies are inferred from the claim text.