WO2023045203A1 - 一种任务调度方法、芯片以及电子设备 - Google Patents

一种任务调度方法、芯片以及电子设备 Download PDF

Info

Publication number
WO2023045203A1
WO2023045203A1 PCT/CN2022/074613 CN2022074613W WO2023045203A1 WO 2023045203 A1 WO2023045203 A1 WO 2023045203A1 CN 2022074613 W CN2022074613 W CN 2022074613W WO 2023045203 A1 WO2023045203 A1 WO 2023045203A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
engine
task
data
scheduler
Prior art date
Application number
PCT/CN2022/074613
Other languages
English (en)
French (fr)
Inventor
李树青
王江
孙华锦
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Priority to US18/280,215 priority Critical patent/US20240143392A1/en
Publication of WO2023045203A1 publication Critical patent/WO2023045203A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of acceleration architecture, in particular to a task scheduling method, chip and electronic equipment.
  • DSA domain customization
  • a domain-customized hardware accelerator is designed for a certain business domain.
  • the business domain often includes multiple user scenarios.
  • the hardware accelerator needs to implement different functions, but these functions often have similar or common characteristics. Therefore, when designing a hardware accelerator, the functions that need to be implemented are generally split, and the business process in each scenario is turned into a combination of independent sub-processes as much as possible, and then a dedicated hardware acceleration module is designed for each sub-process , called subengines.
  • Sub-engines are often reused in different user scenarios, that is, a sub-engine will be used in multiple user scenarios. The difference is that the task parameters of the sub-engine, the position of the sub-engine in the business process, and other sub-engines that make up the process may be different. .
  • a RAID accelerator in a storage server can implement various scenarios such as RAID0/1/5/6, and splitting these scenarios into sub-processes can obtain a DMA module, a storage page allocation/recycling module, and a disk read/write module , XOR calculation module, finite field calculation module and other functional modules.
  • RAID0/1 the above sub-engines 1 to 3 are required, and the two scenarios have different sub-engine task parameters.
  • sub-engines 1 to 4 are required, and for RAID6, sub-engine 1 is required. to 5.
  • the hardware accelerator realizes the functions of different user scenarios by combining different sub-engines at runtime. For the read/write sub-scenario of each of the above scenarios, the order of the sub-engines in the data stream is also different.
  • the hardware accelerator first schedules the storage page allocation module to allocate a piece of data cache space; then schedules the disk read/write module to read data from the disk into the above cache space, and complete the RAID0 data in the cache space Organize and sort; then, call the DMA module to move the data from the cache space to the host-side memory; finally, call the storage page recovery module to reclaim the cache space.
  • the scheduling of the sub-engine by the hardware accelerator is implemented by a module called a parser and a module called a scheduler.
  • a parser and a module called a scheduler.
  • the parser and the scheduler can be implemented by software or hardware. The following is given Provide an example of implementation.
  • the parser parses the command from the host according to the user scenario, decomposes it into several subtasks, each subtask corresponds to a subengine, and organizes these subtasks into a list in order.
  • the scheduler is used to dispatch subtasks to subengines. It reads a subtask entry in the task list, and then sends it to the corresponding subengine according to the type of the subtask entry.
  • the scheduler distributes subtasks to subengines
  • the sub-engine processes the source data, and at the same time writes the processed data into the designated data buffer area;
  • the sub-engine When all the data is processed, the sub-engine notifies the scheduler
  • the scheduler takes out the next task from the task queue and dispatches it to the next sub-engine;
  • the IO delay is high. Since the start and end times of the subtasks are connected end to end, the IO delay is equal to the sum of the delays of all subtasks. When the number of subtasks is large or the task data block size is large, IO latency often becomes unacceptable.
  • the capacity or bandwidth of the data cache is high. Since the data cache area needs to cache a complete data block output by a sub-engine, for relatively large IO operations, such as the entire strip write operation of RAID5, MB-level cache is often required , if the on-chip SRAM is used, it will bring high costs, and if the off-chip DRAM is used, it is often difficult to meet the bandwidth requirements because it needs to be accessed by all sub-engines.
  • Another type of traditional hardware accelerator is implemented by cascading sub-engines, that is, the data output port of sub-engine 1 is connected to the data input port of sub-engine 2, and so on.
  • the sub-engine 1 When the sub-engine 1 outputs the first data, the sub-engine 2 can start to work, and the engines generally adopt FIFO interface or other streaming data interface.
  • the hardware accelerator using this method can obtain very low latency, because the engines work in a pipelined manner; at the same time, there is no need for a large-capacity data cache, because the engines use a streaming interface.
  • this traditional method has a major shortcoming, which is poor versatility and cannot handle complex scenes. Because this method requires direct data exchange between sub-engines, the connection relationship between sub-engines is relatively fixed.
  • an embodiment of the present application proposes a task scheduling method, including the following steps:
  • the parser In response to receiving the delivered task, the parser is used to divide the task into multiple subtasks and generate a subtask list, wherein the task parameters corresponding to each subtask are recorded in the subtask list and the task parameters include the next The start phase of the subtask;
  • the corresponding sub-engine executes the corresponding pending sub-task according to the received task parameter
  • the parser, the scheduler and multiple sub-engines are connected by an interconnection bus.
  • the initial value of the first counter is set according to the size of the cache space of each sub-engine, and the initial value of the second counter is set to 0.
  • the first counter in the sub-engine that sends the data request is subtracted from the data size to be requested in the data request, and the other sub-engines that receive the data request Add the size of the data to be requested in the data request to the second counter in the data request, wherein the size of the data to be requested in the data request is not larger than the size of the corresponding cache space.
  • the working phase is the same as the start phase in the received task parameter, sending a notification to the scheduler, further comprising:
  • the corresponding sub-engine saves the start phase in the task parameters in a first preset register
  • the comparator compares the current working phase with the start phase in the preset register
  • the comparator In response to the current working phase being the same as the starting phase in the preset register, the comparator sends a notification to the scheduler.
  • the comparator notifies the scheduler, further comprising:
  • the comparator writes preset content into the second preset register
  • an embodiment of the present application also provides a chip, including a digital logic circuit, and when the digital logic circuit works, it implements task scheduling as described in any of the above-mentioned embodiments method steps.
  • an embodiment of the present application further provides an electronic device, including the aforementioned chip.
  • the technical solution proposed by the present application can realize that subtasks with a sequence relationship partially or completely overlap in execution time, therefore, compared with the traditional method, it can save all the tasks between the two engines with a sequence. overlap time between.
  • the solution proposed in this application can reduce the delay to 1/N.
  • FIG. 1 is a schematic diagram of an interaction mode between a scheduler and a sub-engine in the prior art
  • FIG. 2 is a schematic flowchart of a task scheduling method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a connection structure between a scheduler, a parser, and a sub-engine provided by an embodiment of the present application;
  • FIG. 4 is a schematic diagram of the phase of the sub-engine provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of task scheduling implemented by a scheduler provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a counter provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 2 shows a schematic flow chart of the task scheduling method provided by the embodiment of the present application. As shown in FIG. 2 , it may include steps:
  • the corresponding sub-engine executes a corresponding pending sub-task according to the received task parameter
  • the working phase is the same as the start phase in the received task parameter, sending a notification to the scheduler;
  • the technical solution proposed in the present application can realize partial or complete overlap of execution time of subtasks with sequence relationship, so compared with the traditional method, it can save all overlapping time between two engines with sequence.
  • the solution proposed in this application can reduce the delay to 1/N.
  • the method also includes:
  • the resolver, the scheduler and multiple sub-engines are connected by an interconnection bus.
  • FIG. 3 shows a schematic diagram of the connection structure between the scheduler, the parser, and the sub-engines provided by the embodiment of the present application.
  • the parser, the scheduler, the task cache, and multiple sub-engines Interconnection buses can be used to replace the dedicated interfaces between sub-engines to achieve better versatility.
  • the interconnection bus can be based on standard protocols such as AMBA, or a self-defined bus protocol; in terms of implementation, various topologies such as Crossbar, Mesh, or Ring can be used.
  • the characteristic of an interconnection bus is that any two components connected to the bus can, if necessary, achieve mutual access.
  • the interconnection bus is used not only to carry control flows such as commands scheduled by sub-engines, but also to carry data flows between sub-engines.
  • step S1 in response to receiving the issued task, the parser is used to divide the task into multiple subtasks and generate a subtask list, wherein the subtask corresponding to each subtask is recorded in the subtask list Task parameters and the task parameters include the start phase of the next sub-task.
  • FIG. 4 shows a schematic diagram of the phase of the sub-engine provided by the embodiment of the application of the present invention.
  • one of the sub-engines can be The task process is defined as many phases, and the number of phases and the duration of each phase vary according to the engine type and task.
  • a task process of sub-engine 1 can be phase 1, phase 2, and so on. Phase N1.
  • Each phase corresponds to different stages of the task. For example, for a DMA operation of moving data from the host to the local, it can be divided into sending address linked list read command, waiting for address linked list, receiving address linked list, sending data read command, waiting for data, receiving data Wait a few stages.
  • Two sub-engines with data flow sequence the latter sub-engine can start to execute at a certain phase start point or end point of the previous sub-engine.
  • Two sub-engines can also start at the same time, that is, the latter sub-engine starts executing at the starting point of phase 1 of the previous sub-engine, for example, as shown in Figure 4, phase 1 of sub-engine 3 starts at the starting point of phase 1 of sub-engine 2 Start execution at the starting point; or, like the traditional method, the latter sub-engine executes at the end of the last phase of the previous sub-engine. Due to the time overlap between the engines, the present application reduces the delay compared with the traditional method.
  • the phases of the sub-engines and tasks are pre-defined.
  • the parser parses the IO command into a list of sub-tasks, it includes the start phase of each engine in the task parameters of its previous sub-engine. .
  • step S4 a notification is sent to the scheduler in response to the corresponding working phase of the corresponding sub-engine executing the corresponding subtask to be processed is the same as the start phase in the received task parameter , further including:
  • the corresponding sub-engine saves the start phase in the task parameters in a first preset register
  • the comparator compares the current working phase with the start phase in the preset register
  • the comparator In response to the current working phase being the same as the starting phase in the preset register, the comparator sends a notification to the scheduler.
  • FIG. 5 shows a schematic diagram of the scheduler implementing task scheduling provided by the embodiment of the present application.
  • sub-engine 1 shown by arrow 2 in Figure 5
  • the sub-engine receives the task, it can store the start phase of the next task in the internal register.
  • a phase comparator circuit is implemented inside the sub-engine, and the task execution logic outputs the current working phase. This phase is compared with the initial phase saved in the register. If it is equal to or exceeds the initial phase, the comparator will send an event notification to the scheduler (shown by arrow 3 in Figure 5), and the scheduler will obtain the next phase according to the event notification.
  • Task parameters shown by arrow 4 in FIG. 5
  • a subtask for example, subtask 2.
  • step S4 the comparator notifies the scheduler, further comprising:
  • the comparator writes preset content into the second preset register
  • the notification can be implemented by writing specific information to the designated register of the scheduler, and the scheduler realizes event capture by detecting the write action on the bus and discriminating the written content. After the scheduler captures the event, it dispatches the next task to the corresponding sub-engine, and so on.
  • the initial value of the first counter is set according to the size of the cache space of each sub-engine, and the initial value of the second counter is set to 0.
  • Fig. 6 shows a schematic diagram of the counter provided by the embodiment of the present application.
  • the present application implements the data cache in the sub-engine internal.
  • Each sub-engine implements a small block of data cache, and at the same time, the size of the cache is smaller than the size of the data block processed by a sub-task.
  • the traditional method requires a data cache equal in size to the subtask data block, which is an essential difference between the present application and the traditional method.
  • the required cache will be much smaller than the subtask data block size, but the specific cache size can be determined according to specific design requirements.
  • the source sub-engine (the sub-engine that receives the data request) does not actively send data to the target sub-engine ( The sub-engine that sends the data request) sends data, but needs to wait for the data request sent by the target sub-engine. Different from the special data interface adopted by the traditional method, the signal connection is used for handshaking.
  • the target sub-engine writes the requested data block size to the designated register of the source sub-engine through the interconnection bus.
  • the source sub-engine detects the write action of the bus to the specified register, saves the request, and then sends data not exceeding the size to the target sub-engine.
  • each sub-engine can be a source sub-engine or a target engine, so two counters are set in each sub-engine.
  • the first counter in the sub-engine that sends the data request is subtracted from the data size to be requested in the data request, and the other sub-engines that receive the data request Add the size of the data to be requested in the data request to the second counter in the data request, wherein the size of the data to be requested in the data request is not larger than the size of the corresponding cache space.
  • a counter needs to be implemented in the target sub-engine to save the remaining size of the current data cache.
  • the first counter works according to the following rules:
  • the initial value of the counter is set to the size of the data cache
  • the second counter works according to the following rules:
  • the initial value is set to 0;
  • the core of the above method or a similar method is that at any time, the total size of the data requests sent by the target sub-engine to the source sub-engine does not exceed the size of the data cache, and the amount of data sent by the source sub-engine to the target sub-engine does not exceed the requested amount .
  • the DMA sub-engine is used to obtain source data from the host through the PCIe bus;
  • the stripe unit distribution sub-engine (hereinafter referred to as the distribution sub-engine), is used to correspond continuous data to the stripe unit;
  • the disk page size is 4KB, and the data memory on the host side is not continuous, it is organized with an address list:
  • the parser parses the IO into 4 tasks, namely:
  • DMA move 256KB data from the host to the accelerator
  • Distribution split 256KB data into two 128KB data blocks, and output to two different target caches
  • Disk write 1 write the first 128KB data block to disk 1;
  • Disk write 2 write the second 128KB data block to disk 2;
  • the parser then configures the start phase as follows:
  • the start phase of the disk write 1 sub-engine is set to the start of the distribution sub-engine, and this phase is written into the task parameters of the distribution sub-engine;
  • the start phase of the disk write 2 sub-engine is set to the moment when the disk write 1 sub-engine receives 2KB data, and this phase is written to the task parameters of the disk write 1 sub-engine;
  • the DMA sub-engine After the DMA sub-engine receives the task, it saves the start phase of the distribution sub-engine in the internal register, and then requests the address link list from the host through the PCIe bus. After receiving the request, the host sends the address link list to the DMA sub-engine through the PCIe bus; When the sub-engine receives the first address linked list data, it is the same as the start phase in the register, so it sends a notification to the scheduler, requesting to dispatch the next task to the distribution sub-engine; the sub-engine saves the received address linked list in the internal cache .
  • the distribution sub-engine After the distribution sub-engine receives the task, it writes the start phase of the sub-engine to the disk and saves it in the internal register, and then starts execution; at the beginning of execution, the comparator recognizes that the phase at this time is the same as the register, and then notifies the scheduler , requesting to write to disk 1 sub-engine to dispatch the next task.
  • the scheduler dispatches the next task to the disk write 1 sub-engine, and the disk write 1 sub-engine saves the start phase of the disk write 2 sub-engine in the internal register.
  • the distribution sub-engine initializes the first counter to 4KB according to its own cache size (assumed to be 1 data page size, or smaller); then, the data processing logic sends a 4KB data request to the DMA sub-engine, and the first counter reduce to 0;
  • the DMA sub-engine receives the 4KB data request, and adds the second counter to 4KB; then the data processing logic sends the DMA data read request to the host one or more times according to the contents of the address list; the host sends the data to the distribution sub-engine through the PCIe bus engine address;
  • the disk write 1 sub-engine also initializes the first counter to 4KB according to its own cache size (assumed to be the size of 1 data page); then the distribution sub-engine sends a 4KB data request;
  • the distribution sub-engine receives the data from the DMA, sends it to the data processing module, and then outputs it to the disk and writes 1 sub-engine, every time a sub-engine writes 1 byte to the disk, the second counter is decremented by 1, and the first counter is incremented by 1 ; In order to ensure the bus utilization rate of PCIe, whenever the first counter is greater than 1KB, the distribution sub-engine requests data once from the DMA sub-engine;
  • the disk write 1 sub-engine writes the received data to the disk page by page, and when 2KB of data is processed, it sends a notification to the scheduler, requesting the disk write 2 sub-engine to dispatch tasks;
  • the disk write 2 sub-engine After the disk write 2 sub-engine receives the task, it requests 4KB data from the distribution sub-engine;
  • the distribution sub-engine processes the data of the second page (this page needs to be written to disk 2 in RAID0), and sends the data to the disk to write to the 2 sub-engine; and the disk writes to the 2 sub-engine to write to disk 2;
  • the solution proposed in this application connects the sub-engines with a general-purpose interconnection bus, and schedules the sub-engines through the task list and the scheduler, so as to ensure that the scheduler can schedule the sub-engines in any order and realize the processing of complex scenarios. And it is proposed to split the tasks of the sub-engines into multiple working phases, and achieve the purpose of reducing the delay by overlapping the working phases between the sub-engines. Different from the traditional method, the next sub-engine starts to work after one sub-engine is completely finished, and there may be multiple sub-engines serving the same IO task. And the start phase of the next task is saved in the previous sub-engine, and the sub-engine is judged, and then the scheduler is notified to schedule the next sub-engine.
  • the target sub-engine When processing tasks, the target sub-engine sends a request for data blocks to the source sub-engine through the interconnection bus, which is different from the traditional method of using signal line connection to achieve flow control, and also different from the traditional method of using bus interconnection without using flow control.
  • This method can realize the use of a data cache smaller than the size of a data block, thereby reducing costs.
  • FIG. 7 shows a schematic structural diagram of a chip provided by the embodiment of the present application.
  • the embodiment of the present application also provides a chip 501, include:
  • a digital logic circuit 510 is included, and the digital logic circuit 510 implements the steps of the task scheduling method described in any one of the above-mentioned embodiments when working.
  • FIG. 8 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application. As shown in FIG. 8, an embodiment of the present application also provides an electronic device 601, including the aforementioned chip 610.
  • a computer-readable storage medium eg, memory
  • the storage medium may be a read-only memory, a magnetic disk or an optical disk, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请公开了一种任务调度方法,包括以下步骤:响应于接收到下发的任务,利用解析器将任务分成多个子任务并生成子任务列表,其中子任务列表中记录每一个子任务对应的任务参数且任务参数包括下一个子任务的开始相位;利用调度器将子任务列表中待处理子任务的任务参数发送给相应的子引擎;相应的子引擎根据接收到的任务参数执行对应的待处理子任务;响应于相应的子引擎执行对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向调度器发出通知;响应于调度器检测到通知,返回利用调度器将子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤。通过上述技术方案实现了具有先后关系的子任务在执行时间上部分或者全部重叠。

