US 11,893,414 B2
Operation method, device and related products
Xi Chen, Beijing (CN); Jin Wang, Beijing (CN); and Shijin Zhang, Beijing (CN)
Assigned to CAMBRICON TECHNOLOGIES CORPORATION LIMITED, Beijing (CN)
Filed by Cambricon Technologies Corporation Limited, Beijing (CN)
Filed on Dec. 11, 2019, as Appl. No. 16/711,370.
Claims priority of application No. 201811635181.X (CN), filed on Dec. 29, 2018.
Prior Publication US 2020/0210233 A1, Jul. 2, 2020
Int. Cl. G06F 9/48 (2006.01); G06N 3/08 (2023.01); G06F 15/80 (2006.01); G06Q 50/26 (2012.01)
CPC G06F 9/4881 (2013.01) [G06F 15/80 (2013.01); G06N 3/08 (2013.01); G06Q 50/265 (2013.01)] 6 Claims
OG exemplary drawing
 
1. A parallel execution method for a neural network, comprising:
receiving, by a first processor, a first command and obtaining a parallel degree parameter in the first command, wherein the parallel degree parameter comprises both a model parallel parameter and a data parallel parameter, and
setting, by the first processor, a degree of parallelism of a second processor according to the parallel degree parameter according to the first command, wherein the degree of parallelism includes a degree of model parallelism and a degree of data parallelism, so that multiple cores in the second processor perform a task to be processed by using the degree of parallelism,
wherein the degree of model parallelism indicates how many cores of the second processor are configured to parallelly perform operations corresponding to respective layers of the neural network,
wherein the degree of data parallelism indicates how many cores of the second processor are configured to parallelly process different portions of input data of the neural network,
wherein the task to be processed includes an online task, wherein the setting the degree of parallelism of the second processor according to the parallel degree parameter includes:
setting the degree of model parallelism in a first configuration file of the task to be processed according to the model parallel parameter, and
setting the degree of data parallelism in a second configuration file of the task to be processed according to the data parallel parameter,
wherein the first configuration file and the second configuration file are stored in the first processor,
compiling the online task according to the degree of model parallelism in the first configuration file, and generating a program to be executed on the second processor, and
transferring the degree of data parallelism in the second configuration file to the second processor through a second command, so that the second processor obtains data according to the degree of data parallelism and executes the program to be executed to process the data.