CN-121980229-A - Hardware acceleration path selection method, electronic device and storage medium
Abstract
The application discloses a hardware acceleration path selection method, electronic equipment and a storage medium, wherein the method comprises the steps of extracting characteristics of a target processing task under the condition of receiving the target processing task to obtain a task characteristic vector corresponding to the target processing task; the method comprises the steps of obtaining a hardware capacity vector corresponding to each hardware accelerating resource, matching the task characteristic vector corresponding to the target processing task with the hardware capacity vector corresponding to each hardware accelerating resource to obtain the matching degree of each hardware accelerating resource to the target processing task, and selecting target hardware for executing the target processing task from each hardware accelerating resource according to the matching degree of each hardware accelerating resource to the target processing task.
Inventors
- LIN JIANSEN
- CHEN QING
- DAI ZHILIN
- ZHOU BO
Assignees
- 杭州国科微电子有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251230
Claims (10)
- 1. A hardware acceleration path selection method, comprising: Under the condition that a target processing task is received, extracting the characteristics of the target processing task to obtain a task characteristic vector corresponding to the target processing task; acquiring a hardware capacity vector corresponding to each hardware acceleration resource, wherein the dimension of the hardware capacity vector corresponds to the dimension of the task feature vector; Respectively matching the task feature vector corresponding to the target processing task with the hardware capability vector corresponding to each hardware acceleration resource to obtain the matching degree of each hardware acceleration resource to the target processing task; And selecting target hardware for executing the target processing task from each hardware acceleration resource according to the matching degree of each hardware acceleration resource to the target processing task.
- 2. The method according to claim 1, wherein selecting the target hardware for executing the target processing task from the respective hardware acceleration resources according to the matching degree of the respective hardware acceleration resources to the target processing task comprises: Acquiring current resource situation data of each hardware acceleration resource; And selecting target hardware for executing the target processing task from each hardware acceleration resource according to the matching degree of each hardware acceleration resource to the target processing task and the current resource situation data of each hardware acceleration resource.
- 3. The method of claim 2, wherein the current resource situation data of each hardware acceleration resource includes a task static adaptation coefficient corresponding to each of the hardware acceleration resources for the target processing task and a real-time state coefficient of each of the hardware acceleration resources; Selecting target hardware for executing the target processing task from the hardware acceleration resources according to the matching degree of the hardware acceleration resources to the target processing task and the current resource situation data of the hardware acceleration resources, wherein the target hardware comprises: According to each hardware acceleration resource, fusing the matching degree of the target processing task according to the corresponding task static adaptation coefficient and the real-time state coefficient to obtain the final matching degree of each hardware acceleration resource for the target processing task; And selecting the hardware acceleration resource with the highest final matching degree from the hardware acceleration resources as the target hardware.
- 4. The method of claim 3, wherein the fusing the matching degree of the target processing task according to the corresponding task static adaptation coefficient and the real-time state coefficient according to each hardware acceleration resource to obtain the final matching degree of each hardware acceleration resource for the target processing task includes: Acquiring a first adaptation coefficient, a second adaptation coefficient and a third adaptation coefficient which correspond to each hardware acceleration resource respectively, wherein the task static adaptation coefficient comprises the first adaptation coefficient aiming at a task operation type of the target processing task, the second adaptation coefficient aiming at a data format related to the target processing task and the third adaptation coefficient aiming at a data size related to the target processing task; For each hardware acceleration resource, multiplying the matching degree of the target processing task with the first matching coefficient, the second matching coefficient and the third matching coefficient to obtain an intermediate matching degree; And fusing the intermediate matching degree according to the real-time state coefficient aiming at each hardware acceleration resource to obtain the final matching degree of each hardware acceleration resource aiming at the target processing task.
- 5. The method of claim 3, wherein the real-time state coefficients comprise a load balancing factor and a memory pattern matching coefficient; The matching degree of the target processing task is fused according to the hardware accelerating resources and the corresponding task static adaptation coefficient and real-time state coefficient to obtain the final matching degree of the hardware accelerating resources for the target processing task, and the method comprises the following steps: According to each hardware acceleration resource, fusing the matching degree of the target processing task according to the corresponding task static adaptation coefficient to obtain an intermediate matching degree; And multiplying the corresponding load balancing factor and the corresponding memory pattern matching coefficient by the intermediate matching degree according to each hardware accelerating resource to obtain the final matching degree of each hardware accelerating resource for the target processing task.
- 6. The method of claim 5, wherein the obtaining current resource situation data for each hardware acceleration resource comprises: acquiring real-time hardware utilization rate of each hardware acceleration resource and performance parameters of a memory system, and memory access characteristics of the target processing task; according to the real-time hardware utilization rate of each hardware acceleration resource, determining a load balancing factor corresponding to each hardware acceleration resource; and comparing the memory system performance parameters of each hardware acceleration resource with the memory access characteristics of the target processing task, and determining the memory pattern matching coefficients corresponding to each hardware acceleration resource.
- 7. The method according to any one of claims 1 to 6, wherein selecting target hardware for executing the target processing task from the respective hardware acceleration resources according to the degree of matching of the respective hardware acceleration resources to the target processing task, includes: Acquiring history execution information when executing a history processing task; Inputting the historical execution information as a model to run a latest performance prediction model to obtain a prediction result of executing the target processing task; and selecting target hardware for executing the target processing task from the hardware acceleration resources according to the prediction result and the matching degree of the hardware acceleration resources to the target processing task.
- 8. The method of claim 7, wherein the method further comprises: Acquiring task execution information when the target hardware executes the target processing task; performing error calculation according to the task execution information and the prediction result to obtain an error gradient; and optimizing parameters of the performance prediction model according to the error gradient so as to update the performance prediction model.
- 9. An electronic device comprising a memory and a processor, and a computer program stored on the memory, which when executed by the processor, performs the steps of the hardware accelerated routing method of any of claims 1 to 8.
- 10. A readable storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement the steps of the hardware accelerated path selection method of any of claims 1 to 8.
Description
Hardware acceleration path selection method, electronic device and storage medium Technical Field The present application relates to the field of electronic circuits and semiconductors, and in particular, to a hardware acceleration path selection method, an electronic device, and a storage medium. Background With the popularity of computer vision and image processing applications, modern computing platforms are often equipped with a variety of heterogeneous computing resources, including general purpose central processing units (Central Processing Unit, CPU), graphics processing units (Graphics Processing Unit, GPU), and dedicated hardware accelerators. These different types of hardware behave differently when handling image tasks of different characteristics. At present, a common hardware selection method in industry mainly depends on a simple rule matching or static configuration table, and finally selected hardware is difficult to adapt to the characteristics of tasks and hardware, so that the task execution effect is poor. Disclosure of Invention In view of this, the present application provides a method for selecting a hardware acceleration path, an electronic device, and a storage medium, which aims to effectively improve the technical problem that the task execution effect is poor due to the fact that the finally selected hardware is difficult to adapt to the task and the characteristics of the hardware in the prior art. The application provides a hardware acceleration path selection method, which comprises the following steps: Under the condition that a target processing task is received, extracting the characteristics of the target processing task to obtain a task characteristic vector corresponding to the target processing task; acquiring a hardware capacity vector corresponding to each hardware acceleration resource, wherein the dimension of the hardware capacity vector corresponds to the dimension of the task feature vector; Respectively matching the task feature vector corresponding to the target processing task with the hardware capability vector corresponding to each hardware acceleration resource to obtain the matching degree of each hardware acceleration resource to the target processing task; And selecting target hardware for executing the target processing task from each hardware acceleration resource according to the matching degree of each hardware acceleration resource to the target processing task. Optionally, selecting, according to the matching degree of each hardware acceleration resource to the target processing task, target hardware for executing the target processing task from each hardware acceleration resource, where the selecting includes: Acquiring current resource situation data of each hardware acceleration resource; And selecting target hardware for executing the target processing task from each hardware acceleration resource according to the matching degree of each hardware acceleration resource to the target processing task and the current resource situation data of each hardware acceleration resource. Optionally, the current resource situation data of each hardware acceleration resource includes a task static adaptation coefficient corresponding to each hardware acceleration resource for the target processing task and a real-time state coefficient of each hardware acceleration resource; Selecting target hardware for executing the target processing task from the hardware acceleration resources according to the matching degree of the hardware acceleration resources to the target processing task and the current resource situation data of the hardware acceleration resources, wherein the target hardware comprises: According to each hardware acceleration resource, fusing the matching degree of the target processing task according to the corresponding task static adaptation coefficient and the real-time state coefficient to obtain the final matching degree of each hardware acceleration resource for the target processing task; And selecting the hardware acceleration resource with the highest final matching degree from the hardware acceleration resources as the target hardware. Optionally, the fusing the matching degree of the target processing task according to the hardware acceleration resources and the corresponding static adaptation coefficient and the real-time state coefficient of the task to obtain the final matching degree of the hardware acceleration resources for the target processing task, including: Acquiring a first adaptation coefficient, a second adaptation coefficient and a third adaptation coefficient which correspond to each hardware acceleration resource respectively, wherein the task static adaptation coefficient comprises the first adaptation coefficient aiming at a task operation type of the target processing task, the second adaptation coefficient aiming at a data format related to the target processing task and the third adaptation coefficient aiming at