Description

一种任务调度方法、芯片以及电子设备
本申请要求在2021年09月24日提交中国专利局、申请号为202111118002.7、发明名称为“一种任务调度方法、芯片以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及加速架构领域,具体涉及一种任务调度方法、芯片以及电子设备。
背景技术
随着大数据、AI、5G等新兴产业的迅速发展,产生的海量数据将呈指数级增长,数据处理对算力的需求日益增加。在摩尔定律和登纳德缩放定律的共同作用下,引领芯片行业30年的飞速发展,随着摩尔定律放缓,登纳德缩放定律失效,通用CPU的算力提升已经无法满足当前数据中心对算力增长的需求。基于领域定制(DSA)的异构计算,采用各种加速器来完成对特点业务的加速,从而达到提升系统算力和降低成本的目的,最典型的就是深度学习加速器,不管是采用GPU、FPGA还是各类NPU,相对于单纯CPU的解决方案,可以将系统的算力提升数倍。
领域定制的硬件加速器针对某一业务领域设计,业务领域往往包含多种用户场景,在每种场景下,硬件加速器需要实现不同功能,但这些功能往往具有相似或者公共的特性。因此,硬件加速器在设计时,一般将需要实现的功能进行拆分,将各个场景下的业务流程尽可能的变成各个独立的子流程的组合,再针对每一个子流程设计专用的硬件加速模块,称为子引擎。
子引擎往往在不同的用户场景间复用,即多种用户场景都会使用某子引擎,不同的是子引擎的任务参数、子引擎在业务流程中的位置和组成该流程的其他子引擎可能不同。
例如,一个存储服务器中的RAID加速器,可实现RAID0/1/5/6等多种场景,将这 些场景进行子流程的拆分可以得到DMA模块、存储页分配/回收模块、磁盘读/写模块、异或计算模块、有限域计算模块等功能模块。对于RAID0/1,需要用到上述子引擎1至3,且这两种场景具有不同的子引擎的任务参数,对于RAID5,需要用到子引擎1至4,对于RAID6,需要用到子引擎1至5。
硬件加速器通过在运行时组合不同的子引擎来实现不同的用户场景的功能,对于上述每一种场景的读/写子场景,子引擎在数据流中的顺序也有区别。
例如,对于RAID0的读操作,硬件加速器首先调度存储页分配模块分配一块数据缓存空间;然后调度磁盘读/写模块从磁盘中读取数据放入上述缓存空间,并在缓存空间中完成RAID0的数据组织和排序;然后,调用DMA模块将数据从缓存空间搬移到主机端内存中;最后,调用存储页回收模块对缓存空间进行回收。而对于RAID0的写操作,则需要在调用存储页分配模块后,先调用DMA模块从主机端将数据搬移到缓存空间并完成数据的组织和排序,然后再调用磁盘读/写模块将缓存空间的数据依次写入磁盘,最后同样需要进行缓存空间的回收。因此,对于RAID0的读写场景,都使用子引擎1至3,但是读的调用顺序是2-3-1-2,而写的顺序是2-1-3-2.
硬件加速器对子引擎的调度使用一种被称为解析器和一种被称为调度器的模块实现,解析器和调度器的实现方式有多种,可以采用软件也可以采用硬件实现,以下给出一种实现范例。
解析器根据用户场景对来自主机端的命令进行解析,将它分解为若干个子任务,每一个子任务对应一个子引擎,并按顺序将这些子任务组织成列表。调度器用来将子任务派发到子引擎,它读取任务列表中的一个子任务条目,然后根据该子任务条目的类型,将它发送给对应的子引擎。
如图1所示,现有的调度器与子引擎的交互方式一般按以下步骤进行:
1、调度器将子任务分发给子引擎;
2、子引擎拿到任务后,从指定的数据缓存区中读取数据;
3、子引擎将源数据进行处理,同时将处理后的数据写入指定的数据缓存区;
4、当所有的数据都处理完成后,子引擎通知调度器;
5、调度器从任务队列中取出下一个任务,并派发给下一个子引擎;
6、重复步骤2至5,直到所有的步骤执行完。
上述传统的方法有多种实现形式,但一般有以下几个特征:一个子任务完成后,子引擎通知调度器,然后再开始下一个任务;每个子任务的数据缓存区需要能容纳该子任务的所有输出数据;
但该方法也存在比较明显的缺点:
1、IO延迟较高,由于子任务的起止时间首尾相接,IO延迟等于所有子任务的延迟的和。当子任务数目较多或者任务数据块大小较大时,IO延迟往往会变得难以接受。
2、对数据缓存的容量或者带宽要求较高,由于数据缓存区需要缓存一个子引擎输出的完整数据块,对于比较大的IO操作,例如RAID5的整条带写入操作往往需要MB级别的缓存,如果采用片内SRAM,会带来高昂的成本,如果采用片外DRAM,由于需要被所有的子引擎共同访问,带宽要求往往难以满足。
另一类传统的硬件加速器采用级联子引擎的方式实现,即子引擎1的数据输出端口接子引擎2的数据输入端口,并以此类推。当子引擎1输出第一个数据时,子引擎2即可以开始工作,引擎之间一般采用FIFO接口或其他的流式数据接口。采用这种方式的硬件加速器能获得很低的延迟,因为引擎之间采用流水线的方式工作;同时,也不需要大容量的数据缓存,因为引擎间采用流式接口。但是,这种传统的方法存在一个较大的缺点,通用性比较差,无法处理复杂的场景。因为采用这种方法,需要子引擎间直接交换数据,因此,子引擎的连接关系相对固定。即使采用数据选择器,也只能支持少数的可选项,并且,引擎之间的数据流顺序无法改变,因此,一般只能支持处理步骤相对较少,流程相对固定的简单场景,无法实现诸如上述RAID加速的场景。
发明内容
有鉴于此,为了克服上述问题的至少一个方面,本申请实施例提出一种任务调度方法,包括以下步骤:
响应于接收到下发的任务,利用解析器将所述任务分成多个子任务并生成子任务列表,其中所述子任务列表中记录每一个子任务对应的任务参数且所述任务参数包括下一个子任务的开始相位;
利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎;
所述相应的子引擎根据接收到的所述任务参数执行对应的待处理子任务;
响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向所述调度器发出通知;
响应于所述调度器检测到所述通知,返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤。
在一些实施例中,还包括:
利用互联总线将所述解析器、所述调度器以及多个子引擎连接。
在一些实施例中,还包括:
在每一个子引擎中分别初始化第一计数器、第二计数器以及预设大小的缓存空间;
根据每一个子引擎的缓存空间的大小设置所述第一计数器的初始值,并将所述第二计数器的初始值设置为0。
在一些实施例中,还包括:
响应于子引擎向其他子引擎发送数据请求,将发送所述数据请求的子引擎中的第一计数器减去所述数据请求中待请求的数据大小,并将接收所述数据请求的其他子引擎中的第二计数器加上所述数据请求中待请求的数据大小,其中,所述数据请求中待请求的数据大小不大于对应的缓存空间的大小。
在一些实施例中,还包括:
响应于所述接收所述数据请求的其他子引擎根据接收到的所述数据请求向所述发送所述数据请求的子引擎输出数据,将所述接收所述数据请求的其他子引擎中的第二计数器减去输出数据的大小;
响应于所述发送所述数据请求的子引擎接收到所述接收所述数据请求的其他子引擎输出的数据,对所述输出的数据进行处理并将所述发送所述数据请求的子引擎中的第一计数器加上已进行处理的数据大小。
在一些实施例中,还包括:
响应于所述发送所述数据请求的子引擎中的第一计数器的大小达到预设值,继续向 其他子引擎发送数据请求。
在一些实施例中,响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向所述调度器发出通知,进一步包括:
所述相应的子引擎将所述任务参数中的开始相位保存在第一预设寄存器;
响应于所述相应的子引擎执行所述对应的待处理子任务时向比较器输出当前的工作相位;
所述比较器比较当前的工作相位与预设寄存器中的开始相位;
响应于当前的工作相位与预设寄存器中的开始相位相同,所述比较器向所述调度器发出通知。
在一些实施例中,所述比较器向所述调度器发出通知,进一步包括:
所述比较器向第二预设寄存器写入预设内容;
响应于所述调度器检测到写入动作,获取并根据第二预设寄存器中的内容进行判别以确定是否返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤,进而将下一个待处理子任务的任务参数发送给相应的子引擎。
基于同一发明构思,根据本申请的另一个方面,本申请的实施例还提供了一种芯片,包括数字逻辑电路,所述数字逻辑电路工作时实现如上述任一项实施例所述的任务调度方法的步骤。
基于同一发明构思,根据本申请的另一个方面,本申请的实施例还提供了一种电子设备,包括上述所述的芯片。
本申请具有以下有益技术效果:本申请提出的技术方案能够实现具有先后关系的子任务在执行时间上部分或者全部重叠,因此,相比于传统方法,能节省所有具有先后顺序的两个引擎之间的重叠时间。一般来说,对于需要N个子引擎的任务,本申请提出的方案可以将延迟降低到1/N。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为现有技术中调度器与子引擎之间的交互方式示意图;
图2为本申请的实施例提供的任务调度方法的流程示意图;
图3为本申请的实施例提供的调度器、解析器以及子引擎之间的连接结构示意图;
图4为本申请的实施例提供的子引擎的相位示意图;
图5为本申请的实施例提供的调度器实现任务调度的示意图;
图6为本申请的实施例提供的计数器的示意图;
图7为本申请的实施例提供的芯片的结构示意图;
图8为本申请的实施例提供的电子设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本申请实施例进一步详细说明。
需要说明的是,本申请实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”、“第二”仅为了表述的方便,不应理解为对本申请实施例的限定,后续实施例对此不再一一说明。
根据本申请的一个方面,本申请的实施例提出一种任务调度方法,图2示出了本申请的实施例提供的任务调度方法的流程示意图,如图2所示,其可以包括步骤:
S1,响应于接收到下发的任务,利用解析器将所述任务分成多个子任务并生成子任务列表,其中所述子任务列表中记录每一个子任务对应的任务参数且所述任务参数包括下一个子任务的开始相位;
S2,利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎;
S3,所述相应的子引擎根据接收到的所述任务参数执行对应的待处理子任务;
S4,响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到 的任务参数中的开始相位相同,向所述调度器发出通知;
S5,响应于所述调度器检测到所述通知,返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤。
本申请提出的技术方案能够实现具有先后关系的子任务在执行时间上部分或者全部重叠,因此,相比于传统方法,能节省所有具有先后顺序的两个引擎之间的重叠时间。一般来说,对于需要N个子引擎的任务,本申请提出的方案可以将延迟降低到1/N。
在一些实施例中,方法还包括:
利用互联总线连接所述解析器、所述调度器以及多个子引擎。
具体的,图3示出了本发明申请的实施例提供的调度器、解析器以及子引擎之间的连接结构示意图,如图3所示,解析器、调度器、任务缓存、多个子引擎之间可以采用互连总线连接,以此取代子引擎间的专用接口,获得更好的通用性。互连总线可以采用基于AMBA等标准协议,也可以采用自定义的总线协议;实现方式上可以采用Crossbar、Mesh或Ring等多种拓扑结构。互连总线的特点在于,连接在总线上的任意两个组件,如果必要,均可以实现互相访问。在本申请中,互连总线既用来承载子引擎调度的命令等控制流,也用来承载子引擎之间数据流。
在一些实施例中,步骤S1中,响应于接收到下发的任务,利用解析器将所述任务分成多个子任务并生成子任务列表,其中所述子任务列表中记录每一个子任务对应的任务参数且所述任务参数包括下一个子任务的开始相位,具体的,图4示出了本发明申请的实施例提供的子引擎的相位示意图,如图4所示,可以将子引擎的一个任务过程定义为很多个相位,相位的数量和每个相位的时间长度根据引擎类型和任务而不同,例如,如图4所示,子引擎1的一个任务过程可以是相位1、相位2一直到相位N1。每个相位对应任务的不同阶段,例如,对于一次从主机搬移数据至本地的DMA操作,可以分为发送地址链表读命令、等待地址链表、接收地址链表、发送数据读命令、等待数据、接收数据等几个阶段。
具有数据流先后顺序的2个子引擎,后一个子引擎可以在前一个子引擎的某一个相位起始点或结束点开始执行。两个子引擎也可以同时开始,即后一个子引擎在前一个子引擎的相位1的起始点开始执行,例如,如图4所示,子引擎3的相位1在子引擎2的 相位1的起始点开始执行;也可以像传统方法一样,后一个子引擎在前一个子引擎的最后一个相位结束时执行。由于引擎之间在时间上存在交叠,本申请相比传统方法减少了延时。
针对不同的子引擎类型和任务预先定义好该子引擎和任务的相位,解析器在将IO命令解析为子任务列表时,将各引擎的开始相位包含在它的前一个子引擎的任务参数中。
在一些实施例中,步骤S4中,响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向所述调度器发出通知,进一步包括:
所述相应的子引擎将所述任务参数中的开始相位保存在第一预设寄存器;
响应于所述相应的子引擎执行所述对应的待处理子任务时向比较器输出当前的工作相位;
所述比较器比较当前的工作相位与预设寄存器中的开始相位;
响应于当前的工作相位与预设寄存器中的开始相位相同,所述比较器向所述调度器发出通知。
具体的,图5示出的是本发明申请的实施例提供的调度器实现任务调度的示意图,如图5所示,首先调度器获取到子任务(例如子任务1)的任务参数(即图5中箭头1所示),然后将其发送到子引擎1中(图5中箭头2所示),子引擎接到任务后,将下一个任务的开始相位可以保存在内部寄存器中。子引擎内部实现一个相位比较器电路,任务执行逻辑输出当前的工作相位。该相位与寄存器中保存的起始相位比较,如果等于或已超过起始相位,比较器将向调度器发出事件通知(图5中箭头3所示),调度器则根据事件通知,获取下一个子任务(例如子任务2)的任务参数(图5中箭头4所示)。
在一些实施例中,步骤S4中,所述比较器向所述调度器发出通知,进一步包括:
所述比较器向第二预设寄存器写入预设内容;
响应于所述调度器检测到写入动作,获取并根据第二预设寄存器中的内容进行判别以确定是否返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤,进而将下一个待处理子任务的任务参数发送给相应的子引擎。
具体的,通知可以向调度器指定寄存器写入特定信息实现,调度器通过检测总线上的写入动作并对写入内容进行判别来实现事件的捕获。调度器捕获到该事件后,将下一个任务派发给相应的子引擎,并以此类推。
在一些实施例中,还包括:
在每一个子引擎中分别初始化第一计数器、第二计数器以及预设大小的缓存空间;
根据每一个子引擎的缓存空间的大小设置所述第一计数器的初始值,并将所述第二计数器的初始值设置为0。
具体的,图6示出了本发明申请的实施例提供的计数器的示意图,如图6所示,为了减少对数据缓存的容量和带宽的要求,降低成本,本申请将数据缓存实现在子引擎内部。每个子引擎实现一小块数据缓存,同时,缓存大小小于一个子任务处理的数据块大小。传统的方法需要与子任务数据块大小相等的数据缓存,这是本申请与传统方法的一个本质区别。一般来说,采用本申请的方法,所需缓存将远小于子任务数据块大小,但具体的缓存大小,可以根据具体的设计需求确定。
为了实现小的数据缓存处理大的数据块而不发生溢出,本申请利用两个计数器实现一种被动流控的方法,源子引擎(接收数据请求的子引擎)并不主动向目标子引擎(发送数据请求的子引擎)发送数据,而是需要等待目标子引擎发出的数据请求。区别于传统方法所采用的专用数据接口用信号连线进行握手,目标子引擎通过互连总线,向源子引擎的指定的寄存器写入此次请求的数据块大小。源子引擎检测到总线对指定寄存器的写入动作,将该请求保存下来,然后向目标子引擎发送不超过该大小的数据。
需要说明的是,每一个子引擎均可以作为源子引擎,也可以作为目标引擎,因此每一个子引擎中均设置两个计数器。
在一些实施例中,还包括:
响应于子引擎向其他子引擎发送数据请求,将发送所述数据请求的子引擎中的第一计数器减去所述数据请求中待请求的数据大小,并将接收所述数据请求的其他子引擎中的第二计数器加上所述数据请求中待请求的数据大小,其中,所述数据请求中待请求的数据大小不大于对应的缓存空间的大小。
在一些实施例中,还包括:
响应于所述接收所述数据请求的其他子引擎根据接收到的所述数据请求向所述发送所述数据请求的子引擎输出数据,将所述接收所述数据请求的其他子引擎中的第二计数器减去输出数据的大小;
响应于所述发送所述数据请求的子引擎接收到所述接收所述数据请求的其他子引擎输出的数据,对所述输出的数据进行处理并将所述发送所述数据请求的子引擎中的第一计数器加上已进行处理的数据大小。
具体的,为了实现被动流控,目标子引擎内需要实现一个计数器用来保存当前数据缓存的剩余大小,该剩余大小并不是数据缓存当前时刻的剩余大小,而是还需要包含已发出请求,但数据还未到达缓存的部分。第一计数器按如下规则工作:
1、计数器的初始值设置为数据缓存的大小;
2、每当数据处理逻辑发出数据请求后,该计数器减去请求值;
3、每当数据处理逻辑处理完一个数据,该计数器加1;
4、数据处理逻辑的数据请求大小不能超过计数器的当前值;
同时,源子引擎内部也需要实现一个计数器,用来保存待输出的数据量,第二计数器按如下规则工作:
1、初始值设置为0;
2、每当接收到数据请求,计数器加上该请求大小;
3、每当输出一个数据,计数器减1;
4、只要计数器不为0,输出控制逻辑就可以继续向目标子引擎输出,否则需要暂停。
上述方法或类似的方法,其核心在于,在任意时刻,目标子引擎向源子引擎发送的数据请求的总大小不超过数据缓存大小,源子引擎向目标子引擎发送的数据量不超过请求量。
在一些实施例中,还包括:
响应于所述发送所述数据请求的子引擎中的第一计数器的大小达到预设值,继续向其他子引擎发送数据请求。
具体的,为了保证的总线利用率,可以当目标子引擎中的第一计数器增加到预设值 后,继续向其他子引擎发送数据请求。
下面以一个RAID加速器的2磁盘RAID0写入场景为例,说明本申请的实施方式。
一个RAID0的写入,需要用到:
DMA子引擎,用来通过PCIe总线从主机获取源数据;
条带单元分发子引擎(以下简称分发子引擎),用来将连续数据对应到条带单元;
2个磁盘写入子引擎,用来将对应条带单元的数据写入磁盘;
解析器和调度器,这两个电路与传统用法一致。
上述子引擎通过AXI总线连接在一起,引擎间没有专用的连线。
假设主机向RAID加速器发出一个256KB的RAID0写入IO,磁盘页大小为4KB,主机端数据内存不连续,用地址链表进行组织:
首先,解析器将该IO解析为4个任务,分别为:
DMA:从主机端搬移256KB数据到加速器内部;
分发:将256KB数据拆分为2个128KB的数据块,并向2个不同的目标缓存输出;
磁盘写入1:将第一个128KB数据块写入磁盘1;
磁盘写入2:将第二个128KB数据块写入磁盘2;
然后,解析器进行如下的开始相位配置:
分发子引擎的开始相位设置为地址链表获取后,该相位写入DMA子引擎的任务参数;
磁盘写入1子引擎的开始相位设置为分发子引擎的开始,该相位写入分发子引擎任务参数;
磁盘写入2子引擎的开始相位设置为磁盘写入1子引擎接收2KB数据时刻,该相位写入磁盘写入1子引擎的任务参数;
DMA子引擎收到任务后,将分发子引擎的开始相位保存在内部寄存器,然后,通过PCIe总线向主机端请求地址链表,主机收到请求后,通过PCIe总线将地址链表发往DMA子引擎;子引擎在收到第一个地址链表数据时,与寄存器内的开始相位相同,于 是向调度器发出通知,要求向分发子引擎派发下一个任务;子引擎将收到的地址链表保存在内部缓存。
分发子引擎收到任务后,将磁盘写入1子引擎的开始相位保存在内部寄存器,然后开始执行;在刚开始执行时,比较器识别此时的相位与寄存器相同,然后向调度器发出通知,要求向磁盘写入1子引擎派发下一个任务。
调度器向磁盘写入1子引擎派发下一个任务,磁盘写入1子引擎将磁盘写入2子引擎的开始相位保存在内部寄存器。
分发子引擎根据自身缓存大小(假设为1个数据页大小,也可以更小),将第一计数器初始化为4KB;然后,数据处理逻辑向DMA子引擎发出4KB的数据请求,并将第一计数器减至0;
DMA子引擎收到4KB数据请求,将第二计数器加至4KB;然后数据处理逻辑根据地址链表的内容,分一次或多次向主机发出DMA数据读请求;主机将数据通过PCIe总线发往分发子引擎地址;
磁盘写入1子引擎也根据自身缓存大小(假设为1个数据页大小),将第一计数器初始化为4KB;然后分发子引擎发出4KB的数据请求;
分发子引擎收到来自DMA的数据,送往数据处理模块,然后输出给磁盘写入1子引擎,每向磁盘写入1子引擎输出1字节,第二计数器减1,第一计数器加1;为了保证PCIe的总线利用率,每当第一计数器大于1KB时,分发子引擎向DMA子引擎请求一次数据;
磁盘写入1子引擎将接收的数据按页写入磁盘,在处理到2KB数据时,向调度器发出通知,要求向磁盘写入2子引擎派发任务;
磁盘写入2子引擎收到任务后,向分发子引擎请求4KB数据;
分发子引擎处理第2页的数据(该页在RAID0时需要写入磁盘2),并将该数据发往磁盘写入2子引擎;并由磁盘写入2子引擎写入磁盘2;
重复上述步骤,直到一个IO操作完成。
本申请提出的方案,通过子引擎间使用通用互连总线相连,通过任务列表和调度器 进行子引擎调度,以此保证调度器可以以任意的顺序调度子引擎,实现对复杂场景的处理。并且提出将子引擎的任务拆分为多个工作相位,通过子引擎之间的工作相位交叠,达到降低延迟的目的。区别于传统方法在一个子引擎完全结束后下一个子引擎才开始工作,同时可能存在多个子引擎服务于同一个IO任务。并且将下一个任务的开始相位保存在上一个子引擎中,并由该子引擎进行判断,然后通知调度器调度下一个子引擎。处理任务时由目标子引擎通过互联总线向源子引擎发出数据块的请求,区别于传统方法采用信号线连接的方法实现流控,也区别于传统的采用总线互连时不使用流控。本方法可以实现使用小于数据块大小的数据缓存,以此降低成本。
基于同一发明构思,根据本申请的另一个方面,图7示出了本发明申请的实施例提供的芯片的结构示意图,如图7所示,本申请的实施例还提供了一种芯片501,包括:
包括数字逻辑电路510,所述数字逻辑电路510工作时实现如上述任一项实施例所述的任务调度方法的步骤。
基于同一发明构思,根据本申请的另一个方面,图8示出了本发明申请的实施例提供的电子设备的结构示意图,如图8所示,本申请的实施例还提供了一种电子设备601,包括上述所述的芯片610。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。
此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现本申请的功能,但是这种实现决定不应被解释为导致脱离本申请实施例公开的范围。
以上是本申请公开的示例性实施例,但是应当注意,在不背离权利要求限定的本申 请实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本申请实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
上述本申请实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本申请实施例公开的范围(包括权利要求)被限于这些例子;在本申请实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本申请实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本申请实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本申请实施例的保护范围之内。

