CN110909886B - Machine learning network operation method, device and medium - Google Patents

Machine learning network operation method, device and medium Download PDF

Info

Publication number
CN110909886B
CN110909886B CN201911142968.7A CN201911142968A CN110909886B CN 110909886 B CN110909886 B CN 110909886B CN 201911142968 A CN201911142968 A CN 201911142968A CN 110909886 B CN110909886 B CN 110909886B
Authority
CN
China
Prior art keywords
operating device
machine learning
performance parameter
learning network
operating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911142968.7A
Other languages
Chinese (zh)
Other versions
CN110909886A (en
Inventor
刘琦
何亮亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201911142968.7A priority Critical patent/CN110909886B/en
Publication of CN110909886A publication Critical patent/CN110909886A/en
Application granted granted Critical
Publication of CN110909886B publication Critical patent/CN110909886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means

Abstract

The present disclosure relates to a machine learning network operation method, apparatus, and medium. The method comprises the following steps: configuring a first main operation device and a first standby operation device aiming at the operation of a machine learning network; acquiring a first performance parameter of a first main running device and a second performance parameter of a first alternative running device aiming at least one operation; selecting an operating device with the minimum value of the performance parameter from the first main operating device and the first candidate operating device as a second main operating device after the operation is updated based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; running the machine learning network through the second master run device. The method disclosed by the invention improves the operation performance of the network and overcomes the problem of frequent equipment switching caused by the fact that the operation cannot be performed on certain equipment in the network operation process.

Description

Machine learning network operation method, device and medium
Technical Field
The present disclosure relates to the field of deep learning, and in particular, to a method, an apparatus, and a medium for operating a machine learning network.
Background
The mobile terminal chip of artificial intelligence (AI for short) has heterogeneous characteristics. With the increasing heat of artificial intelligence, besides the original Central Processing Unit (CPU), graphic Processing Unit (GPU) and Digital Signal Processing (DSP) computing chip, a great number of artificial intelligence chips such as neural Network Processor (NPU) and Accelerated Processing Unit (APU) have been brought forward, and the continuous progress of these chip technologies promotes the falling of deep learning, but at the same time, a great deal of workload is generated. This is because the chip programming interfaces are not uniform, the performance is differentiated, and the applicable operations are different. For example, some chips such as GPUs are suitable for performing image processing related operations such as convolution, but are not suitable for performing high-dimensional array operations, while chips such as CPUs/DSPs are suitable for array operations, but are less accurate and less capable of processing image operations than GPUs.
A deep learning network in the machine learning network will be described as an example. The topology structure corresponding to the deep learning network can be regarded as a directed acyclic graph (DAG for short), and an operation on each node in the topology graph may have multiple inputs and multiple outputs, and output data of the operation may be used as inputs of operations on other nodes. Generally, a network can only operate on the same device, and a user selects a target device to operate the network. If the device is not suitable for certain operations in the network, it can only be scheduled to run on other devices, such as a CPU.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method, an apparatus, and a medium for operating a machine learning network, by which the number of times of switching can be reduced and operation can be more stable.
According to a first aspect of an embodiment of the present disclosure, there is provided a machine learning network operation method, the method including:
configuring a first primary operating device and a first alternate operating device for operation of the machine learning network;
acquiring a first performance parameter of the first main operation device and a second performance parameter of the first alternative operation device aiming at least one operation;
selecting an operating device with the minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation;
operating, by the second primary operating device, the machine learning network.
Wherein the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
Wherein the selecting, from the first main operation device and the first candidate operation device, an operation device having a smallest value of a performance parameter as the updated second main operation device of the operation includes:
determining an operation sequence of each operation in the machine learning network based on the topological sequence of the topological structure corresponding to the machine learning network;
and determining the second main operation equipment corresponding to each operation in the machine learning network according to the operation sequence.
Wherein configuring a first primary operating device and a first alternate operating device for operation of the machine learning network comprises:
an operation of determining from the machine learning network that the calculation amount is larger than a first predetermined calculation amount;
configuring the first primary operating device and the first alternate operating device for the determined operation.
Wherein the obtaining a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device for at least one of the operations comprises:
an operation of determining from the machine learning network that the calculation amount is larger than a second predetermined calculation amount;
a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device of the determined operation are obtained.
According to a second aspect of the embodiments of the present disclosure, there is provided a machine learning network operating apparatus, the apparatus including:
a configuration module configured to configure a first primary operating device and a first alternate operating device for operation of the machine learning network;
a parameter obtaining module configured to obtain a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device for at least one of the operations;
a device selection module configured to select, based on the first performance parameter and the second performance parameter, an operating device with a minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation, wherein the performance parameter includes a switching time overhead, an operating time overhead, and an operating power consumption related to the operation;
an operation module configured to operate the machine learning network through the second master operation device.
Wherein the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
Wherein the device selection module is further configured to:
determining an operation sequence of each operation in the machine learning network based on the topological sequence of the topological structure corresponding to the machine learning network;
and selecting the second main operation equipment corresponding to each operation in the machine learning network according to the operation sequence.
Wherein the configuration module is further configured to:
an operation of determining from the machine learning network that a calculation amount is greater than a first predetermined calculation amount;
configuring the first primary operating device and the first alternate operating device for the determined operation.
Wherein the parameter acquisition module is further configured to:
an operation of determining from the machine learning network that the calculation amount is larger than a second predetermined calculation amount;
a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device of the determined operation are obtained.
According to a third aspect of the embodiments of the present disclosure, there is provided a machine learning network operating apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
configuring a first primary operating device and a first alternate operating device for operation of the machine learning network;
acquiring a first performance parameter of the first main running device and a second performance parameter of the first alternative running device aiming at least one operation;
selecting an operating device with the minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation;
operating, by the second master operating device, the machine learning network.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having instructions thereon, which when executed by a processor of a device, enable the device to perform a method of machine learning network operation, the method comprising:
configuring a first primary operating device and a first alternative operating device for operation of the machine learning network;
acquiring a first performance parameter of the first main operation device and a second performance parameter of the first alternative operation device aiming at least one operation;
selecting an operating device with the smallest value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation;
operating, by the second primary operating device, the machine learning network.
According to the technical scheme, before the machine learning network runs, the operation performance of the network is greatly improved by setting the optimal operation equipment for the operation in the machine learning network, and the problem that the equipment is frequently switched due to the fact that the operation cannot be carried out on certain equipment in the network running process is solved.
The method disclosed by the invention is beneficial to the subsequent subnet division in the machine learning network. That is, operations running on the same device and belonging to the same connected component in the corresponding topology can be merged into one subnet. That is, one machine learning network can be divided into several subnets, so that a complex network structure is divided into several simple network structures, which is beneficial to subsequent equipment maintenance and management.
Therefore, the method disclosed by the invention not only ensures that the machine learning network is operated with better performance and optimizes the expense of equipment switching, but also provides a method for automatically dividing the sub-networks in the machine learning network.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow chart illustrating a method of machine learning network operation in accordance with an exemplary embodiment.
Fig. 2 is a flowchart illustrating selection of an operating device with a minimum value of a performance parameter from among the first main operating device and the first alternative operating device as an updated second main operating device of the operation according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating configuring a first primary operating device and a first alternate operating device for operation of a machine learning network in accordance with an exemplary embodiment.
FIG. 4 is a flowchart illustrating obtaining a first performance parameter of a first primary operating device and a second performance parameter of a first alternate operating device for at least one operation according to an exemplary embodiment.
FIG. 5 is a flowchart illustrating a method of machine learning network operation, according to an example embodiment.
Fig. 6 is a block diagram illustrating a machine learning network operating apparatus according to an example embodiment.
FIG. 7 is a block diagram illustrating an apparatus in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating an apparatus in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The present disclosure provides a method of operating a machine learning network. A deep learning network in a machine learning network will be described as an example. Typically, a network operates on the same device, and the user selects a target device to operate the network. If the device is not suitable for running some operations in the network, one processing scheme is to manually adapt the deep learning network, modify the network structure, and only use the operations that can be run on the target device; another approach is to schedule operations that do not apply to the target device to be run on other devices and then to schedule back to the target device when the next operation applies to the target device. However, most engines do not support device scheduling well, or require user specification, or blind device scheduling results in frequent device switching, which can affect performance. Therefore, the two schemes either need manual deep participation and are high in cost, or the devices are frequently switched, and the system overhead is increased.
In order to solve such a problem, the method for operating a machine learning network according to the present disclosure, before operating the operation of the network, determines whether a first main operating device of each operation is preferred, if not, switches the first main operating device of the operation to a first alternative operating device, and after setting a preferred operating device for each operation, starts to operate the operation in the network, thereby avoiding frequent device switching on one hand, and ensuring that the operation in the network operates on the preferred device on the other hand, thereby improving the operating performance of the network operation.
FIG. 1 is a method of machine learning network operation according to the present disclosure, the method comprising:
step 101, configuring a first main operation device and a first standby operation device aiming at the operation of the machine learning network;
step 102, obtaining a first performance parameter of the first main operation device and a second performance parameter of the first alternative operation device aiming at least one operation;
103, based on the first performance parameter and the second performance parameter, selecting an operating device with a minimum performance parameter value from the first main operating device and the first candidate operating device as an updated second main operating device of the operation, wherein the performance parameters include switching time overhead, operating time overhead and operating power consumption related to the operation;
and 104, operating the machine learning network through the second main operation equipment.
A machine learning network includes a plurality of operations, and a machine learning network corresponds to a topology. Each operation corresponds to a node in the topology. Before the machine learning network is operated, one operation device is set as a first main operation device for operation, and one or more operation devices are set as first standby operation devices. For example, a first primary operating device and a first alternate operating device may be selected for each operation. The first main operating device and the first alternative operating device may select an appropriate operating device according to the characteristics of the operation. For example, the relevant operation for image processing may select a GPU, and the high-dimensional array operation may select a CPU or a DSP. The first main operation devices in different operations may be the same or different, and the first alternative operation devices in different operations may be the same or different.
Before the machine learning network is operated, it is determined whether a first main operation device configured for operation in the machine learning network is a preferred operation device. Although the first main operation device has been provided for the operation, in operation, the overall operation performance may not be optimal on the first main operation device, considering that the operation of one operation may be affected by the upstream operation and the downstream operation. Therefore, in order to optimize the operation of the operation in the network, it is first determined whether the first master operation device configured for the operation is the preferred operation device.
It should be noted that, it may be determined whether its actual operating device is the preferred operating device for each operation in the network, or only part of the operations in the network may be selected to determine whether its actual operating device is the preferred operating device. For example, in one embodiment, the machine learning network includes 500 operations, wherein 300 operations are common numerical calculations and the calculation amount is small, the actual running device of the 300 operations may be set as the CPU, the first main running device and the first alternative running device may be configured for another 200 operations, and it is determined whether the first main running device of the 200 operations is the preferred running device.
Therefore, in this embodiment, after configuring the first main operation device and the first candidate operation device for the operation, the performance parameters of these operation devices are obtained, and the operation device with the best operation performance is selected from the first main operation device and the first candidate operation device as the second operation device according to these performance parameters, and is used as the actual operation device of the operation. This ensures that the operation can be run on the most preferred running device.
An operating device is considered most preferred when its values for switching time overhead, runtime overhead and operating power consumption associated with the operation are minimal. Where the switching time overhead and the runtime overhead may be combined into a time overhead. The selection of the best operating device may be based on time overhead or operating power consumption, or may be based on both time overhead and operating power consumption. When selecting based on both time overhead and operating power consumption, then time overhead and operating power consumption may be weighted summed, and the minimum of the weighted sum is selected to determine the best operating device.
The index suitable for the running performance may be selected according to a specific application scenario. In the present disclosure, the main indexes affecting the operation performance are screened out through a large number of experiments: time overhead and operating power consumption. High performance means short overhead time or low power consumption. When the running performance is compared, any index of the time overhead and the power consumption can be selected for comparison, the two indexes can also be simultaneously selected for comparison, and the time overhead and the power consumption can be weighted and summed for comparison during comparison.
The time overhead includes, in addition to the time it takes for an operation to run on a running device, the time it takes to switch between a currently operating running device and an upstream operating running device and between a currently operating running device and a downstream operating running device. The current operation and the upstream operation thereof are respectively corresponding operations of a current node and an upstream node in a topological structure corresponding to the machine learning network; the current operation and the downstream operation thereof are respectively corresponding operations of a current node and a downstream node in a topology structure corresponding to the machine learning network.
Power consumption refers to the amount of power consumed by an operating device and may generally be represented by the current on the operating device.
Here, by comparing the operation performance of the operation on the first main operation device and the operation performance on the first alternative operation device, it is determined which operation device is the preferred operation device to optimize the operation of the operation.
By the method in fig. 1, before the machine learns the operation of the network, it is ensured that the operation equipment selected for each operation in the network is the preferred operation equipment, the operation performance of the network is greatly improved, and the problem of frequent equipment switching caused by the fact that the operation cannot be performed on certain equipment in the network operation process is solved. By using the method of fig. 1, the time overhead and power consumption of the operation are reduced.
As a refinement and further extension of the embodiment shown in fig. 1, the present embodiment discloses another machine learning network operation method. Wherein the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
For example, in a specific embodiment, the first main running device currently operating is a GPU, the first candidate running device is a CPU, and whether a D value in the following equation is smaller than zero is determined:
D=T(CPU)+T(Switch_CPU)-T(GPU)+T(Switch_GPU)
wherein, T (CPU) is a time for the CPU to execute the current operation, T (GPU) is a time overhead for the GPU to execute the current operation, T (Switch _ CPU) is a time overhead generated by switching between the upstream operation and the downstream operation when the current operation is executed by the CPU, and T (Switch _ GPU) is a time overhead generated by switching between the upstream operation and the downstream operation when the current operation is executed by the GPU.
If D <0, it indicates that running the current operation on the CPU will bring running performance gain, and at this time, the actual running device of the current operation is modified to be the CPU. If D is greater than 0, the current operation is operated in the GPU, so that operation performance benefits are brought, and the actual operation equipment of the current operation does not need to be modified and still remains as the GPU.
As a refinement and further extension of the embodiment shown in fig. 1, the present embodiment discloses another machine learning network operation method. Referring to fig. 2, fig. 2 is a flowchart of selecting an operating device with the smallest performance parameter value from the first main operating device and the first candidate operating device as the updated second main operating device of the operation. As shown in fig. 2, step 103 shown in fig. 1 may further include:
step 201, determining an operation sequence of each operation in the machine learning network based on a topological sequence of a topological structure corresponding to the machine learning network;
step 202, according to the running sequence, determining the second main running device corresponding to each operation in the machine learning network.
In step 201, topology sequencing is performed on a topological graph (topological structure) corresponding to the machine learning network, so as to obtain an operation sequence of operations corresponding to each node in the topological structure. The operations in a machine learning network are typically run in a certain order. The running order of the operations is obtained through topological sorting of the topological structure. The topological ordering of the topology can be performed in a manner known to those skilled in the art, and will not be described herein.
In step 202, according to the determined operation sequence of each operation, the operations are sequentially traversed to determine a preferred operation device corresponding to each operation, that is, a second main operation device. As described above, a portion of the operations in the machine learning network may also be selected to determine its second primary operating device. In this case, too, it is determined by the order in which the operations are run, except that not all operations in the network are traversed.
By adopting the method for obtaining the operation sequence of the operation through topological sorting and determining the second main operation equipment of the operation according to the operation sequence, the second main operation equipment of the upstream operation is adopted when the D is specifically calculated, namely the time overhead of switching the upstream operation of the current operation to the current operation is calculated; and when the time overhead of switching the current operation to the downstream operation of the current operation is calculated, adopting a first main running device of the downstream operation.
As a refinement and further extension of the embodiment shown in fig. 1, the present embodiment discloses another machine learning network operation method. Referring to fig. 3, fig. 3 is a flow chart for configuring a first primary operating device and a first alternate operating device for operation of the machine learning network. As shown in fig. 3, step 101 shown in fig. 1 may further include:
step 301, determining an operation that a calculation amount is larger than a first preset calculation amount from the machine learning network;
step 302, configuring the first main operation device and the first alternative operation device for the determined operation.
As a refinement and further extension of the embodiment shown in fig. 1, the present embodiment discloses another machine learning network operation method. Referring to fig. 4, fig. 4 is a flowchart for acquiring a first performance parameter of the first primary operating device and a second performance parameter of the first alternative operating device for at least one of the operations. As shown in fig. 4, step 102 shown in fig. 1 may further include:
an operation of determining that the calculated amount is larger than a second preset calculated amount from the machine learning network in step 401;
step 402, obtaining a first performance parameter of the first primary operating device and a second performance parameter of the first alternative operating device of the determined operation.
The first predetermined calculation amount and the second predetermined calculation amount may be the same or different. For operations with a small amount of calculation, the actual operating equipment can be directly configured, and the best operating equipment is not selected. This is because, when the amount of calculation of the operation is small, whether the performance parameter of the running device is optimal or not does not bring about a large influence.
It should be noted that, in order to make the operation more reliable, in some cases, a plurality of second main operation devices, for example, two second main operation devices, may be provided for one operation. When determining the second main operation device to operate, it is necessary to calculate the respective time overhead and/or power consumption of the three operation devices, i.e., the first main operation device and the two first alternative operation devices, and then select the operation device with the lowest time overhead and/or power consumption as the preferred operation device, i.e., the second main operation device.
In this way, it is further ensured that operation is performed with superior performance.
The method disclosed by the invention is beneficial to the subsequent subnet division in the machine learning network. That is, operations running on the same device and belonging to the same connected component in the corresponding topology may be merged into one subnet. That is, one machine learning network can be divided into several subnets, so that a complex network structure is divided into several simple network structures, which is beneficial to subsequent equipment maintenance and management.
Therefore, the method not only ensures that the machine learning network is operated with better performance and optimizes the expense of equipment switching, but also provides a method for automatically dividing the sub-networks in the machine learning network.
It should be noted that the execution steps in the above embodiments may be combined as needed.
Fig. 5 illustrates a particular embodiment of a machine learning network operating method according to the present disclosure. The machine learning network is specifically a deep learning network. Referring to fig. 5, a machine learning network operation method according to the present disclosure includes:
step 501, configuring a corresponding first main operation device and a corresponding first alternative operation device for each operation in the deep learning network.
And step 502, determining the operation that the calculated amount is larger than a second preset calculated amount from the deep learning network.
Step 503, obtaining a first performance parameter of the first main operation device and a second performance parameter of the first alternative operation device of the determined operation.
Step 504, determining a topological structure of the directed acyclic graph corresponding to the deep learning network, and performing topological sorting on each node in the topological structure through the topological structure.
And 505, determining the running sequence of each operation in the deep learning network based on the topological sorting.
Step 506, according to the running sequence, calculating the time cost of the operation running on the first main running device and the time cost of the operation running on the first alternative running device for each operation of the machine learning network, wherein the first performance parameter and the second performance parameter are obtained.
Step 507, when the time overhead of running on the first candidate running device is less than the time overhead of running on the first main running device, setting the first candidate running device of the operation as a second main running device.
And step 508, after determining the second main operation device operated by each of the acquired first performance parameter and the second performance parameter, operating the deep learning network through the determined second main operation device.
The present disclosure also provides a machine learning network operating apparatus, as shown in fig. 6, the apparatus includes:
a configuration module 601 configured to configure a first main operating device and a first alternative operating device for operation of the machine learning network;
a parameter obtaining module 602 configured to obtain a first performance parameter of the first primary operating device and a second performance parameter of the first alternative operating device for at least one of the operations;
a device selection module 603 configured to select, based on the first performance parameter and the second performance parameter, an operating device with a minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation, wherein the performance parameter includes a switching time overhead, an operating time overhead, and an operating power consumption related to the operation;
an operation module 604 configured to operate the machine learning network via the second master operation device.
In an alternative embodiment, the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
In an alternative embodiment, the device selection module is further configured to:
determining an operation sequence of each operation in the machine learning network based on the topological sequence of the topological structure corresponding to the machine learning network;
and selecting the second main operation equipment corresponding to each operation in the machine learning network according to the operation sequence.
In an alternative embodiment, the configuration module is further configured to:
an operation of determining from the machine learning network that a calculation amount is greater than a first predetermined calculation amount;
configuring the first primary operating device and the first alternate operating device for the determined operation.
In an alternative embodiment, the parameter obtaining module is further configured to:
an operation of determining from the machine learning network that the calculation amount is larger than a second predetermined calculation amount;
a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device of the determined operation are obtained.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
In the technical scheme provided by the embodiment of the disclosure, before the machine learning network operates, the operation performance of the network is greatly improved by setting the preferred operation equipment for the operation in the machine learning network, and the problem of frequent equipment switching caused by the fact that the operation cannot be performed on certain equipment in the network operation process is solved. The method disclosed by the invention not only ensures that the machine learning network is operated with better performance and optimizes the expense of equipment switching, but also provides a method for automatically dividing the sub-networks in the machine learning network.
Fig. 7 is a block diagram illustrating an apparatus 700 for machine learning network operation according to an example embodiment. For example, the apparatus 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, apparatus 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 702 may include one or more modules that facilitate interaction between processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operation at the device 700. Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power component 706 provides power to the various components of the device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the apparatus 700.
The multimedia component 708 includes a screen that provides an output interface between the device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 700 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, audio component 710 includes a Microphone (MIC) configured to receive external audio signals when apparatus 700 is in an operating mode, such as a call mode, a record mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the device 700. For example, sensor assembly 714 may detect an open/closed state of device 700, the relative positioning of components, such as a display and keypad of apparatus 700, sensor assembly 714 may also detect a change in position of apparatus 700 or a component of apparatus 700, the presence or absence of user contact with apparatus 700, orientation or acceleration/deceleration of apparatus 700, and a change in temperature of apparatus 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the apparatus 700 and other devices. The apparatus 700 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the device 700 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a smart terminal, enable the smart terminal to perform a machine learning network operation method, the method comprising: configuring a first primary operating device and a first alternative operating device for operation of the machine learning network; acquiring a first performance parameter of the first main running device and a second performance parameter of the first alternative running device aiming at least one operation; selecting an operating device with the minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; operating, by the second master operating device, the machine learning network.
Fig. 8 is a block diagram illustrating an apparatus 800 for machine learning network operation, according to an example embodiment. For example, the apparatus 800 may be provided as a server. Referring to FIG. 8, the apparatus 800 includes a processing component 822, which further includes one or more processors, and memory resources, represented by memory 832, for storing instructions, such as applications, that are executable by the processing component 822. The application programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processing component 822 is configured to execute instructions to perform the above-described method: configuring a first primary operating device and a first alternate operating device for operation of the machine learning network; acquiring a first performance parameter of the first main operation device and a second performance parameter of the first alternative operation device aiming at least one operation; selecting an operating device with the smallest value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; operating, by the second primary operating device, the machine learning network.
The device 800 may also include a power component 826 configured to perform power management of the device 800, a wired or wireless network interface 850 configured to connect the device 800 to a network, and an input/output (I/O) interface 858. The apparatus 800 may operate based on an operating system stored in the memory 832, such as Windows Server, mac OSXTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method of operating a machine learning network, the method comprising:
configuring a first primary operating device and a first alternate operating device for operation of the machine learning network;
acquiring a first performance parameter of the first main running device and a second performance parameter of the first alternative running device aiming at least one operation;
configuring, by the processor, a first primary operating device and a first alternate operating device for operation of the machine learning network, including: an operation of determining from the machine learning network that a calculation amount is greater than a first predetermined calculation amount; configuring the first main operation equipment and the first alternative operation equipment according to the determined operation, and directly operating other operations by the determined actual operation equipment;
selecting an operating device with the minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; operating, by the second primary operating device, the machine learning network.
2. The method of claim 1,
the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
3. The method of claim 1, wherein the selecting the operating device with the smallest value of the performance parameter from the first primary operating device and the first alternative operating device as the updated second primary operating device of the operation comprises:
determining the running sequence of each operation in the machine learning network based on the topological sequence of the topological structure corresponding to the machine learning network;
and determining the second main operation equipment corresponding to each operation in the machine learning network according to the operation sequence.
4. The method of claim 1, wherein the obtaining a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device for at least one of the operations comprises:
an operation of determining from the machine learning network that the calculation amount is larger than a second predetermined calculation amount;
a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device of the determined operation are obtained.
5. A machine learning network operation apparatus, the apparatus comprising:
a configuration module configured to configure a first primary operating device and a first alternate operating device for operation of the machine learning network;
the configuration module is further configured to: an operation of determining from the machine learning network that the calculation amount is larger than a first predetermined calculation amount; configuring the first main operation equipment and the first alternative operation equipment according to the determined operation, and directly operating other operations by the determined actual operation equipment;
a parameter obtaining module configured to obtain a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device for at least one of the operations;
a device selection module configured to select, based on the first performance parameter and the second performance parameter, an operating device with a minimum value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation, wherein the performance parameter includes a switching time overhead, an operating time overhead, and an operating power consumption related to the operation; an operation module configured to operate the machine learning network through the second master operation device.
6. The apparatus of claim 5, wherein the switching time overhead associated with the operation is: the sum of the time overhead of a second primary running device of an operation upstream of the operation switching to the second primary running device of the operation and the time overhead of the second primary running device of the operation switching to a first primary running device of an operation downstream of the operation.
7. The apparatus of claim 5, wherein the device selection module is further configured to:
determining the running sequence of each operation in the machine learning network based on the topological sequence of the topological structure corresponding to the machine learning network;
and selecting the second main operation equipment corresponding to each operation in the machine learning network according to the operation sequence.
8. The apparatus of claim 5, wherein the parameter acquisition module is further configured to:
an operation of determining from the machine learning network that the calculation amount is larger than a second predetermined calculation amount;
a first performance parameter of the first primary operating device and a second performance parameter of the first alternate operating device of the determined operation are obtained.
9. A machine learning network operating apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
configuring a first primary operating device and a first alternative operating device for operation of the machine learning network;
configuring, by the processor, a first primary operating device and a first alternate operating device for operation of the machine learning network, including: an operation of determining from the machine learning network that a calculation amount is greater than a first predetermined calculation amount; configuring the first main operation equipment and the first alternative operation equipment according to the determined operation, and directly operating other operations by the determined actual operation equipment;
acquiring a first performance parameter of the first main running device and a second performance parameter of the first alternative running device aiming at least one operation;
selecting an operating device with the smallest value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; operating, by the second master operating device, the machine learning network.
10. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a device, enable the device to perform a machine learning network operation method, the method comprising:
configuring a first primary operating device and a first alternate operating device for operation of the machine learning network;
configuring, by the processor, a first primary operating device and a first alternate operating device for operation of the machine learning network, including: an operation of determining from the machine learning network that the calculation amount is larger than a first predetermined calculation amount; configuring the first main operation equipment and the first alternative operation equipment according to the determined operation, and directly operating other operations by the determined actual operation equipment;
acquiring a first performance parameter of the first main running device and a second performance parameter of the first alternative running device aiming at least one operation;
selecting an operating device with the smallest value of a performance parameter from the first main operating device and the first candidate operating device as an updated second main operating device of the operation based on the first performance parameter and the second performance parameter, wherein the performance parameter comprises switching time overhead, operating time overhead and operating power consumption related to the operation; operating, by the second primary operating device, the machine learning network.
CN201911142968.7A 2019-11-20 2019-11-20 Machine learning network operation method, device and medium Active CN110909886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911142968.7A CN110909886B (en) 2019-11-20 2019-11-20 Machine learning network operation method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911142968.7A CN110909886B (en) 2019-11-20 2019-11-20 Machine learning network operation method, device and medium

Publications (2)

Publication Number Publication Date
CN110909886A CN110909886A (en) 2020-03-24
CN110909886B true CN110909886B (en) 2022-11-04

Family

ID=69818296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911142968.7A Active CN110909886B (en) 2019-11-20 2019-11-20 Machine learning network operation method, device and medium

Country Status (1)

Country Link
CN (1) CN110909886B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752713B (en) * 2020-06-28 2022-08-05 浪潮电子信息产业股份有限公司 Method, device and equipment for balancing load of model parallel training task and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197976A (en) * 2013-04-11 2013-07-10 华为技术有限公司 Method and device for processing tasks of heterogeneous system
WO2018076238A1 (en) * 2016-10-27 2018-05-03 华为技术有限公司 Heterogeneous system, computation task assignment method and device
CN110298437A (en) * 2019-06-28 2019-10-01 Oppo广东移动通信有限公司 Separation calculation method, apparatus, storage medium and the mobile terminal of neural network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197976A (en) * 2013-04-11 2013-07-10 华为技术有限公司 Method and device for processing tasks of heterogeneous system
WO2018076238A1 (en) * 2016-10-27 2018-05-03 华为技术有限公司 Heterogeneous system, computation task assignment method and device
CN110298437A (en) * 2019-06-28 2019-10-01 Oppo广东移动通信有限公司 Separation calculation method, apparatus, storage medium and the mobile terminal of neural network

Also Published As

Publication number Publication date
CN110909886A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
CN111651263B (en) Resource processing method and device of mobile terminal, computer equipment and storage medium
EP3133874B1 (en) Method and apparatus for starting energy saving mode
CN104951335B (en) The processing method and processing device of application program installation kit
CN109447125B (en) Processing method and device of classification model, electronic equipment and storage medium
CN111160448B (en) Training method and device for image classification model
CN110634488B (en) Information processing method, device and system and storage medium
CN110619873A (en) Audio processing method, device and storage medium
CN114595785B (en) Model training method and device, electronic equipment and storage medium
CN110764627A (en) Input method and device and electronic equipment
CN110909886B (en) Machine learning network operation method, device and medium
CN107992894B (en) Image recognition method, image recognition device and computer-readable storage medium
CN112333518B (en) Function configuration method and device for video and electronic equipment
CN107480773B (en) Method and device for training convolutional neural network model and storage medium
CN111966412A (en) Method, device and storage medium for waking up terminal
CN111859097B (en) Data processing method, device, electronic equipment and storage medium
CN111461151A (en) Multi-group sample construction method and device
CN111382242A (en) Information providing method, device and readable medium
CN111259675B (en) Neural network calculation-based method and device
CN112416580A (en) Method, device and medium for determining optimal resource allocation mode in application runtime
CN114266306A (en) Method and device for realizing data classification based on machine learning model and electronic equipment
CN114648116A (en) Model quantification method and device, vehicle and storage medium
CN114840761A (en) Push model training method, device, equipment, storage medium and program product
CN108154092B (en) Face feature prediction method and device
CN110046035B (en) System switching method and device and electronic equipment
EP3786852A1 (en) Method for subnetwork sampling, and method and device for building a hypernetwork topology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant