Method and task scheduler for scheduling a hardware accelerator - Patents.com
The task scheduler addresses latency and CPU occupation issues in hardware accelerator scheduling by using direct hardware access and dependency-based task management, improving processing performance and efficiency in control systems.
Patent Information
- Application Number
- JP2022559487
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-03-31
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2040-03-31
AI Technical Summary
Current methods for scheduling hardware accelerators in control systems, such as self-driving multi-domain controllers, involve software-based scheduling that leads to high latency and CPU resource occupation due to sequential task processing and data copying, especially when tasks are dependent on each other.
A task scheduler is introduced to manage hardware accelerators, scheduling tasks based on dependencies via direct hardware access, reducing task delivery and reporting delays by eliminating the need for CPU involvement and minimizing data copying.
This approach reduces processing delays and improves system performance by enabling parallel execution of tasks and direct data access, optimizing CPU resource usage and enhancing overall processing efficiency.
Smart Images

Figure 0007553176000015 
Figure 0007553176000004 
Figure 0007553176000010
Abstract
Description
[Technical field]
[0001] The present application relates to the field of network communication technologies, and in particular to a method and task scheduler for scheduling a hardware accelerator. [Background technology]
[0002] A hardware accelerator (HAC) is a hardware module that implements some specific functions using a logic language. Because data can be processed simultaneously, hardware accelerators have a significant advantage over software implementations in terms of processing power and latency. Currently, in some control systems, such as autonomous driving multi-domain controllers (MDCs, also called intelligent driving domain controllers), corresponding accelerators used by a system on chip (SoC) to process different information flow tasks need to be scheduled to work together to complete corresponding tasks. Each task is processed based on a data frame. Each data frame is processed by multiple HACs in parallel or serially.
[0003] Currently, HACs are generally managed and scheduled by software, and HACs are scheduled using software. Each HAC is scheduled by one or more pieces of software. When a task needs to be processed, the software sends a task request to the corresponding HAC. When the processing is completed, the HAC returns a task completion response. As shown in Figure 1, in the control system of the MDC scenario, tasks are executed by software scheduling from top to bottom through the CPU software scheduling layer, the user mode space layer, the kernel mode space layer, and the HAC. The process of scheduling a task by software is specifically as follows: the CPU receives the data sent by the previous level (i.e., the previous task), and the hardware accelerator 0 needs to perform the data processing. In this case, an address space needs to be created in the user mode space layer to copy the data in the virtual memory 0, and the executor 0 (Executor), which corresponds to the hardware accelerator 0 and is in the kernel mode space layer, is called, and then the hardware accelerator 0 is called to execute the data and complete the processing of the corresponding task. After the execution of the task, the hardware accelerator 0 generates a message response (e.g., generates an interrupt or a status register), sequentially reports the message response to the user mode space layer via the driver 0 (Driver) and the executor 0 of the kernel mode space layer, and finally reports the message response to the CPU. If the hardware accelerator 1 needs to continue to perform further data processing after the previous data is processed by the hardware accelerator 0, the data output after being processed by the hardware accelerator 0 needs to be further copied, and then the hardware accelerator 1 continues to perform processing according to the above process until the data is finally reported to the CPU. If multiple tasks need to be processed and the tasks are interdependent (e.g., task 2 can only be processed after task 1 is processed), each task needs to be processed according to the previous step.In addition, task 2 can be processed according to the previous steps only after task 1 has been processed according to the previous steps.
[0004] In the method for scheduling hardware accelerators mentioned above, kernel mode drivers and executors are required in the process where tasks are delivered by level and reported by level after processing, then the tasks reach the user mode space layer and finally reported to the CPU for processing. This process takes a long time. If multiple tasks need to be processed and the tasks depend on each other, the tasks need to be processed in order according to the preceding steps. During this period, the waiting time is long and CPU resources are occupied. Summary of the Invention
[0005] The embodiment of the present application provides a method and a task scheduler for scheduling a hardware accelerator. The task scheduler is connected between a CPU and each hardware accelerator. The task scheduler is configured to schedule a HAC to execute each task based on the dependency between the tasks through hardware scheduling. The delivery of each task and the report after the task execution are both performed by direct hardware access. This shortens the delay of the task delivery and the report after the task is processed, and indirectly improves the processing performance of the system.
[0006] From this perspective, the embodiments of the present application provide the following technical solutions:
[0007] According to a first aspect, the present application provides a method for scheduling a hardware accelerator first. The method includes: a task scheduler first obtains a target task. For example, obtain the target task from a memory (e.g., a DDR). The target task is a task to be executed in a task set. After obtaining the target task, the task scheduler may determine a first associated task associated with the target task based on a dependency. The first associated task is a task that needs to be executed based on the dependency before the target task is executed. The first associated task may be one task in the task set, or may be multiple tasks in the task set. The amount of the first associated task is specifically determined based on the dependency. If there are multiple first associated tasks, the dependency further includes an execution sequence of the multiple first associated tasks. After the task scheduler determines a first associated task associated with the target task based on the dependency and further determines that the first associated task has been executed, the task scheduler determines at least one hardware accelerator associated with executing the target task and schedules the at least one hardware accelerator to execute the target task.
[0008] In the implementation of the present application described above, the task scheduler first obtains a target task (e.g., obtains a target task from a memory) and obtains dependencies between the target task and the associated tasks. If it is determined based on the dependencies that a first associated task in the associated tasks (e.g., the prerequisite for executing the target task is that task 1, task 2, etc. are all successfully executed) is successfully executed, the target task indicates that it meets the execution condition. In this case, the task scheduler schedules a hardware accelerator (which may be one or more) associated with the execution of the target task to execute the target task. In this embodiment of the present application, the task scheduler is connected between the CPU and each hardware accelerator. The task scheduler is configured to schedule the HAC to execute each task based on the dependencies between the tasks through hardware scheduling. The delivery of each task is performed by direct hardware access. This shortens the delivery delay of the task and indirectly improves the processing performance of the system.
[0009] Referring to the first aspect of the embodiment of the present application, in a first implementation of the first aspect of the embodiment of the present application, there may be one or more hardware accelerators executing the target task. When there are multiple hardware accelerators executing the target task, the multiple hardware accelerators execute the target task in sequence. Note that, in some implementations of the present application, the multiple hardware accelerators executing the target task in sequence may include the multiple hardware accelerators executing the target task simultaneously. For example, if the task scheduler determines that the target task needs to be executed by hardware accelerator 1, hardware accelerator 2, and hardware accelerator 3 individually after obtaining the target task, the target task may be executed by hardware accelerators 1 to 3 simultaneously, and hardware accelerators 1 to 3 do not compete.
[0010] In the implementation of the present application described above, when there are multiple hardware accelerators involved in the execution of a target task, it is described how the multiple hardware accelerators work together to execute the target task. This is operable.
[0011] With reference to the first aspect of the embodiment of the present application and the first implementation of the first aspect of the embodiment of the present application, in a second implementation of the first aspect of the embodiment of the present application, after the task scheduler schedules at least one hardware accelerator to execute the target task, the task scheduler further instructs the hardware accelerator to store data generated after the target task is executed (e.g., store the data in a memory DDR) so that the data generated after the target task is executed can be directly called by another hardware accelerator when needed thereafter.
[0012] In the above implementation of the present application, each hardware accelerator stores the processed data after processing the target task (e.g., stores the processed data in memory). In this way, when another hardware accelerator needs to further process the processed data, the processed data does not need to be copied and can be directly called. This reduces the amount of data processing, saves time, and indirectly improves system performance.
[0013] With reference to the first aspect of the embodiment of the present application or the first to second implementations of the first aspect, in a third implementation of the first aspect of the embodiment of the present application, each hardware accelerator may execute one or more tasks. In this case, each hardware accelerator corresponds to one run queue, and the tasks to be executed by the hardware accelerator are stored in each run queue in order. When there are multiple hardware accelerators to execute a target task, an identifier of the target task is stored in the run queue corresponding to each hardware accelerator for the target task.
[0014] In the implementation of the present application described above, the hardware accelerator identifies the order in which each task is processed based on the identifier of the task placed in the corresponding run queue, which is flexible.
[0015] With reference to the third implementation of the first aspect of the embodiment of the present application, in a fourth implementation of the first aspect of the embodiment of the present application, after scheduling a hardware accelerator to execute a corresponding target task, the task scheduler receives an indication message returned by the corresponding hardware accelerator executing the target task. The indication message indicates that the hardware accelerator has executed the target task. In this case, the task scheduler may remove the identifier of the target task from the execution queue corresponding to the hardware accelerator.
[0016] In the implementation of the present application described above, after a task is executed, the corresponding task identifier is removed from the run queue, as described above. The run queue is dynamically maintained, which is flexible.
[0017] With reference to the first aspect of the embodiment of the present application or the first to fourth implementations of the first aspect of the embodiment of the present application, in the fifth implementation of the first aspect of the embodiment of the present application, each task in the task set is processed in a similar processing manner to that of the target task. After each task in the task set is executed, the task scheduler obtains all data after each task is executed and stores the data (e.g., stores the data in a memory). All tasks in the task set form a scheduled task. The original scheduled task is completed only after all tasks in the task set are executed. One scheduled task is a specific implementation process in which a data flow (sometimes called raw data) obtained by a terminal device by using a sensor (e.g., a camera) is processed by a series of related hardware accelerators to obtain output data with a specified function (e.g., data used to sense obstacles and data used to be transmitted to another device).
[0018] In the above implementation of the present application, as described above, in the MDC scenario, a scheduled task is completed only after all tasks in a task set are processed, which is practical.
[0019] With reference to the fifth implementation of the first aspect of the embodiment of the present application, in the sixth implementation of the first aspect of the embodiment of the present application, the task set includes a plurality of tasks, and the data forming the plurality of tasks may be acquired through a plurality of channels, including, but not limited to, a terminal device (e.g., a vehicle) acquiring data by using an on-board camera device (e.g., a camera mounted on the vehicle). In this case, the acquired data forming the plurality of tasks is image data or video data. After the terminal device acquires data by using a camera, the data is divided into tasks (e.g., divided into data frames), and the divided tasks form a task set.
[0020] In the implementation of the present application described above, channels for obtaining data forming a task set are described, which are universally applicable.
[0021] With reference to the fifth to sixth implementations of the first aspect of the embodiment of the present application, in the seventh implementation of the first aspect of the embodiment of the present application, one scheduled task may specifically be that an AI module (e.g., an AI processor) performs computing to obtain feedback data. The feedback data may be used to guide a user's operation on a terminal device (e.g., a vehicle). In this embodiment of the present application, the AI module is also a kind of hardware accelerator.
[0022] In the above embodiment of the present application, as mentioned above, the data obtained after the scheduled task is executed may be feedback data calculated by the AI module, and the feedback data may be further used to guide the user's operation on the terminal device, which is practical.
[0023] With reference to the seventh implementation of the first aspect of the embodiment of the present application, in the eighth implementation of the first aspect of the embodiment of the present application, when the terminal device is a vehicle, in some application scenarios, the feedback data may be data used to sense lane lines and / or stop lines, and is used to guide the vehicle owner to drive in a designated lane or stop in a designated parking area. Alternatively, the feedback data may be data used to sense a safety area, and is used to guide the vehicle owner to keep the vehicle at a safe distance from other vehicles. Alternatively, the feedback data may be data used to sense an obstacle (e.g., a distance from an obstacle), and is used to guide the vehicle owner to take safety measures (e.g., stopping or turning) in advance. The types and functions of the feedback data are not limited here. The corresponding feedback data may be obtained based on an actual application scenario. Thus, the vehicle owner is guided to operate the vehicle based on the corresponding feedback data, thereby improving driving safety and driving performance.
[0024] In the above embodiments of the present application, the application scenarios of feedback data are specifically described, which are diversified.
[0025] A second aspect of the embodiment of the present application provides a task scheduler. The task scheduler has a function of implementing the method according to the first aspect or any one of the possible implementations of the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions.
[0026] A third aspect of an embodiment of the present application provides a control system. The control system may include, but is not limited to, a task scheduler and a hardware accelerator. The task scheduler is configured to: obtain a target task (e.g., obtain the target task from a memory), and determine a first associated task associated with the target task based on a dependency relationship, where the dependency relationship indicates an execution order of tasks in a task set, the target task being a task in the task set; and when it is determined that the first associated task has been executed, schedule the hardware accelerator to execute the target task. The hardware accelerator is configured to execute the target task.
[0027] With reference to the third aspect of the embodiment of the present application, in a first implementation of the third aspect of the embodiment of the present application, the task scheduler may include, but is not limited to, at least one execution queue. An identifier of a target task is stored in each execution queue. At least one hardware accelerator is configured to execute the target task by using the identifier of the target task stored in the at least one execution queue. Each hardware accelerator corresponds to one execution queue.
[0028] With reference to the third aspect of the embodiment of the present application and the first implementation of the third aspect of the embodiment of the present application, in a second implementation of the third aspect of the embodiment of the present application, the task scheduler is further configured to store data obtained after each task in the task set is executed. All tasks in the task set form a scheduled task.
[0029] With reference to the second implementation of the third aspect of the embodiment of the present application, in the third implementation of the third aspect of the embodiment of the present application, the data forming the tasks in the task set is acquired by the terminal device by using an on-board camera device. The control system may be located in the terminal device (e.g., a camera on a vehicle acquires image data and transmits the image data to a control system on the vehicle). Alternatively, the control system may not be located in the terminal device (e.g., a camera on a user's mobile phone acquires image data and transmits the image data to a vehicle that is in communication with the mobile phone, and the control system is located in the vehicle).
[0030] With reference to the second to third implementations of the third aspect of the embodiment of the present application, in the fourth implementation of the third aspect of the embodiment of the present application, the data obtained after each task in the task set is executed may be feedback data calculated by an AI module (e.g., an AI processor). The feedback data is used to guide the operation of the terminal device, and the AI module is also a kind of hardware accelerator.
[0031] With reference to the third aspect of the embodiment of the present application or the first to fourth implementations of the third aspect, in a fifth implementation of the third aspect of the embodiment of the present application, the task scheduler may further include a scheduling engine and an executor. The scheduling engine is configured to call the target task and the dependency from the memory. The executor is configured to provide an interface to the hardware accelerator. The run queue is used to buffer the identifier of the target task in order. Specifically, the task scheduler including the scheduling engine, the executor, and the run queue has a function of implementing the method according to the first aspect or any one of the possible implementations of the first aspect.
[0032] A fourth aspect of an embodiment of the present application provides a task scheduler. The task scheduler may include a memory, a processor, and a bus system. The memory is configured to store a program. The processor is configured to call the program stored in the memory and execute a method according to the first aspect of the embodiment of the present application or any one of the possible implementations of the first aspect.
[0033] A fifth aspect of the present application provides a computer-readable storage medium, the computer-readable storage medium storing instructions, which when executed on a computer, enable the computer to perform a method according to the first aspect or any one of the possible implementations of the first aspect.
[0034] A sixth aspect of an embodiment of the present application provides a computer program, which, when executed on a computer, enables the computer to perform the method according to the first aspect or any one of the possible implementations of the first aspect. [Brief description of the drawings]
[0035] [Figure 1] 1 is a schematic diagram of scheduling a HAC by software for a task.
[0036] [Diagram 2] FIG. 1 is a schematic diagram of a control system according to an embodiment of the present application.
[0037] [Diagram 3] FIG. 2 is a schematic diagram of a method for scheduling a hardware accelerator according to an embodiment of the present application;
[0038] [Figure 4] FIG. 2 is a schematic diagram of the relationship between each hardware accelerator and an execution queue according to one embodiment of the present application.
[0039] [Diagram 5]FIG. 2 is a schematic diagram of an association relationship between tasks in a task set according to an embodiment of the present application.
[0040] [Figure 6] FIG. 2 is a schematic diagram of the association relationship between tasks and events after the event concept is introduced according to an embodiment of the present application.
[0041] [Figure 7] FIG. 2 is a schematic diagram of a two-dimensional chart of dependencies between tasks according to an embodiment of the present application;
[0042] [Figure 8] FIG. 1 is a schematic diagram of the structure of the current control system in an MDC scenario.
[0043] [Figure 9] FIG. 2 is a schematic diagram of the structure of a control system in an MDC scenario according to an embodiment of the present application.
[0044] [Figure 10] FIG. 2 is a schematic diagram of a description of scheduled tasks in an MDC scenario according to an embodiment of the present application;
[0045] [Figure 11] FIG. 1 is a schematic diagram of a practical application scenario of MDC according to an embodiment of the present application.
[0046] [Figure 12] FIG. 2 is a schematic diagram of a task scheduler according to an embodiment of the present application.
[0047] [Figure 13] FIG. 2 is another schematic diagram of a task scheduler according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0048] The embodiment of the present application provides a method and a task scheduler for scheduling a hardware accelerator. The task scheduler is connected between a CPU and each hardware accelerator. The task scheduler is configured to schedule a HAC to execute each task based on the dependency between the tasks through hardware scheduling. The delivery of each task and the report after the task execution are both performed by direct hardware access. This shortens the delay of the delivery of the task and the report after the task is processed, and indirectly improves the processing performance of the system.
[0049] The following describes embodiments of the present application with reference to the accompanying drawings. Those skilled in the art can learn that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application can also be applied to similar technical problems.
[0050] In this specification, claims and accompanying drawings of this application, the terms "first", "second", etc. are intended to distinguish between similar objects, but do not necessarily indicate a particular sequence or order. It should be understood that terms used in this manner are interchangeable in appropriate circumstances, but this is merely a method of identification used when objects with the same attributes are described in the embodiments of this application. In addition, the terms "include", "contain" and other variations are meant to cover non-exclusive inclusions, so that a process, method, system, product, or apparatus that includes a set of units is not necessarily limited to those units, and may include other units not expressly listed in or inherent to such process, method, product, or apparatus.
[0051] Before describing the embodiments of the present application, the location of the task scheduler described in the present application in the control system will be described first. As shown in FIG. 2, the task scheduler is located between the CPU and each hardware accelerator. Each hardware accelerator has an interface corresponding to the task scheduler. This interface is provided by a task executor (sometimes simply called an executor) on the task scheduler. The task scheduler may have multiple execution queues. Each execution queue corresponds to one hardware accelerator (in some embodiments, the execution queue may also exist in the memory or the corresponding hardware accelerator, but this is not limited here, and FIG. 2 is merely an example), and is used to store the identifiers of the tasks in the execution order. The tasks to be executed, the data to be obtained after the tasks are executed, the dependencies between the tasks, etc. may all be stored in the memory DDR (in some implementations, they may be stored in another location, for example, directly in the storage unit of the task scheduler, but this is not limited here, and FIG. 2 is merely an example). If the relevant data is stored in memory, after the task scheduler schedules at least one hardware accelerator to execute the target task, the task scheduler may instruct the hardware accelerator to store the data generated after the target task is executed. In this way, the data generated after the target task is executed can be directly called by another hardware accelerator when needed later, and does not need to be copied. This reduces the amount of data processing, saves time, and indirectly improves system performance. The task scheduler may use a scheduling engine on the task scheduler to exchange information with the memory and each hardware accelerator (e.g., receive instruction messages returned from the hardware accelerator, query the relevant data in the memory, and send instructions to the hardware accelerator). For example, data collected from a camera is stored in memory.Data (i.e., target task) needs to be processed by hardware accelerator 0 and hardware accelerator 1. The task scheduler retrieves the aforementioned data collected by the camera from memory and delivers an instruction to hardware accelerator 0 to instruct hardware accelerator 0 to process the data. After processing the data, hardware accelerator 0 may notify the task scheduler using a hardware signal cable to store the processed data in memory. Then, the task scheduler delivers an instruction to hardware accelerator 1 to instruct hardware accelerator 1 to call the aforementioned data processed by hardware accelerator 0 from memory for further processing. After processing the data, hardware accelerator 1 notifies the task scheduler and stores the processed data in memory again. In this embodiment of the present application, both task distribution and reporting after the task is processed are performed by direct hardware access. This greatly reduces the processing delay of task distribution and reporting after the task is processed, and indirectly improves the processing performance of the chip. Since the data is stored in memory, the data cache area can be shared and does not need to be copied repeatedly. This reduces data copy delays and improves data processing performance.
[0052] The method for scheduling a hardware accelerator provided in this embodiment of the present application can be implemented based on the control system of Fig. 2. In this method, the task scheduler directly implements pure hardware scheduling based on the dependency between tasks, and does not need to occupy CPU resources. Please refer to Fig. 3 for details.
[0053] 301: The task scheduler gets the target task.
[0054] The task scheduler first obtains a target task, for example, obtains a target task from a memory (e.g., DDR). The target task is a task to be executed in a task set. The task set includes a plurality of tasks. Data forming the plurality of tasks may be obtained through a plurality of channels, including, but not limited to, obtaining data using a camera device (e.g., a camera mounted on a vehicle) mounted on a terminal device (e.g., a vehicle). In this case, the obtained data forming the plurality of tasks is image data or video data. After the terminal device obtains data using a camera, the data is divided into tasks (e.g., divided into data frames), and the divided tasks form a task set.
[0055] 302: The task scheduler determines a first associated task that is associated with the target task based on a dependency.
[0056] After obtaining the target task, the task scheduler may determine a first associated task associated with the target task based on the dependency. The first associated task is a task that needs to be executed based on the dependency before the target task is executed. The first associated task may be one task in the task set, or may be multiple tasks in the task set. The amount of the first associated task is specifically determined based on the dependency. In addition, when there are multiple first associated tasks, the dependency further includes the execution order of the multiple first associated tasks. For example, when there are two first associated tasks, which are task 1 and task 2 respectively, the order of executing task 1 and task 2 based on the dependency is as follows: task 1 is executed before task 2. When both task 1 and task 2 are executed, it is determined that the target task meets the execution condition. It should be noted that the order described in this embodiment of the present application may further include simultaneous execution. The above example is still used as an example. When task 1 and task 2 need to be executed simultaneously based on the dependency, task 1 and task 2 are executed simultaneously, and after both tasks are executed, it is determined that the target task meets the execution condition.
[0057] 303: If the task scheduler determines that the first associated task has been executed, the task scheduler schedules at least one hardware accelerator to execute the target task.
[0058] The task scheduler determines a first associated task associated with the target task based on the dependency, and after determining that the first associated task has been executed, the task scheduler determines at least one hardware accelerator associated with the execution of the target task, and schedules the at least one hardware accelerator to execute the target task. It should be noted that there may be one or more hardware accelerators to execute the target task. When there are multiple hardware accelerators to execute the target task, the multiple hardware accelerators execute the target task in sequence. For ease of understanding, an example is used below for explanation. If, after obtaining a target task, the task scheduler determines that the target task needs to be executed by hardware accelerator 1, hardware accelerator 2, and hardware accelerator 3, and the execution order is that the target task is first executed by hardware accelerator 1, data 1 obtained through the execution is executed by hardware accelerator 2, and then data 2 obtained through the execution is executed by hardware accelerator 3, data 3 obtained through the execution by hardware accelerator 3 is data generated after all hardware accelerators 1 to 3 have executed the target task (data 3 is sometimes referred to as target data).
[0059] It should be noted that in some implementations of the present application, the execution of the target task by multiple hardware accelerators in sequence may include the case where multiple hardware accelerators execute the target task simultaneously. The above example is still used as an example. If the task scheduler obtains the target task and then determines that the target task needs to be executed by hardware accelerator 1, hardware accelerator 2, and hardware accelerator 3 separately, the target task may be executed by hardware accelerators 1 to 3 simultaneously, and hardware accelerators 1 to 3 do not conflict with each other.
[0060] It should be further noted that in some implementations of the present application, the dependency may also record how the task scheduler determines information such as the number of hardware accelerators for executing the target task, the type of hardware accelerators, the execution order, etc. In this way, the task scheduler can not only determine the first associated task associated with the target task from the dependency, but also determine the hardware accelerator for executing the target task based on the dependency.
[0061] Furthermore, it should be noted that in some implementations of the present application, after the task scheduler schedules at least one hardware accelerator to execute the target task, the task scheduler further instructs the hardware accelerator to store (e.g., store data in memory DDR) data generated after the target task is executed. In this way, the data generated after the target task is executed can be directly called by another hardware accelerator when needed later, and does not need to be copied. This reduces the amount of data processing, saves time, and indirectly improves system performance. For clarity, the above example is still used as an example for explanation. If the task scheduler determines that the target task needs to be executed by hardware accelerator 1, hardware accelerator 2, and hardware accelerator 3 in order after obtaining the target task, and the execution order is that the target task is first executed by hardware accelerator 1, data 1 obtained through execution is executed by hardware accelerator 2, and then data 2 obtained through execution is executed by hardware accelerator 3, data 3 is obtained through execution by hardware accelerator 3. In this case, the task scheduler instructs the hardware accelerator 1 to store data 1 obtained after the target task is executed (e.g., store data 1 in memory DDR), and then the task scheduler instructs the hardware accelerator 2 to retrieve data 1 from memory to continue execution. The task scheduler further instructs the hardware accelerator 2 to store data 2 obtained after data 1 is executed (e.g., continue to store data 2 in memory DDR). Finally, the task scheduler instructs the hardware accelerator 3 to retrieve data 2 from memory to continue execution, and the task scheduler further instructs the hardware accelerator 3 to store data 3 obtained after data 2 is executed.It should be noted that in order to distinguish the hardware accelerator that executes the target task each time, the original identifier of the target task may carry corresponding information about the hardware accelerator that executes the target task (both the original identifier and the original identifier that carries the information may be referred to as the identifier of the target task), or the information about the hardware accelerator that executes the target task may be stored separately. This is not particularly limited here. An example is used for explanation. If it is assumed that the target task is executed by the hardware accelerators 1 to 3 in sequence and the identifier of the target task is M002, the identifier M002-1 may be used to indicate that the acquired data 1 is data acquired after the target task M002 is executed by the hardware accelerator 1. Similarly, M002-1-2 is used to indicate that the acquired data 2 is acquired after the target task is executed by the hardware accelerator 1 and the hardware accelerator 2 in sequence. The identifier M002-1-2-3 is used to indicate that the acquired data 3 is acquired after the target task is executed by the hardware accelerators 1 to 3 in sequence. Similarly, if the target task is executed simultaneously by hardware accelerators 1-3, identifiers M002-1, M002-2, and M002-3 may be used to indicate that the acquired data was acquired after the target task was executed separately by hardware accelerator 1, hardware accelerator 2, and hardware accelerator 3, respectively.
[0062] It should be noted that in some implementations of the present application, each hardware accelerator may execute one or more tasks. In this case, each hardware accelerator corresponds to one run queue, and the tasks to be executed by the hardware accelerator are stored in each run queue in order. When there are multiple hardware accelerators to execute a target task, the identifier of the target task (which may be the original identifier of the target task, or may be the corresponding identifier after the target task is executed by the hardware accelerator) is stored in the run queue corresponding to each hardware accelerator for the target task. This is not limited here. For the sake of clarity, an example is used here for explanation. As shown in FIG. 4, it is assumed that there are three first associated tasks: task 1, task 2, and task 3 associated with the target task, and based on the dependency of task 1 and the dependency of task 2, it is determined that both task 1 and task 2 are executed by hardware accelerator 1, and hardware accelerator 1 should execute task 1 first and then execute task 2, based on the dependency of the target tasks, it is determined that the target task is also executed by hardware accelerator 1 and hardware accelerator 3 in sequence, and based on the dependency of task 3, it is determined that task 3 is executed by hardware accelerator 2. In this case, the identifier Q001 of task 1, the identifier Q002 of task 2, and the identifier M002 of the target task are sequentially placed in run queue 1 corresponding to hardware accelerator 1 (assuming that neither task 1 nor task 2 is running). The identifier Q003 of task 3 is stored in run queue 2 corresponding to hardware accelerator 2 (assuming that task 3 is not running). The identifier M002-1 of the data obtained after the target task is executed by the hardware accelerator 1 is stored in the execution queue 3 corresponding to the hardware accelerator 3.
[0063] It should be noted that there is one run queue corresponding to each hardware accelerator, as shown in FIG. 4, and the run queue stores the identifiers of the tasks in the task set that are to be executed by the corresponding hardware accelerator. In some implementations of the present application, when there are multiple task sets at the same time, for example, assuming that there are three task sets, each hardware accelerator corresponds to three run queues. As shown in FIG. 2, the three run queues corresponding to one hardware accelerator correspond to three task sets, respectively. When there are m task sets, there are m run queues for each hardware accelerator.
[0064] It should be noted that in some implementations of the present application, the run queue may be a storage area within the task scheduler, or may be a storage area within memory, or may be a storage area correspondingly divided from each hardware accelerator, which is not particularly limited here.
[0065] It should be further noted that in some implementations of the present application, after scheduling a hardware accelerator to execute the corresponding target task, the task scheduler receives an indication message returned by the corresponding hardware accelerator executing the target task. The indication message indicates that the hardware accelerator has executed the target task. In this case, the task scheduler may remove the identifier of the target task from the execution queue corresponding to the hardware accelerator. For ease of understanding, FIG. 4 is still used as an example for explanation. After task 1 is executed by hardware accelerator 1, hardware accelerator 1 returns an indication message to the task scheduler to indicate that task 1 has been executed. In this case, the task scheduler removes the identifier Q001 of task 1 from the execution queue. Similarly, task 2 is then executed in the order shown in execution queue 1. After task 2 is executed by hardware accelerator 1, the identifier Q002 of task 2 is removed from the execution queue, and then the original target task is executed in the order shown in execution queue 1. After the target task is executed by hardware accelerator 1, the identifier M002 of the target task is removed from the execution queue. In addition, each time a task is executed, the hardware accelerator 1 stores data corresponding to the executed task (e.g., stores the data in the memory DDR). After the target task is executed by the hardware accelerator 1, the acquired data 1 is stored. After task 1, task 2, and task 3 are all executed, the task scheduler instructs the hardware accelerator 3 to execute data 1 (assuming there is no other task identifier before M002-1 in the execution queue 3).
[0066] It should be noted that in some implementations of the present application, the tasks that need to be executed first before the target task is executed and the execution order of these tasks (i.e., the first associated tasks) can be determined based on the dependency of the target task, and the tasks that meet the execution condition after the target task is executed (sometimes called the second associated tasks) can be further determined from the dependency. An example is used for explanation. Assume that the second associated task is task m. If the prerequisite for executing task m is that the target task has been executed, in the dependency of task m, the target task is the first associated task of task m. When task m is executed, task m is treated as a new target task as described above. Details are not described again here. By analogy, each task in a task set has its own dependency, and all tasks in the task set can be executed based on the dependency of each task in the above-mentioned scheduling method.
[0067] To better understand the aforementioned solution, the following uses FIG. 5 as an example to explain the specific dependencies between tasks in a task set. It is assumed that the task set includes seven tasks, which are denoted as TS1 to TS7, respectively, and their execution order and dependencies are shown in FIG. 5. Only after TS7 is executed from TS1, the entire task set is completed. For better and clearer understanding, the concept of "event" is introduced. As shown in FIG. 6, b0 to b5 are six events. Therefore, the group of tasks TS1 to TS7 may be called an "event task group". For the meanings shown in FIG. 6, please refer to the task description in Table 1 and the event description in Table 2. [Table 1] [Table 2]
[0068] Based on the above inter-task association relationships, the dependencies between each task and other tasks can be obtained. It should be noted that each task can correspond to one dependency, or the association relationships between all tasks in a task set can form a dependency (for example, the two-dimensional chart shown in FIG. 7). This is not limited here.
[0069] In addition, the event-based task scheduling process may be specifically as follows: the software first triggers b0 to start and execute task TS1. After task TS1 is executed, event b1 is triggered. Event b1 schedules task list TS2 and TS3 to be executed simultaneously. After task TS2 is executed, events b2 and b4 are notified. Event b2 schedules task list TS4 to be executed. After task TS3 is executed, events b3 and b4 are notified. If event b4 meets the condition, task list TS6 is scheduled to be executed. After task TS6 is executed, event b5 is notified. If task TS4 is executed, event b3 is notified. If event b3 meets the condition, task list TS5 is scheduled to be executed. If event b5 meets the condition, task list TS7 is scheduled to be executed. After task TS7 is executed, the tasks of the entire event task group are completed.
[0070] Based on the above description, in some implementations of the present application, the dependency of each task may be stored in memory in the manner of a two-dimensional chart. FIG. 7 is a two-dimensional chart of one dependency of each task in one task set, namely, task graph 0 in FIG. 7. Task graph n represents a two-dimensional chart of one dependency of each task in the n-th task set (not shown in detail in FIG. 7). In FIG. 7, task graph 0 shows that there are seven tasks in the task set, and these tasks are t0 to t6, respectively. The upper part of task graph 0 represents the execution order (arrows) and association relationships of tasks t0 to t6. Take t4 as an example. The prerequisite for executing t4 is that both t1 and t2 have been executed. The central part of task graph 0 represents the arrangement order of the identifiers of the tasks in the execution queue, and the identifiers are arranged in the arrow direction from the "head" to the "tail" of the execution order of the tasks. The lower part of task graph 0 represents that the executor corresponding to each run queue provides an interface between the task scheduler and each hardware accelerator, and delivers execution instructions to the corresponding hardware accelerator in the execution order of the tasks in the run queue.
[0071] In the above-mentioned implementation of the present application, the task scheduler first obtains the target task (e.g., obtains the target task from memory), and obtains dependencies between the target task and the associated tasks. Based on the dependencies, if it is determined that the first associated task in the associated tasks (e.g., the prerequisite for executing the target task is that task 1, task 2, etc. are all successfully executed) is successfully executed, it indicates that the target task meets the execution condition. In this case, the task scheduler selects a hardware accelerator associated with the execution of the target task to execute the target task. (which may be one or more). In this embodiment of the present application, a task scheduler is connected between the CPU and each hardware accelerator. The task scheduler is configured to schedule the HAC to execute each task based on the dependency between the tasks through hardware scheduling. The delivery of each task is performed by direct hardware access. This shortens the delay of task delivery and indirectly improves the processing performance of the system.
[0072] The following describes the above-mentioned method for scheduling hardware accelerators using an example in which the control system is a control system in an MDC scenario. In the MDC scenario, the locations of the hardware accelerators (only some hardware accelerators are shown, for example, video decoding accelerator, vision pre-processing accelerator, image decoding accelerator, image encoding accelerator, and AI module) in the current control system are shown in FIG. 8. The main control CPU schedules each hardware accelerator to perform corresponding tasks. Voice, image, or video may be input from an external sensor or PCIe interface and sent to memory for storage. Alternatively, voice, image, or video may be processed by a hardware accelerator such as an image decoding (JPEG decoding, JPEGD) accelerator or a video decoding (Video Decoding, VEDC) accelerator, and then vision pre-processing may be performed by a vision pre-processing (Vision Pre-Processing, VPC) accelerator, and then sent to the AI module for further processing. In the MDC scenario, one scheduled task is a specific implementation process in which a data flow (sometimes called raw data) acquired by a terminal device (e.g., a vehicle) by using a sensor (e.g., a camera) is processed by a series of related hardware accelerators to obtain output data with a specified function (e.g., data used to sense obstacles and data used to be transmitted to another device). In some implementations of the present application, one scheduled task may be specifically divided into a front-end task and a back-end task. The front-end task is mainly responsible for data input, and mainly includes multiple tasks, such as collection of multi-sensor source (image, video, etc.) information flow, image processing, data processing such as cropping, reassembling, resizing, and data storage and data transfer in the process.Hardware accelerators that process different tasks need to be scheduled to work together. The back-end task is mainly responsible for calculating the data obtained by the processed front-end task. That is, after the data processed by the front-end task is obtained, the AI CPU of the AI module is notified to perform subsequent tasks such as data calculation, analysis, training, prediction, and adjustment. It should be noted that in some other implementations of the present application, one scheduled task may only include a front-end task. For example, after the task scheduler calls each hardware accelerator to perform processing such as image processing, cropping, reconstruction, and resizing on the input data, the processed data is sent to another terminal device (such as a mobile phone or a personal computer), which performs AI computing and then returns the calculation result to the terminal device.
[0073] FIG. 9 shows the position of the task scheduler of the control system in the MDC scenario. The task scheduler provides an interface to each hardware accelerator to schedule each hardware accelerator, for example, the video decoding accelerator, the vision pre-processing accelerator, the image decoding accelerator, or the image encoding accelerator in FIG. 9. In the MDC scenario, the task flow of one scheduled task (sometimes called a task set) is divided into multiple tasks, and parallel processing or sequential processing is performed by multiple hardware accelerators. The method for scheduling the hardware accelerator in this embodiment of the present application is used to improve the processing performance of the scheduled task. After the tasks in the task set are executed, the task scheduler stores the data generated after the tasks are executed (e.g., stores the data in memory). The tasks in the task set form one scheduled task. The original scheduled task is completed only after all the tasks in the task set are executed. According to the aforementioned scheduling method, the target task in one scheduled task may specifically be that the task scheduler instructs the AI module (e.g., AI CPU) to perform AI computing to obtain feedback data after the calculation of the AI module. The feedback data may be used to guide the operation of a user on a vehicle. Specifically, in some application scenarios, the feedback data may be data used to sense lane boundaries and / or stop lines, which are used to guide the vehicle owner to drive in a designated lane or stop in a designated parking area. Alternatively, the feedback data may be data used to sense a safety area, which is used to guide the vehicle owner to keep the vehicle at a safe distance from other vehicles.Alternatively, the feedback data may be data used to sense obstacles (e.g., distance from obstacles) and used to guide the vehicle owner to take safety measures (e.g., stop or turn) in advance. The types and functions of the feedback data are not limited here. The corresponding feedback data may be obtained based on actual application scenarios. Thus, the vehicle owner is guided to operate the vehicle based on the corresponding feedback data, thereby improving driving safety and driving performance.
[0074] To better understand the scheduled tasks, the following provides an explanation with reference to the application scenario of MAC. Please refer to FIG. 10. Various sensors (such as general radar, camera, laser radar, and inertial measurement unit) mounted on the vehicle first obtain various sensor data. In addition, a map is used to obtain a location message or obtain a local map. The data may be called raw data. Then, the raw data is assigned by the task scheduler to a corresponding hardware accelerator for processing to obtain processed data (i.e., sensing data in FIG. 10). The specific purpose of the obtained sensing data varies with different hardware accelerators. For example, the sensing data output after the accelerator (which may be one or more) for radar sensing processes the raw data may be used to sense obstacles, and the sensing data output after the accelerator (which may be one or more) for visual lane sensing processes the raw data may be used to sense lane boundaries. Each process from raw data to sensing data acquired by scheduling each hardware accelerator by the task scheduler is a specific execution process of the scheduled task. Finally, data that the user can intuitively read (e.g., simulated lane boundary lines or simulated safety areas displayed on the display interface) is acquired by fusion or spatial recognition of each sensing data.
[0075] It should be noted that in some implementations of the present application, the data forming each task in the task set may be acquired by the vehicle by using an on-board sensor device (e.g., a camera).
[0076] It should be noted that in some implementations of the present application, dependencies between divided tasks within one scheduled task may be represented using the two-dimensional chart of Figure 7. The two-dimensional chart may be stored in memory.
[0077] The following describes a practical scenario in which the method described in this embodiment of the present application is applied. FIG. 11 shows a typical data flow graph of the surround-view stitching and image sensing unit. The one-way arrow line indicates the flow direction of the data flow. The two-way arrow line indicates that there is an interface between the task scheduler and each hardware accelerator. The task scheduler may schedule each hardware accelerator through these interfaces. As shown in FIG. 11, the task scheduler may schedule any one of the image processing accelerators 1-4, the vision pre-processing accelerators 1-3, and the AI modules 1-2. Four fisheye cameras installed respectively on the front, rear, left and right sides of the vehicle are configured to first collect image data. The task scheduler schedules the image processing accelerators 1-4 to perform image processing on the image data of the corresponding branches, and then performs image distortion correction and surround view stitching on the four-channel image data, and outputs a one-channel panorama. The panorama is output to three places (i.e., three task sets are formed). The first channel (i.e., the first task set) is sent to the vision pre-processing accelerator 1 to obtain processed data, and then the processed data is output to the AI module 1 for calculation. The calculated feedback data is used to sense lane boundaries and stop lines. Similarly, the second channel (i.e., the second task set) is sent to another vision pre-processing accelerator 2 to obtain processed data, and then the processed data is output to another AI module 2 for calculation. The calculated feedback data is used to sense the safety area in which the vehicle travels. The third channel (i.e., the third task set) is directly sent to the video encoding accelerator for image encoding, compression, and storage. Each task included in each task set can be processed according to the scheduling method described above. For details, please refer to the method of this embodiment corresponding to FIG. 3. Details will not be described here.
[0078] According to an embodiment corresponding to FIG. 3, in order to better explain the above-mentioned solution for implementing this embodiment of the present application, the following provides a task scheduler configured to implement the above-mentioned solution. In detail, FIG. 12 is a schematic diagram of the structure of a task scheduler according to an embodiment of the present application. The task scheduler 1200 includes an acquisition module 1201, a determination module 1202, and a scheduling module 1203. The acquisition module 1201 is configured to acquire a target task. The determination module 1202 is configured to determine a first associated task associated with the target task based on a dependency relationship. The dependency relationship indicates the execution order of the tasks in the task set. The scheduling module 1203 is configured to schedule at least one hardware accelerator to execute the target task when the determination module 1202 determines that the first associated task has been executed.
[0079] In a possible design, when the scheduling module 1203 schedules the at least one hardware accelerator to execute the target task, the at least one hardware accelerator executes the target task in turn.
[0080] In a possible design, each of the at least one hardware accelerator corresponds to a run queue, and an identifier of the target task is stored in the run queue corresponding to each hardware accelerator.
[0081] In a possible design, the scheduling module 1203 is further configured to: after the scheduling module 1203 schedules the at least one hardware accelerator to execute the target task, receive an instruction message returned by the at least one hardware accelerator indicating that the at least one hardware accelerator has executed the target task, and remove an identifier of the target task from an execution queue corresponding to the at least one hardware accelerator.
[0082] In a possible design, the scheduling module 1203 is further configured to: store data obtained after each task in the task set is executed. All tasks in the task set form a scheduled task.
[0083] In a possible design, data forming the tasks in the task set are acquired by the terminal device by using a camera device mounted on the terminal device.
[0084] In a possible design, the data obtained after each task in the task set is executed includes feedback data calculated by the AI module, the feedback data being used to guide the operation of the terminal device, and the AI module belonging to at least one hardware accelerator.
[0085] In a possible design, the terminal device is a vehicle. The feedback data includes data used to sense lane lines and / or stop lines, or data used to sense safety areas, data used to sense obstacles. The types and functions of the feedback data are not limited here. The corresponding feedback data may be obtained based on actual application scenarios. Thus, the vehicle owner is guided to operate the vehicle based on the feedback data, thereby improving driving safety and driving performance.
[0086] It should be noted that the contents such as information exchange and execution process between modules / units in the task scheduler 1200 are based on the same concept as the method embodiment corresponding to Fig. 3 in this application. For specific contents, please refer to the description of the above method embodiment in this application. Details will not be described here.
[0087] An embodiment of the present application further provides a task scheduler. FIG. 13 is a schematic diagram of the structure of a task scheduler according to an embodiment of the present application. For ease of description, only parts related to this embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method section in the embodiment of the present application. The modules of the task scheduler described in the embodiment corresponding to FIG. 12 can be deployed into a task scheduler 1300 and configured to implement the functions of the task scheduler of the embodiment corresponding to FIG. 12. Specifically, the task scheduler 1300 is implemented by one or more servers. The task scheduler 1300 may vary widely due to different configurations or performances, and may include one or more central processing units (CPUs) 1322 (e.g., one or more processors), a memory 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) that store application programs 1342 or data 1344. The memory 1332 and the storage media 1330 may be temporary or persistent storage. The program stored in the storage medium 1330 may include one or more modules (not shown), and each module may include a set of instruction operations for a hardware accelerator. Furthermore, the central processing unit 1322 may be configured to communicate with the storage medium 1330 and execute the set of instruction operations in the storage medium 1330 on the task scheduler 1300. For example, the central processing unit 1322 may be configured to obtain a target task and determine a first associated task associated with the target task based on a dependency relationship. The dependency relationship indicates the execution order of the tasks in the task set. When determining that the first associated task has been executed, the central processing unit 1322 schedules at least one hardware accelerator to execute the target task.
[0088] The task scheduler 1300 may further include one or more power sources 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358, and / or one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0089] In this embodiment of the present application, the steps performed by the task scheduler in the embodiment corresponding to Fig. 3 may be implemented based on the structure shown in Fig. 13. Details will not be described here.
[0090] In addition, it should be noted that the described embodiment of the device is merely an example. Units described as separate parts may or may not be physically separated, and parts shown as units may or may not be physical units, and may be located in one location or distributed across multiple network units. Some or all modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments. In addition, in the accompanying drawings of the embodiments of the device provided by the present application, the connection relationships between modules indicate that the modules have communication connections with each other, which may be specifically implemented as one or more communication buses or signal cables.
[0091] Based on the above implementation description, those skilled in the art can clearly understand that the present application can be implemented by software in addition to the necessary universal hardware, or by dedicated hardware including dedicated integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. In general, the functions that can be executed by a computer program can be easily implemented by using corresponding hardware. Furthermore, the specific hardware structure used to realize the same function can be of various forms, for example, in the form of an analog circuit, a digital circuit, or a dedicated circuit. However, for the present application, the implementation of a software program is a better implementation in most cases. Based on such understanding, the technical solution of the present application can be essentially, or the part that contributes to the prior art can be implemented in the form of a software product. The computer software product is stored in a readable storage medium such as a computer floppy disk, a USB flash drive, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, and includes some instructions for instructing a computer device (which can be a personal computer, a training device, or a network device) to execute the method described in the embodiment of the present application.
[0092] All or some of the above-described embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implementing the embodiments using software, all or part of the embodiments may be implemented in the form of a computer program product.
[0093] A computer program product includes one or more computer instructions. When the computer program instructions are loaded into a computer and executed, the procedures or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, training device, or data center to another website, computer, training device, or data center by wire (e.g., coaxial cable, optical fiber, or digital subscriber line (DSL)) or wirelessly (infrared, radio, or microwave). The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device such as a training device or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape, etc.), an optical medium (e.g., a DVD), a semiconductor medium (e.g., a solid state disk (SSD)), etc.
Claims
1. 1. A method for scheduling a hardware accelerator, comprising: obtaining a target task by a task scheduler; determining, by the task scheduler, a first associated task associated with the target task based on a dependency relationship, the dependency relationship indicating an execution order of tasks in a task set, the target task being a task in the task set, and the first associated task being a task that needs to be executed based on the dependency relationship before the target task is executed; scheduling, by the task scheduler, at least one hardware accelerator to execute the target task when the task scheduler determines that the first associated task has been executed; storing data obtained after execution of each task in the task set by the task scheduler, where all tasks in the task set form a scheduled task; data forming the tasks in the task set is acquired by a vehicle using a camera device mounted on the vehicle; The data obtained after each task in the task set is executed includes feedback data calculated by an AI module, the feedback data including data used to sense lane lines and / or stop lines; or data used to sense safety areas; or data used to sense obstacles; the feedback data is used to guide the operation of the vehicle, and the AI module belongs to the at least one hardware accelerator. method.
2. when the task scheduler schedules the at least one hardware accelerator to execute the target task, the at least one hardware accelerator executes the target task in order. The method of claim 1.
3. each of the at least one hardware accelerator corresponding to a run queue, and an identifier of the target task is stored in the run queue corresponding to each of the hardware accelerators; The method according to claim 1 or 2.
4. After the task scheduler schedules the at least one hardware accelerator to execute the target task, the method further comprises: receiving, by the task scheduler, an indication message returned by the at least one hardware accelerator, the indication message indicating that the at least one hardware accelerator has executed the target task; removing, by the task scheduler, the identifier of the target task from a run queue corresponding to the at least one hardware accelerator; The method according to claim 3.
5. an acquisition module configured to acquire a target task; a determination module configured to determine a first associated task associated with the target task based on a dependency relationship, the dependency relationship indicating an execution order of tasks in a task set, the target task being a task in the task set, and the first associated task being a task that needs to be executed based on the dependency relationship before the target task is executed; a scheduling module configured to schedule at least one hardware accelerator to execute the target task when the determination module determines that the first associated task has been executed; The scheduling module is further configured to: store data obtained after each task in the task set is executed, where all tasks in the task set form a scheduled task; data forming the tasks in the task set is acquired by a vehicle using a camera device mounted on the vehicle; The data obtained after each task in the task set is executed includes feedback data calculated by an AI module, the feedback data including: data used to sense lane lines and / or stop lines; or data used to sense safety areas; or data used to sense obstacles; the feedback data is used to guide the operation of the vehicle, and the AI module belongs to the at least one hardware accelerator. Task Scheduler.
6. when the scheduling module schedules the at least one hardware accelerator to execute the target task, the at least one hardware accelerator executes the target task in sequence; 6. The scheduler of claim 5.
7. each of the at least one hardware accelerator corresponding to a run queue, and an identifier of the target task is stored in the run queue corresponding to each of the hardware accelerators; 7. A scheduler according to claim 5 or 6.
8. The scheduling module further comprises: receiving an indication message returned by the at least one hardware accelerator after the scheduling module schedules the at least one hardware accelerator to execute the target task, the indication message indicating that the at least one hardware accelerator has executed the target task; remove the identifier of the target task from a run queue corresponding to the at least one hardware accelerator.
8. The scheduler of claim 7.
9. a task scheduler configured to: obtain a target task; determine a first associated task associated with the target task based on a dependency relationship, the dependency relationship indicating an execution order of tasks in a task set, the target task being a task in the task set, and the first associated task being a task that needs to be executed based on the dependency relationship before the target task is executed; and schedule at least one hardware accelerator to execute the target task when it is determined that the first associated task has been executed; the at least one hardware accelerator configured to execute the target task; The task scheduler is further configured to: store data obtained after each task in the task set is executed, with all tasks in the task set forming a scheduled task; data forming the tasks in the task set is acquired by a vehicle using a camera device mounted on the vehicle; The data obtained after each task in the task set is executed includes feedback data calculated by an AI module, the feedback data including: data used to sense lane lines and / or stop lines; or data used to sense safety areas; or data used to sense obstacles; and the feedback data is used to guide the operation of the vehicle, and the AI module belongs to the at least one hardware accelerator. Control system.
10. the task scheduler includes at least one run queue, and an identifier of the target task is stored in each run queue; the at least one hardware accelerator is configured to execute the target task by using an identifier of the target task that is stored in the at least one run queue, each hardware accelerator corresponding to one run queue; The system of claim 9.
11. a task scheduler having a processor and a memory, the processor coupled to the memory; the memory is configured to store a program; The processor is configured to execute the program in the memory such that the task scheduler executes the method of any one of claims 1 to 4. Task Scheduler.
12. A computer readable storage medium containing a program, which when executed on a computer enables the computer to carry out the method according to any one of claims 1 to 4.
13. A computer program, which when executed on a computer enables the computer to carry out the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Multiprocessor system
JP2009069921A
Image processor and program
JP2009093218A
Accelerator control device, accelerator control method and program
WO2017131187A1