Claims (10)

  1. 一种任务调度方法,其特征在于,包括以下步骤:
    响应于接收到下发的任务,利用解析器将所述任务分成多个子任务并生成子任务列表,其中所述子任务列表中记录每一个子任务对应的任务参数且所述任务参数包括下一个子任务的开始相位;
    利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎;
    所述相应的子引擎根据接收到的所述任务参数执行对应的待处理子任务;
    响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向所述调度器发出通知;
    响应于所述调度器检测到所述通知,返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤。
  2. 如权利要求1所述的方法,其特征在于,还包括:
    利用互联总线连接所述解析器、所述调度器以及多个子引擎。
  3. 如权利要求1所述的方法,其特征在于,还包括:
    在每一个子引擎中分别初始化第一计数器、第二计数器以及预设大小的缓存空间;
    根据每一个子引擎的缓存空间的大小设置所述第一计数器的初始值,并将所述第二计数器的初始值设置为0。
  4. 如权利要求3所述的方法,其特征在于,还包括:
    响应于子引擎向其他子引擎发送数据请求,将发送所述数据请求的子引擎中的第一计数器减去所述数据请求中待请求的数据大小,并将接收所述数据请求的其他子引擎中的第二计数器加上所述数据请求中待请求的数据大小,其中,所述数据请求中待请求的数据大小不大于对应的缓存空间的大小。
  5. 如权利要求4所述的方法,其特征在于,还包括:
    响应于所述接收所述数据请求的其他子引擎根据接收到的所述数据请求向所述发送所述数据请求的子引擎输出数据,将所述接收所述数据请求的其他子引擎中的第二计数器 减去输出数据的大小;
    响应于所述发送所述数据请求的子引擎接收到所述接收所述数据请求的其他子引擎输出的数据,对所述输出的数据进行处理并将所述发送所述数据请求的子引擎中的第一计数器加上已进行处理的数据大小。
  6. 如权利要求5所述的方法,其特征在于,还包括:
    响应于所述发送所述数据请求的子引擎中的第一计数器的大小达到预设值,继续向其他子引擎发送数据请求。
  7. 如权利要求1所述的方法,其特征在于,响应于所述相应的子引擎执行所述对应的待处理子任务时的工作相位与接收到的任务参数中的开始相位相同,向所述调度器发出通知,进一步包括:
    所述相应的子引擎将所述任务参数中的开始相位保存在第一预设寄存器;
    响应于所述相应的子引擎执行所述对应的待处理子任务时向比较器输出当前的工作相位;
    所述比较器比较当前的工作相位与预设寄存器中的开始相位;
    响应于当前的工作相位与预设寄存器中的开始相位相同,所述比较器向所述调度器发出通知。
  8. 如权利要求7所述的方法,其特征在于,所述比较器向所述调度器发出通知,进一步包括:
    所述比较器向第二预设寄存器写入预设内容;
    响应于所述调度器检测到写入动作,获取并根据第二预设寄存器中的内容进行判别以确定是否返回利用调度器将所述子任务列表中待处理子任务的任务参数发送给相应的子引擎的步骤,进而将下一个待处理子任务的任务参数发送给相应的子引擎。
  9. 一种芯片,其特征在于,包括数字逻辑电路,所述数字逻辑电路工作时实现如权利要求1至8任一项所述的方法的步骤。
  10. 一种电子设备,其特征在于,包括如权利要求9所述的芯片。
PCT/CN2022/074613 2021-09-24 2022-01-28 一种任务调度方法、芯片以及电子设备 WO2023045203A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/280,215 US20240143392A1 (en) 2021-09-24 2022-01-28 Task scheduling method, chip, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111118002.7 2021-09-24
CN202111118002.7A CN113568731B (zh) 2021-09-24 2021-09-24 一种任务调度方法、芯片以及电子设备

Publications (1)

Publication Number Publication Date
WO2023045203A1 true WO2023045203A1 (zh) 2023-03-30

Family

ID=78174201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/074613 WO2023045203A1 (zh) 2021-09-24 2022-01-28 一种任务调度方法、芯片以及电子设备

Country Status (3)

Country Link
US (1) US20240143392A1 (zh)
CN (1) CN113568731B (zh)
WO (1) WO2023045203A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568731B (zh) * 2021-09-24 2021-12-28 苏州浪潮智能科技有限公司 一种任务调度方法、芯片以及电子设备
CN113900828B (zh) * 2021-12-08 2022-03-04 深圳致星科技有限公司 联邦学习专用处理器、联邦学习处理芯片及芯片
CN115220418A (zh) * 2021-12-09 2022-10-21 广州汽车集团股份有限公司 一种车辆远程控制方法及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1895453A1 (en) * 2006-08-31 2008-03-05 Siemens Aktiengesellschaft Method and apparatus for performing a business process of a service provider
CN103458527A (zh) * 2012-06-01 2013-12-18 中兴通讯股份有限公司 前导检测任务处理调度方法及装置
CN105677455A (zh) * 2014-11-21 2016-06-15 深圳市中兴微电子技术有限公司 一种设备调度方法及任务管理器
CN106293919A (zh) * 2016-08-12 2017-01-04 中国航空工业集团公司西安飞行自动控制研究所 一种时间触发的嵌入式任务调度装置与方法
CN111431892A (zh) * 2020-03-20 2020-07-17 上海金卓网络科技有限公司 一种加速器管理架构、方法及加速器接口控制器
CN112835692A (zh) * 2021-01-12 2021-05-25 山东众阳健康科技集团有限公司 一种日志消息驱动任务方法、系统、存储介质及设备
CN113568731A (zh) * 2021-09-24 2021-10-29 苏州浪潮智能科技有限公司 一种任务调度方法、芯片以及电子设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206387B2 (en) * 2003-08-21 2007-04-17 International Business Machines Corporation Resource allocation for voice processing applications
CN105487838B (zh) * 2015-11-23 2018-01-26 上海交通大学 一种动态可重构处理器的任务级并行调度方法与系统
CN110780985A (zh) * 2019-09-25 2020-02-11 苏州浪潮智能科技有限公司 一种有限时间的并行任务调度方法与装置
CN111290868B (zh) * 2020-03-02 2024-03-15 中国邮政储蓄银行股份有限公司 任务处理方法、装置和系统以及流程引擎
CN111722910B (zh) * 2020-06-19 2023-07-21 广东石油化工学院 一种云作业调度及资源配置的方法
CN112596910B (zh) * 2020-12-28 2024-02-20 广东电网有限责任公司电力调度控制中心 一种多用户mec系统中的云计算资源调度方法
CN113342532B (zh) * 2021-06-25 2023-03-21 深圳前海微众银行股份有限公司 基于Zookeeper的分布式任务调度方法及系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1895453A1 (en) * 2006-08-31 2008-03-05 Siemens Aktiengesellschaft Method and apparatus for performing a business process of a service provider
CN103458527A (zh) * 2012-06-01 2013-12-18 中兴通讯股份有限公司 前导检测任务处理调度方法及装置
CN105677455A (zh) * 2014-11-21 2016-06-15 深圳市中兴微电子技术有限公司 一种设备调度方法及任务管理器
CN106293919A (zh) * 2016-08-12 2017-01-04 中国航空工业集团公司西安飞行自动控制研究所 一种时间触发的嵌入式任务调度装置与方法
CN111431892A (zh) * 2020-03-20 2020-07-17 上海金卓网络科技有限公司 一种加速器管理架构、方法及加速器接口控制器
CN112835692A (zh) * 2021-01-12 2021-05-25 山东众阳健康科技集团有限公司 一种日志消息驱动任务方法、系统、存储介质及设备
CN113568731A (zh) * 2021-09-24 2021-10-29 苏州浪潮智能科技有限公司 一种任务调度方法、芯片以及电子设备

Also Published As

Publication number Publication date
US20240143392A1 (en) 2024-05-02
CN113568731A (zh) 2021-10-29
CN113568731B (zh) 2021-12-28

Similar Documents

Publication Publication Date Title
WO2023045203A1 (zh) 一种任务调度方法、芯片以及电子设备
TWI229259B (en) A method and related apparatus and computer program product for distributed memory control and bandwidth optimization
US8108571B1 (en) Multithreaded DMA controller
EP1046999B1 (en) Transfer controller with hub and ports architecture
JP5610636B2 (ja) トラフィッククラスと関連するポートをもつマルチポートのメモリコントローラ
US20090300324A1 (en) Array type processor and data processing system
US20130054901A1 (en) Proportional memory operation throttling
CN113918101B (zh) 一种写数据高速缓存的方法、系统、设备和存储介质
CN103019810A (zh) 具有不同执行优先级的计算任务的调度和管理
CN115033188B (zh) 一种基于zns固态硬盘的存储硬件加速模块系统
JP2009238197A (ja) 共有メモリの制御回路、制御方法及び制御プログラム
US20150268985A1 (en) Low Latency Data Delivery
US20210026651A1 (en) Wake-up and scheduling of functions with context hints
CN114827048A (zh) 一种动态可配高性能队列调度方法、系统、处理器及协议
US11237994B2 (en) Interrupt controller for controlling interrupts based on priorities of interrupts
CN108958903B (zh) 嵌入式多核中央处理器任务调度方法与装置
US8209492B2 (en) Systems and methods of accessing common registers in a multi-core processor
US7028116B2 (en) Enhancement of transaction order queue
US20210208890A1 (en) Extended memory operations
JP5058116B2 (ja) ストリーミングidメソッドによるdmac発行メカニズム
CN108958905B (zh) 嵌入式多核中央处理器的轻量级操作系统
US10366019B1 (en) Multiprocessor system having efficient and shared atomic metering resource
US10365681B1 (en) Multiprocessor system having fast clocking prefetch circuits that cause processor clock signals to be gapped
US10191867B1 (en) Multiprocessor system having posted transaction bus interface that generates posted transaction bus commands
CN108958904B (zh) 嵌入式多核中央处理器的轻量级操作系统的驱动程序框架

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22871270

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18280215

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE