WO2017131187A1 - Accelerator control device, accelerator control method and program - Google Patents

Accelerator control device, accelerator control method and program Download PDF

Info

Publication number
WO2017131187A1
WO2017131187A1 PCT/JP2017/003028 JP2017003028W WO2017131187A1 WO 2017131187 A1 WO2017131187 A1 WO 2017131187A1 JP 2017003028 W JP2017003028 W JP 2017003028W WO 2017131187 A1 WO2017131187 A1 WO 2017131187A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
data
accelerator
memory
subtask
Prior art date
Application number
PCT/JP2017/003028
Other languages
French (fr)
Japanese (ja)
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 US16/070,312 priority Critical patent/US10831547B2/en
Priority to JP2017563868A priority patent/JP6897574B2/en
Publication of WO2017131187A1 publication Critical patent/WO2017131187A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3877Concurrent instruction execution, e.g. pipeline or look ahead using a slave processor, e.g. coprocessor
    • 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/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • 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/5044Allocation 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 hardware capabilities

Definitions

  • the present invention is based on the priority claim of Japanese patent application: Japanese Patent Application No. 2016-015352 (filed on Jan. 29, 2016), the entire contents of which are incorporated herein by reference. Shall.
  • the present invention relates to an accelerator control device, an accelerator control method, and a program, and more particularly, to an accelerator control device, an accelerator control method, and a program that control computation using an accelerator.
  • Patent Document 1 describes an example of an accelerator control device. As shown in FIG. 22, the accelerator control device described in Patent Document 1 is configured by an information processing device 8.
  • the information processing apparatus 8 includes a shared memory 81 and a plurality of accelerators 821 to 823 connected to the shared memory 81.
  • the shared memory 81 holds data processed by the accelerators 821 to 823.
  • the accelerators 821 to 823 perform processing on the data moved from the shared memory 81 to the memories (not shown) of the accelerators 821 to 823.
  • the accelerators 821 to 823 move the processed data from their own memory to the shared memory 81 again. These data movement and processing are repeated until the desired processing is completed.
  • the number of nodes can be reduced to 1/10 by using an accelerator equipped with a GPU (Graphical Processing Unit) or the like instead of employing the cluster technology.
  • an accelerator when an accelerator is used, the memory capacity is reduced to 1/1000 compared to the cluster technology. Therefore, out-of-core processing involving data exchange between the shared memory (or main memory) and the accelerator memory is increased, which does not fit in the accelerator memory (accelerator memory).
  • processing performance and memory capacity change from these values in the case of cluster technology as follows: Processing performance: 100 gigaflops (CPU: Central Processing Unit) ⁇ 1 teraflop (GPU) Memory capacity: 1 terabyte (CPU) ⁇ 10 gigabyte (GPU)
  • the I / O (Input / Output) bandwidth for inputting / outputting data to / from the accelerator is extremely narrow compared with the calculation performance of the GPU.
  • the I / O bandwidth is 32 gigabytes / second (GB / s) for a computing performance of 1 teraflop (TFlop). Therefore, data I / O between the accelerator memory and the main memory may become a bottleneck in speeding up the processing.
  • An object of the present invention is to provide an accelerator control device, an accelerator control method, and a program that contribute to solving such a problem.
  • or objective of this invention become clear in description of the form for implementing invention mentioned later.
  • the accelerator control device includes a task storage unit that holds an executable task, and a task that has a relatively small amount of input / output data to and from the memory when executed on the accelerator.
  • a data scheduler that instructs the accelerator to prepare for data input / output in the memory for the selected task, and instructs the accelerator to execute the selected task.
  • a task scheduler that adds a task that can be executed upon completion of the selected task to the task storage unit, and the data scheduler executes execution held by the task storage unit in accordance with the use state of the memory Select the next task from the available tasks and select the next task To continue the preparation of the data input and output.
  • the amount of input / output data to the memory is relatively small when the executable task is stored in the storage unit and executed on the accelerator having the memory. Selecting a task from the executable tasks, instructing the accelerator to prepare for data input / output in the memory for the selected task, and instructing the accelerator to execute the selected task Adding a task that can be executed upon completion of the selected task to the storage unit, and selecting a next task from among the executable tasks held by the storage unit according to the use state of the memory. Selecting and continuing to prepare for data input / output for the next selected task.
  • the program according to the third aspect of the present invention includes a process for holding an executable task in a storage unit, and a task having a relatively small amount of input / output data to the memory when executed on an accelerator having a memory. Selecting from the executable tasks, instructing the accelerator to prepare for data input / output in the memory for the selected task, and completing the data input / output preparation in the memory, the selected task.
  • the accelerator is instructed to execute the task, and a process for adding a task that can be executed upon completion of the selected task to the storage unit, and an execution held by the storage unit in accordance with the use status of the memory Selecting the next task from the possible tasks, and continuing to prepare for data I / O for the selected next task; To be executed by a computer.
  • the program can also be provided as a program product recorded in a non-transitory computer-readable storage medium.
  • the accelerator control device According to the accelerator control device, the accelerator control method, and the program according to the present invention, it is possible to speed up the task processing using the accelerator having the memory.
  • FIG. 1 It is a flowchart which illustrates operation
  • FIG. 1 is a block diagram illustrating the configuration of an accelerator control device 10 according to an embodiment.
  • the accelerator control device 10 includes a task storage unit 11, a data scheduler 12, and a task scheduler 13.
  • the task storage unit 11 holds executable tasks (for example, the tasks shown in FIG. 10 or the subtasks shown in FIGS. 11 and 12).
  • the data scheduler 12 executes the above-described task with a relatively small amount of input / output data to the memory (for example, the smallest) when executing on an accelerator having a memory (for example, an accelerator having the accelerator memory of FIG. 8). Select from the possible tasks and instruct the accelerator to prepare for data input / output in the memory for the selected task.
  • the task scheduler 13 instructs the accelerator to execute the selected task (for example, when preparation for data input / output in the memory is completed), and a task that can be executed upon completion of the selected task (for example, FIG.
  • a task 72) that can be executed upon completion of the ten tasks 71 is added to the task storage unit 11.
  • the data scheduler 12 selects the next task from among the executable tasks held by the task storage unit 11 and prepares data input / output for the selected next task in accordance with the use state of the memory. continue.
  • the accelerator control device 10 selects a task with a relatively small amount of data input / output to / from the memory of the accelerator as the next task, and selects the selected task according to the use status of the memory (for example, when there is a margin).
  • Adopt a configuration that continues preparation for data input / output.
  • the input / output amount of data between the accelerator memory and the external memory can be reduced, and at the same time, the I / O bandwidth between the accelerator memory and the external memory can be effectively used. Therefore, according to the accelerator control device 10, it is possible to speed up the task processing using the accelerator having a memory.
  • FIG. 2 is a diagram illustrating the operation of the accelerator control device 10 shown in FIG. FIG. 2A illustrates a DAG (Directed Acyclic Graph, directed acyclic graph) indicating the processing of the user program.
  • DAG Directed Acyclic Graph, directed acyclic graph
  • each node of the DAG represents a subtask (see FIGS. 11 and 12) obtained by dividing the task.
  • the task scheduler 13 and the data scheduler 12 are operating in parallel.
  • the task scheduler 13 loads the executable subtasks “1” to “3” in the executable list of the task storage unit 11.
  • the data scheduler 12 selects a subtask having the smallest I / O to the accelerator (or accelerator memory) of the input data from the executable list held by the task storage unit 11, and the I / O of the data necessary for the execution of the subtask. O is performed. For example, when only the input data of the subtask “2” is cached in the accelerator memory, the data scheduler 12 selects the subtask “2”. Further, the data scheduler 12 deletes the entry of the selected subtask “2” from the executable list in the task storage unit 11.
  • the data scheduler 12 completes the input data I / O and output memory allocation for executing the subtask “2”, locks the memory area, and sends the subtask to the task scheduler 13. Notify that execution of “2” is possible.
  • the data scheduler 12 selects a subtask to be subjected to the next I / O from the executable list in the task storage unit 11.
  • the data scheduler 12 selects the subtask “1”.
  • the task scheduler 13 executes the subtask “2”.
  • the task scheduler 13 completes the execution of the subtask “2” and notifies the data scheduler 12 of the completion of the execution of the subtask “2”.
  • the data scheduler 12 unlocks the input / output data of the subtask “2”.
  • the subtask “5” can be executed, so the task scheduler 13 loads the subtask “5” in the executable list of the task storage unit 11.
  • the same processing is performed by the parallel operation of the task scheduler 13 and the data scheduler 12.
  • the data scheduler 12 performs the above process for each accelerator.
  • the data scheduler 12 selects the subtask that minimizes the data input / output amount to the memory of the accelerator as the next task, and performs data input / output for the selected subtask.
  • the data scheduler 12 selects the subtask that minimizes the data input / output amount to the memory of the accelerator as the next task, and performs data input / output for the selected subtask.
  • Continue preparation As a result, data input / output between the accelerator memory and the external memory can be reduced, and the I / O bandwidth between the accelerator memory and the external memory can be effectively utilized.
  • FIG. 3 is a block diagram illustrating another configuration of the accelerator control device 10 according to an embodiment.
  • the task storage unit 11 includes a first storage unit 14 that holds a task that is an executable task (or subtask) and whose execution destination accelerator is not limited, and the execution destination accelerator is limited.
  • the data scheduler 12 includes a task that the first storage unit 14 holds a task that has a relatively small amount of input / output data to and from the memory when executed on the accelerator (for example, a minimum), and a second Are selected from the tasks held in the storage unit 15 whose execution destination is restricted to the accelerator.
  • the first storage unit 14 holds the most upstream task or a task for which all upstream tasks have been executed.
  • the second storage unit 15 at least one of the upstream tasks is waiting to be executed by the accelerator as a task whose execution destination accelerator is restricted (that is, preparation for data input / output is completed and executed by the accelerator) And the task that has completed the execution of all the remaining upstream tasks is held.
  • FIG. 4 is a diagram for explaining the operation of the accelerator control device 10 shown in FIG.
  • accelerators 51 to 5N N is a natural number
  • the first storage unit 14 holds subtasks whose execution destination accelerators are not limited.
  • the subtasks accumulated in the first storage unit 14 and the second storage unit 15 are in the “I / O wait” state.
  • the data scheduler 12 is a subtask (Ready Sub Tasks) in which the first storage unit 14 holds subtasks having the smallest input / output data amount to the memory when executed on an accelerator (for example, an accelerator corresponding to GPU 1), Further, the subtask is held by the second storage unit 15 and the execution destination is selected from the subtasks limited to the accelerator (for example, GPU 1 Ready Sub Tasks).
  • the subtask selected by the data scheduler 12 is stored in the queue (FIFO: First-In First-Out) for the corresponding GPU when the data input / output preparation for the subtask (I / O in FIG. 4) is completed. "Waiting" state.
  • the subtasks stored in the queue are sequentially executed by the GPU of the corresponding accelerator (for example, GPU 1) (Processing in FIG. 4), and when the execution is completed, the state is “execution complete”.
  • FIG. 5 is a diagram illustrating the operation of the accelerator control device 10 shown in FIG. FIG. 5A illustrates a DAG indicating the processing of the user program.
  • each node of the DAG represents a subtask obtained by dividing a task.
  • the data scheduler 12 (or the task scheduler 13) has the subtask “5” that can be executed when the subtask “2” is completed at the timing when the subtask “2” is awaiting execution in the accelerator. Is added to the Local queue corresponding to the accelerator (or GPU) held by the second storage unit 15.
  • the data scheduler 12 refers to the executable list held in the first storage unit 14 and the local queue corresponding to the accelerator (or GPU) to be scheduled held in the second storage unit 15 when the subtask is scheduled. From the subtasks held in the list or queue, the subtask having the smallest input / output data amount to the memory when executed on the accelerator is selected. Here, since the operation is serialized in each accelerator, there is no problem even if the subtask “5” is selected in the state shown in FIG. The data scheduler 12 does not consider other accelerators in the selection of subtasks.
  • the data scheduler 12 selects the subtask “5” and there is a subtask that can be executed upon completion of the subtask “5”
  • the data queue 12 further selects a local queue for the corresponding accelerator (or GPU).
  • the task scheduler 13 has a corresponding entry in the Local Queue held by the second storage unit 15 (that is, a subtask whose execution destination accelerator is not limited, for example, a subtask in which all upstream subtasks have been executed). If the entry exists, the entry is moved from the second storage unit 15 to the executable list held by the first storage unit 14.
  • the accelerator control device 10 illustrated in FIG. 3 is limited in the first storage unit 14 that holds the most upstream task or the task for which all upstream tasks have been executed, and the execution destination accelerator.
  • As a task at least one of the upstream tasks is waiting to be executed by the accelerator, and the second storage unit 15 holds a task for which all the remaining upstream tasks have been executed.
  • the accelerator control device 10 also includes a task that the first storage unit 14 holds a task having the smallest amount of input / output data to the memory when the data scheduler 12 executes on the accelerator, and a second storage unit 15. Is selected from the tasks whose execution destination is restricted to the accelerator. This makes it possible to further speed up the task processing using the accelerator having the memory. This is because the data scheduler 12 is a candidate for a task that starts the preparation of input / output data for a subsequent task that can be executed upon completion of the task at the time of execution waiting before the task is completed. Because it can be.
  • FIG. 6 is a diagram for explaining the operation of the comparative example. Referring to FIG. 6, in the comparative example, input data is prepared and an output memory area is secured in order for subtasks that have been completed and are ready to be executed.
  • FIG. 7 is a diagram for explaining the effect of the accelerator control device 10 according to the embodiment.
  • DAG data A to C are each divided into N data partitions (N is a natural number).
  • tasks A and B are each divided into N subtasks.
  • the subtasks STa1 to STaN are applied to the data partitions DPa1 to DPaN
  • the same result as that obtained when the subtasks STa1 to STaN are not divided that is, when the task A is applied to the data A
  • the accelerator control device 10 after the subtasks STa1 and STb1 are executed, the subtasks STa2 and STb2 can be executed. No swap (Swap, ie, I / O) occurs for DPbx). Therefore, according to one embodiment, data I / O between the accelerator and the main memory can be reduced as compared with the comparative example, and the processing speed can be increased.
  • FIG. 8 is a block diagram illustrating the configuration of the accelerator control device 1 according to this embodiment.
  • the accelerator control device 1 includes accelerators 51 to 53, a main memory 4, an accelerator control unit 3, a user program 21, and a DAG (Directed Acyclic Graph) creation unit 22.
  • the accelerator control device 1 is realized by a host computer as an example.
  • the user program 21 may be configured outside the accelerator control device 1.
  • Accelerators 51 to 53 execute calculation processing.
  • the main memory 4 is a memory for saving data that cannot be held due to a shortage of memory resources of the accelerators 51 to 53.
  • the accelerator control unit 3 controls the accelerators 51 to 53.
  • the DAG creation unit 22 creates a DAG (Directed Acyclic Graph) indicating the processing of the user program 21 by calling an API (Application Programming Interface) of the user program 21 and transmits it to the accelerator control unit 3.
  • DAG Directed Acyclic Graph
  • the number of accelerators is three for convenience of explanation. However, the number of accelerators should just be one or more, and is not limited to the aspect of illustration. Examples of the accelerator include, but are not limited to, GPU (Graphical Processing Unit) from NVIDIA, Xeon Phi from Intel, and the like.
  • the accelerator is a coprocessor of a CPU (Central Processing ⁇ Unit) of the computer, and is implemented, for example, by being inserted into an I / O (Input / Output) slot of the computer.
  • the accelerator 51 includes a processor 511 that processes data and an accelerator memory 521 that stores data.
  • the local memory included in the accelerator is referred to as an accelerator memory.
  • the user program 21 is an application program created by a programmer (user) using the accelerators 51 to 53 or an application program executed by the user.
  • the user program 21 is implemented using an API provided by the DAG creation unit 22 as an example.
  • the API provided by the DAG creation unit 22 includes, for example, two types of APIs, a reservation API and an execution API, as shown in FIG.
  • the reservation API corresponds to one of the tasks (or processes) of the DAG shown in FIG.
  • the DAG creation unit 22 adds one task to the DAG and data generated by the task. For example, in FIG. 10, when the task 71 is called for the data 61 using the reservation API, the DAG creation unit 22 adds the task 71 and its output data 62 to the DAG.
  • the reservation API is an API for reserving a task. That is, immediately after the reservation API is called, no tasks are executed in the accelerators 51 to 53, and only a DAG is generated.
  • a new task and data generated by the task may or may not be added to the DAG.
  • calling the execution API triggers the execution of a DAG task generated so far.
  • the tasks belonging to the execution API include a case where data after the DAG is processed in the user program 21 and a case of a storeObject that holds data as a data object in the accelerator memory.
  • the reservation API and execution API may have one or more arguments ⁇ , ⁇ , ⁇ ,... As shown in FIG.
  • One of these arguments may be a kernel function.
  • the kernel function is a function indicating processing executed by the user program 21 on data. Whether an API takes a function as an argument depends on the type of reservation API or execution API.
  • the reservation API and the execution API indicate patterns of processing performed on the data, and actual specific processing is performed in the user program 21 by a kernel function given as an argument of the reservation API and the execution API.
  • map An example of an API that takes a kernel function as an argument is map.
  • a kernel function is applied to all elements constituting input data.
  • the DAG input data is, for example, an image or a database table.
  • map is applied to these data, the kernel function is applied individually to each pixel of the image and each entry in the database.
  • APIs that do not require kernel functions include, for example, storeObject, appendObject, and read.
  • storeObject is an API that stores the calculation result as a data object in the accelerator memories 521 to 523. According to storeObject, it is possible to name data stored as data objects in the accelerator memories 521 to 523. At this time, the name of the object is passed as an argument of storeObject.
  • appendObject is an API used when adding data to the end of an existing object.
  • “read” is an API for acquiring the contents of the data object existing on the accelerators 51 to 53 in the user space.
  • each data of the DAG may be composed of two or more divisions (data partitions) as shown in FIG.
  • FIG. 11 shows an example in which the data is composed of two data partitions in the data 61, task 71, data 62, task 72, and data 63 of the DAG in FIG.
  • the task 71 is applied to both the data partition 61-1 and the data partition 61-2, the same result as the processing when the data 61 is not divided can be obtained.
  • This is a process that belongs to the processing mode of data parallel in parallel calculation and is generally known among engineers in the technical field to which the present invention belongs.
  • FIG. 11 shows an example in which the data is composed of two data partitions in the data 61, task 71, data 62, task 72, and data 63 of the DAG in FIG.
  • the processing for the data partition 61-1 is described as a subtask 71-1, etc., but the processing content of the subtask 71-1 is the same as the task 71 in FIG. Further, the processing for a plurality of divisions (data partitions) may be executed by different accelerators in a distributed manner.
  • FIG. 12 shows a case where the data 61 is divided into data partitions 61-1 to 61-4.
  • the data partition 61-1 and the data partition 61-2 are processed by the accelerator 51.
  • the data partition 61-3 and the data partition 61-4 are processed by the accelerator 52.
  • the calculation performance is doubled.
  • the data partition in the following description means the original data itself before the division, and the subtask for the data partition means the task for the original data.
  • the DAG creation unit 22 generates a DAG every time the user program 21 calls a reservation API and an execution API.
  • the DAG creation unit 22 adds processing corresponding to the DAG and output data.
  • the execution API when the execution API is called, the DAG creation unit 22 adds DAG processing and output data if necessary, and notifies the accelerator control unit 3 of the DAG generated so far.
  • the DAG created by the DAG creation unit 22 includes the type of reservation API and execution API called by the user program 21 and the kernel function assigned to each API.
  • the DAG creation unit 22 transmits the identifier of the user program 21 when notifying the DAG.
  • the DAG creation unit 22 transmits the identifier of the user program 21 to the accelerator control unit 3, and intermediate data other than the data specified by the storeObject among the data generated by the user program 21 Request to erase data.
  • FIG. 13 is a block diagram illustrating the configuration of the accelerator control unit 3 of the accelerator control device 1 shown in FIG.
  • the accelerator control unit 3 includes a program analysis unit 31, a task processing unit 32, a subtask storage unit 36, a data management unit 33, a data management table 34, and a memory management table 35.
  • the program analysis unit 31 analyzes the DAG indicating the processing of the user program 21 received from the DAG creation unit 22.
  • the task processing unit 32 executes DAG processing.
  • the subtask storage unit 36 classifies and holds subtasks included in the DAG that can be executed and those that can be executed.
  • the data management unit 33 manages and prepares data necessary for DAG processing.
  • the memory management table 35 manages the memory of the accelerator.
  • the data management table 34 manages data on the memory of the accelerator.
  • the memory management table 35 is a table for managing the accelerator memories 521 to 523.
  • the accelerator memories 521 to 523 are divided into pages of a certain size and managed.
  • the page size is, for example, 4 KB or 64 KB.
  • the memory management table 35 holds information about each page as an entry.
  • the information of each page includes an accelerator number to which the page belongs, a page number, an in-use flag indicating that the page is in use, and an identifier of data held by the page when the page is in use.
  • the in-use flag and the lock flag are Boolean values.
  • the data identifier is assigned to DAG data.
  • the in-use flag is “1” when the page is in use, and “0” otherwise.
  • the lock flag is “1” when page release is prohibited, and “0” otherwise.
  • page 1 of the accelerator memory 521 held by the accelerator 51 is used by the data partition 62-1 (that is, the first data partition of the data 61).
  • This page is locked because it is currently being used for calculations. Note that the data held by the locked page cannot be saved in the main memory 4.
  • the data management table 34 manages data on the accelerator memories 521 to 523. As shown in FIG. 15, the data management table 34 holds information about data in the DAG transmitted from the user program 21. Each entry includes a data number, a partition number of each data, a calculated flag indicating whether the data has been calculated, a swap flag indicating that the data has been saved in the main memory 4, and the data The accelerator number indicating the accelerator number that holds and the page number of the accelerator that holds the data are held.
  • the calculated flag and the swap flag are Boolean values.
  • the calculated flag is “1” when it has been calculated, and “0” otherwise.
  • the swap flag is “1” when the data is saved in the main memory 4, and is “0” otherwise.
  • the first data partition that is, the data partition 62-1
  • the accelerator memory of the accelerator 51 This indicates that the data is held on page 1 of 521.
  • the corresponding entry in the memory management table 35 is referred to retrieve the page information used by each data, or lock the page when used for calculation. It becomes possible to do.
  • the program analysis unit 31 analyzes the DAG indicating the user process received from the DAG creation unit 22 and divides it into data and tasks.
  • the program analysis unit 31 creates an entry in the data management table 34 for the data in the DAG.
  • the program analysis unit 31 creates a number of entries corresponding to the number of data partitions. At the time of data entry creation, calculation of each data partition has not yet been performed, so the calculated flag in the data management table 34 is “0”.
  • the program analysis unit 31 does not need to newly create these data entries. Further, the calculated flag of these entries is set to “1” in the data management table 34.
  • the program analysis unit 31 requests the task processing unit 32 to execute processing divided into units of DAG “tasks”.
  • the program analysis unit 31 makes a subtask request for each DAG task according to the number of data partitions. Further, the program analysis unit 31 cancels the in-use flag in the memory management table 35 of the page used by the deleted entry (for example, changes the in-use flag from “1” to “0”), The accelerator memories 521 to 523 are released.
  • the data management unit 33 includes a data scheduler 331 and a data moving unit 332.
  • the data scheduler 331 instructs management of data held in the accelerator memories 521 to 523 and reservation of the memory.
  • the data moving unit 332 loads data to the accelerators 51 to 53 and secures the accelerator memories 521 to 523.
  • the data scheduler 331 manages the accelerator memory 521 of the accelerator 51 with reference to the memory management table 35.
  • the data scheduler 331 also manages the other accelerators 52 and 53 in the same manner. Further, the data scheduler 331 receives a request for input data and output data necessary for executing the subtask from the task processing unit 32.
  • the identifier of the data object held in the accelerator memory is specified as input data.
  • the subtask to be executed is a subtask other than the first subtask, if the previous subtask in the DAG has been completed, the output data of that subtask has already been calculated. In any case, if the swap flag of the corresponding entry in the data management table 34 is “0”, those data partitions have not been saved in the main memory 4, so that the preparation is completed on the accelerator memory.
  • the data scheduler 331 prepares the data partition in the accelerator memory.
  • the data scheduler 331 refers to the memory management table 35 and confirms whether any of the accelerators 51 to 53 has enough free pages to load the saved data partition. If there are enough free pages, the data scheduler 331 requests the data moving unit 332 to load the saved data into the free pages. On the other hand, if there are not enough free pages, the data scheduler 331 refers to the data management table 34 and the memory management table 35, selects a data partition held by an unlocked page, and saves the data partition to the main memory 4.
  • the data transfer unit 332 is requested as follows.
  • the data scheduler 331 makes a save request in units of data partitions. Thereby, since a memory for loading input data can be secured, the data scheduler 331 notifies the data moving unit 332 to load the data partition of the input data.
  • the data scheduler 331 refers to the memory management table 35 and secures the memory if the number of pages necessary for the output data of the subtask requested by the task processing unit 32 can be secured from the free page.
  • the data moving unit 332 is requested.
  • the data scheduler 331 also designates an accelerator that secures a page.
  • the data scheduler 331 performs the same operation as the above-described case of securing memory for loading the saved input data. That is, the data scheduler 331 first notifies the data moving unit 332 to save the data partition held by the unlocked page on the accelerator memory to the main memory 4, and then outputs the output data to the data moving unit 332 Ensure the number of pages to do.
  • the data scheduler 331 requests the data moving unit 332 to lock the memory area for input data and output data. Further, the data scheduler 331 receives a processing completion notification from the task processing unit 32, unlocks the page locked by the data moving unit 332, and sets the calculated flag of output data in the data management table 34 to “1”. To be set to.
  • the task scheduler 321 requests to execute, only one of the input data and the output memory area may be prepared. For example, it is not necessary to prepare an output memory area for a read execution request for acquiring the contents of a data object.
  • the data moving unit 332 receives an instruction from the data scheduler 331, secures the memory of the accelerator, and moves data to the accelerator.
  • the data moving unit 332 receives the instruction from the data scheduler 331, secures the accelerator memory, and registers the memory page entry secured in the memory management table 35. In addition, the data moving unit 332 registers the accelerator number and page number corresponding to the reserved memory in the data partition entry of the data management table 34.
  • the data moving unit 332 receives an instruction from the data scheduler 331 and sets the lock flag of the page being used for calculation to “1”. Further, the data moving unit 332 releases the lock flag of the page for which calculation has been completed from “1” to “0”. Further, the data moving unit 332 sets the calculated flag of the output data to “1” in the data management table 34.
  • the data moving unit 332 receives the instruction from the data scheduler 331 and saves the data partition to the main memory 4. In this case, the data migration unit 332 sets the swap flag of the entry in the data management table 34 of the saved data partition. In addition, the data migration unit 332 releases the in-use flag of the entry in the memory management table 35 of the page used by the saved data partition.
  • the task processing unit 32 includes a task scheduler 321 and a task execution unit 322.
  • the task scheduler 321 requests a memory area for input data and output data necessary for execution of the subtask, and requests execution of the subtask.
  • the task execution unit 322 causes the accelerators 51 to 53 to execute the subtask.
  • the task scheduler 321 receives an execution request for a subtask included in the DAG from the program analysis unit 31.
  • the task scheduler 321 receives a request in units of processing execution for the data partition.
  • the task scheduler 321 executes the subtasks in order from the upstream of the DAG among the subtasks included in the received request.
  • the subtask 71 corresponds to the upstream subtask.
  • the downstream (next stage) subtask cannot be executed.
  • the task scheduler 321 requests the data scheduler 331 for memory areas for input data and output data necessary for each subtask to be executed.
  • the task scheduler 321 receives the data and memory area reservation completion for the subtask requested from the data scheduler 331, and then receives the accelerator number, input data address, and output data necessary to execute the subtask corresponding to the task execution unit 322.
  • the write address or entry information of the data management table 34 and the memory management table 35 necessary to know the information is notified, and the task execution unit 322 is caused to execute the subtask. This process is performed in units of data partitions.
  • the task scheduler 321 passes the information to be added to the task execution unit 322. This data is included when the program analysis unit 31 receives the DAG of the user program 21.
  • the task scheduler 321 receives the subtask completion notification from the task execution unit 322, and when the subtask is completed, notifies the data scheduler 331 to unlock the input data and the output data.
  • the task scheduler 321 acquires the data from the task execution unit 322 that executed the read and acquires the data Data is transmitted to the user program 21 through the program analysis unit 31.
  • the task execution unit 322 receives an instruction from the task scheduler 321, and processes the specified input address and output address of the accelerator specified using the kernel function of the user program 21 received from the task scheduler 321. Also, the task execution unit 322 notifies the task scheduler 321 of the completion of processing. If the requested subtask is appendObject, the task execution unit 322 adds data to the specified data object. On the other hand, when the requested subtask is “read” for acquiring the contents of the data object, the task execution unit 322 acquires information from the corresponding address of the designated data object and notifies the task scheduler 321 of the information.
  • the subtask has the following four states. (1) Waiting for I / O Waiting to prepare the input data partition of the subtask and secure the memory of the output data partition for the memory of the accelerator that executes the subtask (for example, before I / O in FIG. 4) Status) (2) Waiting for execution State where input data partition preparation and output data partition memory reservation are complete and waiting for execution of subtask by accelerator (for example, I / O in FIG. 4 is completed and stored in FIFO) State) (3) Running State where the subtask is being executed by the processor on the accelerator (eg, Processing state in FIG. 4) (4) Execution complete State in which execution of subtask is completed (for example, state in which processing in FIG. 4 is completed)
  • preparation of the input data partition of the subtask and the memory allocation of the output data partition in the accelerator are referred to as “preparation of input / output data of subtask”.
  • the subtask storage unit 36 includes an inexecutable subtask storage unit 361, an executable subtask storage unit 362, and an accelerator executable subtask storage unit 363.
  • the subtask stored in the non-executable subtask storage unit 361 is a subtask that is not a candidate for the data scheduler 331 to prepare input / output data among the subtasks included in the DAG requested to be executed by the user program 21.
  • a subtask that is not a candidate for preparing input / output data includes a subtask that is waiting for I / O in a subtask upstream from the subtask or includes two or more execution subtasks, and executes those subtasks. This is the case when all waiting accelerators are not identical.
  • the subtask waiting for execution is a subtask in which the preparation of input / output data in the data moving unit 332 at the request of the data scheduler 331 is completed, and the task scheduler 321 is notified of completion of execution preparation.
  • the execution of the subtask at the request of 331 is a subtask that is not started (that is, not executed) by the task execution unit 322.
  • FIG. 16 shows an example of a subtask stored in the non-executable subtask storage unit 361.
  • the subtask “1” when the subtask “1” is waiting for I / O, the subtask “2” is stored in the non-executable subtask storage unit 361.
  • FIG. 16B when subtask “a” and subtask “b” are waiting for execution by different accelerators, subtask “c” is stored in non-executable subtask storage unit 361.
  • the subtasks stored in the executable subtask storage unit 362 are subtasks included in the DAG requested to be executed by the user program 21 and are candidates for the data scheduler 331 to prepare input / output data,
  • This subtask has no limitation on the accelerator that prepares the output data.
  • the subtask with no restriction on the accelerator for preparing input / output data is the subtask that is the most upstream subtask of the DAG and there is no subtask upstream from it, or the subtask on which the subtask depends All the subtasks upstream are in a state of completion of execution, and the input data partition of the subtask is a subtask held in the main memory 4 or the accelerator memory of any accelerator.
  • the accelerator-executable subtask storage unit 363 includes storage areas for the number of accelerators.
  • the subtasks stored in the storage area corresponding to each accelerator are candidates for subtasks in which the data scheduler 331 prepares input / output data only in the accelerator among the subtasks included in the DAG requested to be executed by the user program 21.
  • a subtask that can Here, a subtask that can be a candidate for a subtask that prepares input / output data with only one accelerator is a subtask on which all the subtasks that the subtask depends depend on or are in an execution complete state. At least one of the subtasks is waiting for execution, and all the subtasks waiting for execution are subtasks waiting for execution by an accelerator corresponding to the area in which the subtask is stored.
  • the task scheduler 321 receives a subtask execution request from the program analysis unit 31. All subtasks that have received an execution request are in an I / O waiting state.
  • the task scheduler 321 stores the subtask upstream of the DAG among the subtasks in the executable subtask storage unit 362 and stores the other subtasks in the nonexecutable subtask storage unit 361.
  • the uppermost subtask is a subtask in which there is no subtask on which the subtask depends.
  • the task scheduler 321 notifies the data scheduler 331 that the subtask is stored in the executable subtask storage unit 362.
  • the task scheduler 321 receives from the data scheduler 331 the notification of the subtask that has been ready for input / output data and has been waiting for execution, and the identifier of the accelerator waiting for execution, and the subtask notified to the task execution unit 322 Request to run with the notified accelerator.
  • the task scheduler 321 receives a notification from the task execution unit 322 that the execution of the subtask has been completed and has entered the execution completion state, and notifies the data scheduler 331 to release the lock on the input data and the output memory area of the subtask. .
  • the task scheduler 321 moves subtasks to be moved from the subtask storage unit 361 that cannot be executed by the subtask that has been executed to the accelerator executable subtask storage unit 363, and from the accelerator executable subtask storage unit 363 to the executable subtask storage unit 362. Search and move.
  • the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362. This notification is performed when movement of a subtask occurs in both or either of the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362.
  • the data scheduler 331 receives the subtask execution completion notification from the task scheduler 321 and releases the lock on the input / output data partition of the subtask. At this time, if the data mover 332 does not input / output data to the accelerator that has been unlocked, the data scheduler 331 performs an “input / output start process” described later.
  • the data scheduler 331 receives the notification stored in the sub-task storage unit 362 or the accelerator-executable sub-task storage unit 363 that can newly execute the subtask from the task scheduler 321 and does not cause the data movement unit 332 to input / output data. If there are accelerators, the “input / output start processing” described later is performed for all of those accelerators.
  • the data scheduler 331 receives a notification of the completion of the input / output data of the subtask from the data moving unit 332, locks the memory area holding the input / output data partition in the memory management table 35, and puts the subtask in the execution waiting state. Then, the task scheduler 321 is notified that the subtask is in the execution waiting state. In addition, the data scheduler 331 performs an “input / output start process” to be described later for causing the accelerator that has completed the preparation of the input / output data of the subtask to perform the next input / output process.
  • the data scheduler 331 makes the next input / output request to the accelerator that is not performing data input / output as “input / output start processing”.
  • the data scheduler 331 uses the prefetch determination unit 334 to determine the next input / output process requested to the accelerator.
  • the data scheduler 331 selects a data partition that is not used as an input data partition in the processing of subtasks included in the DAG in the future from among the data partitions held by the accelerator.
  • An instruction to save the data partition to the main memory 4 is transmitted to the moving unit 332. If there is no data partition that is not used as an input data partition, the data scheduler 331 selects a data partition that has not been referred to most recently from data partitions that are used as an input partition, and sends the data partition 332 to the main memory 4. Send the save instruction.
  • the selection of the data partition that has been least referenced recently is a management method based on the LRU (Least Recently Used) standard, and is common knowledge for engineers in the technical field. Note that the memory area holding the saved data partition must not be locked by the memory management table 35. If there is no unlocked data partition, the data scheduler 331 does nothing.
  • the data scheduler 331 uses the subtask determination unit 336 next time to create a subtask to be prepared for input / output data to be executed by the accelerator. To decide.
  • the data scheduler 331 locks the input data partition. Further, the data scheduler 331 requests the data moving unit 332 to prepare an input data partition that is not held by the accelerator and to secure an output data partition.
  • the data scheduler 331 receives a notification of completion of saving of the data partition from the data migration unit 332 to the main memory 4 and executes an input / output start process for causing the accelerator that has completed the saving to input / output the next data. To do.
  • the prefetch determination unit 334 determines an input / output process requested to the accelerator for the data scheduler 331.
  • the prefetch determination unit 334 refers to the memory management table 35, and if the usage amount of the accelerator memory is equal to or greater than a threshold value (for example, 70% to 80% of the capacity of the accelerator memory), the data scheduler 331 swaps the data partition. Let out. On the other hand, if it is less than the threshold value, the prefetch determination unit 334 causes the data scheduler 331 to prepare a data partition.
  • a threshold value for example, 70% to 80% of the capacity of the accelerator memory
  • the next-time subtask determination unit 336 designates a subtask for the data scheduler 331 that causes the designated accelerator to prepare the next input / output data.
  • the next subtask determination unit 336 refers to the executable subtask storage unit 362, the accelerator executable subtask storage unit 363, and the data management table 34, and minimizes the data I / O to the accelerator in the preparation of input / output data. Designate the subtask as the next subtask to prepare the input / output data.
  • next-time subtask determination unit 336 selects an area corresponding to the accelerator in the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362 when selecting a subtask that minimizes the data I / O of the accelerator. Select by sub-searching the subtasks memorized. Next time, the subtask determination unit 336 counts the data capacity of the input data partition as the data partition that requires the I / O as the total I / O capacity in the subtask to be searched as a data partition that requires I / O.
  • next subtask determination unit 336 regarding the output data partition, if the data capacity of the output data partition is secured and the amount of use of the accelerator memory exceeds the threshold value, the capacity exceeding the threshold value is calculated as the total I / O capacity. Count on capacity. This is because, when preparing the input / output data of the subtask, it is necessary to save the data partition corresponding to the data capacity exceeding the threshold from the accelerator.
  • the next subtask determination unit 336 selects the subtask having the smallest total I / O capacity counted for each subtask as the subtask having the smallest data I / O of the accelerator.
  • the data moving unit 332 receives input of the subtask input / output data and the designation of the accelerator for preparing the input / output data from the data scheduler 331, and prepares the input / output data.
  • the data moving unit 332 loads the input data partition from the main memory 4 or another accelerator that holds the input data partition.
  • the data moving unit 332 secures a memory area necessary for outputting the data partition. Further, the data moving unit 332 updates related information held in the memory management table 35 and the data management table 34 regarding the input / output data partitions and the memory areas used by them.
  • the data moving unit 332 receives an instruction to save the data partition to the main memory 4 from the data scheduler 331 and saves the designated data partition to the main memory 4. Further, the data migration unit 332 updates related information held in the memory management table 35 and the data management table 34 regarding the saved data partition and the memory area used by the data partition.
  • FIG. 17 is a flowchart illustrating the operation of the accelerator control device 1 according to this embodiment.
  • step A1 the user program 21 created using the reservation API and the execution API is executed (step A1).
  • the DAG creation unit 22 proceeds to a process of notifying the DAG generated so far.
  • Step A3 the DAG creation unit 22 checks whether or not it is a reservation API call.
  • step A3 If it is a reservation API call (Yes in step A3), the DAG creation unit 22 adds the task and data specified by the reservation API to the DAG generated so far (step A4).
  • step A5 when the user program 21 ends (Yes in step A5), the execution of the user program 21 is completed.
  • step A5 when the user program 21 does not end (No in step A5), the process returns to step A1 and the execution of the user program 21 is continued.
  • Step A2 When the execution API is called (Yes in Step A2), the DAG creation unit 22 adds the last task and data to the DAG if necessary, and notifies the program analysis unit 31 of the DAG (Step A6).
  • the program analysis unit 31 receives the DAG and disassembles the tasks constituting the DAG individually. Next, the program analysis unit 31 requests the task processing unit 32 to execute each subtask (step A7).
  • the requested subtask is executed in units of data partitions. For example, in the task 71 shown in FIG. 11, since the task 71 includes two subtasks 71-1 and 71-2, two individual tasks are generated by the program analysis unit 31, and the task processing unit 32 As required.
  • a task for an individual data partition is simply called a task instead of a subtask.
  • the task scheduler 321 requests the memory area of input data and output data necessary for execution of the next subtask from the data management unit 33 (step A8).
  • the data scheduler 331 refers to the data management table 34, and determines that the data is ready if the swap flag of the requested data is not set to “1” (Yes in step A9). Then, the data scheduler 331 requests the data moving unit 332 to set the lock flag of the corresponding entry in the memory management table 35 of the memory page used by the input data.
  • the task scheduler 321 refers to the memory management table 35 and accommodates the data saved in the main memory 4. Therefore, when there is an accelerator that holds a sufficient memory free area, the data moving unit 332 is requested to load input data to the accelerator.
  • the data moving unit 332 loads input data to the designated accelerator, and updates the swap flag, accelerator number, and page number of the corresponding data in the data management table 34 (step A10).
  • the data scheduler 331 updates the in-use flag, the data number, and the partition number for the page used by the loaded data in the memory management table 35. Further, the data scheduler 331 sets the lock flag to “1” in the memory management table 35.
  • the data scheduler 331 refers to the memory management table 35 and selects a page for which the lock flag is not set.
  • the data moving unit 332 is requested to select the data being used and save it in the main memory 4.
  • the data mover 332 saves the designated data and updates the swap flag, accelerator number, and page number in the data management table 34.
  • the accelerator number and page number of the data become invalid.
  • the data scheduler 331 continues the data save request until a memory area necessary for loading the input data into the accelerator becomes available. When the memory for loading the input data becomes empty, the subsequent data loading process is performed when there is an accelerator that has sufficient memory free space to accommodate the data saved in the main memory 4. This is the same as the loading process.
  • the data scheduler 331 checks whether or not the output memory area of the requested subtask can be secured in the accelerator that holds the input data of the subtask (step A11). If the free memory area is sufficient, it is determined that it can be secured (Yes in step A11).
  • step A11 when the free memory area is not sufficient (No in step A11), the data scheduler 331 refers to the memory management table 35 and instructs the data moving unit 332 to save the data using the page for which the lock flag is not set. Request.
  • the operation (step A12) for saving the designated data by the data moving unit 332 is the same as the operation for saving the data in step A10.
  • the data scheduler 331 requests the data moving unit 332 to secure the output data memory (step A13).
  • the data moving unit 332 reserves a memory, and describes the accelerator number and page number in the entry of the corresponding data management table 34 of the output data. In addition, the lock flag of the memory management table 35 of the page being used is set.
  • the data scheduler 331 notifies the task processing unit 32 of the completion of data preparation (step A14).
  • the task scheduler 321 receives the data preparation completion notification and requests the task execution unit 322 to execute the subtask (step A15).
  • the task execution unit 322 executes the kernel function on the input data using the accelerator that holds the data, and the result is stored in the output memory area. Output.
  • the task execution unit 322 reads the data from the accelerator that holds the data and notifies the task scheduler 321 of the data. If the request for the subtask to be executed is append to add data, the task execution unit 322 writes the given data to the memory area of the accelerator that holds the data.
  • the task scheduler 321 notifies the data management unit 33 of the completion of the subtask (step A16).
  • the task scheduler 321 releases the lock flag in the memory management table 35 for the input data and output data for which processing has been completed, and sets the calculated flag of the corresponding entry in the data management table 34 for the output data.
  • Request to the unit 332 (step A17).
  • the data moving unit 332 performs the requested process.
  • the task scheduler 321 continues to request data on the subtask and execute the subtask until all the subtasks of the DAG requested from the program analysis unit 31 are completed (No in Step A18).
  • step A18 the process returns to step A1.
  • FIG. 18 is a sequence diagram illustrating detailed operations of the task scheduler 321 and the data scheduler 331.
  • the task scheduler 321 when the task scheduler 321 receives a subtask execution request from the program analysis unit 31, the task scheduler 321 stores the subtask upstream of the DAG in the subtask in the executable subtask storage unit 362, and other subtasks Is stored in the inexecutable subtask storage unit 361 (step B1). The task scheduler 321 notifies the data scheduler 331 that the subtask has been stored in the executable subtask storage unit 362 (step B2).
  • the data scheduler 331 receives the notification stored in the subtask storage unit 362 that can newly execute the subtask from the task scheduler 321, and if there is an accelerator that does not cause the data moving unit 332 to input / output data, all of those accelerators
  • the "input / output start process" is performed for (Step B3).
  • the data scheduler 331 receives a notification of the completion of input / output data of the subtask from the data mover 332, locks the memory area holding the input / output data partition in the memory management table 35, and puts the subtask into the execution waiting state. (Step B4), the task scheduler 321 is notified that the subtask is waiting to be executed (Step B5). Further, the data scheduler 331 performs “input / output start processing” for causing the accelerator that has completed the preparation of the input / output data of the subtask to perform the next input / output processing (step B6).
  • the task scheduler 321 receives from the data scheduler 331 the notification of the subtask that has been ready for input / output data and is waiting for execution, and the identifier of the accelerator waiting for execution, and is notified of the subtask notified to the task execution unit 322. Request to be executed by the accelerator (step B7).
  • the task scheduler 321 receives a notification from the task execution unit 322 that the execution of the subtask has been completed and has entered the execution completion state, and notifies the data scheduler 331 to release the lock on the input data and the output memory area of the subtask. (Step B8).
  • the data scheduler 331 receives the subtask execution completion notification from the task scheduler 321 and releases the lock of the input / output data partition of the subtask (step B9).
  • the task scheduler 321 can execute the subtask to be moved from the non-executable subtask storage unit 361 to the accelerator-executable subtask storage unit 363 and the accelerator-executable subtask storage unit 363 when a subtask that has been executed has occurred.
  • a subtask to be moved is searched for and moved to the subtask storage unit 362 (step B10).
  • the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362 (step B11).
  • the data scheduler 331 receives the notification stored in the sub-task storage unit 362 or the accelerator-executable sub-task storage unit 363 that can newly execute the subtask from the task scheduler 321 (step B11), and causes the data movement unit 332 to input / output data. If there are any accelerators that are not present, the "input / output start processing" is performed for all the accelerators (step B12).
  • FIG. 19 is a flowchart illustrating the above-described “input / output start processing” (steps B3, B6, and B12 in FIG. 18) by the data scheduler 331.
  • the data scheduler 331 uses the prefetch determination unit 334 to determine an input / output process to be requested next to the accelerator (step C1).
  • the data scheduler 331 uses the data partition held by the accelerator and does not use it as the input data partition in the processing of the subtask included in the future DAG.
  • the partition or the data scheduler 331 selects a data partition that has not been referred to most recently among the data partitions used as the input data partition, and transmits a save instruction to the main memory 4 to the data moving unit 332 (step C3). .
  • the data scheduler 331 uses the subtask determination unit 336 next time to input / output data to be performed by the accelerator.
  • a subtask to be prepared is determined (step C4).
  • the data scheduler 331 locks the input data partition when the accelerator stores the input data partition of the subtask determined by the next subtask determination unit 336 in the accelerator memory. Further, the data scheduler 331 requests the data migration unit 332 to prepare an input data partition that is not held by the accelerator and to secure an output data partition (step C5).
  • FIG. 20 is a flowchart illustrating the operation of the prefetch determination unit 334 (step C1 in FIG. 19).
  • the prefetch determination unit 334 refers to the memory management table 35 (step D1). If the accelerator memory usage is equal to or greater than the threshold (Yes in Step D2), the prefetch determination unit 334 causes the data scheduler 331 to swap out the data partition (Step D3). On the other hand, when it is less than the threshold (No in Step D2), the prefetch determination unit 334 causes the data scheduler 331 to prepare the data partition (Step D4).
  • FIG. 21 is a flowchart illustrating the operation of the next subtask determination unit 336 (step C4 in FIG. 19).
  • the next subtask determination unit 336 searches all areas corresponding to the accelerator in the accelerator executable subtask storage unit 363 and the subtask stored in the executable subtask storage unit 362 and selects one subtask. (Step E1).
  • the subtask determination unit 336 calculates the total I / O amount required for the accelerator memory when the selected subtask is executed on the accelerator.
  • the next subtask determination unit 336 calculates the total I / O amount as “the amount of input data to be loaded into the accelerator” + “the amount of data swapped out from the accelerator”. Calculate from
  • the next subtask determination unit 336 regards the input data partition as a data partition that requires I / O as the data partition that the specified accelerator memory does not hold, and sets the amount of data as “input to be loaded into the accelerator” Count to “data amount” (step E2).
  • the subtask determination unit 336 next time secures “the amount of data swapped out from the accelerator” in the second term of the above equation “the amount of input data loaded as the first term of the above equation” + “the output area on the accelerator memory. Area size to be "-" free space up to the threshold of the accelerator memory at the load destination " (Step E3).
  • the free memory capacity up to the threshold is 1GB
  • the input data to be newly loaded into the accelerator is 500MB
  • the output area to be secured is 1GB
  • next subtask determination unit 336 completes the processing of the above steps E1 to E3 for the area corresponding to the accelerator in the accelerator executable subtask storage unit 363 and all the subtasks stored in the executable subtask storage unit 362 (step S1). (Yes in E4), the subtask with the smallest total I / O count is selected as the subtask with the smallest accelerator data I / O (step E5).
  • the task scheduler 321 executes the subtask, while the data scheduler 331 selects the task that minimizes the data input / output amount to the accelerator memory as the next task and selects it.
  • the data scheduler 331 selects the task that minimizes the data input / output amount to the accelerator memory as the next task and selects it.
  • the accelerator control device of the present embodiment it is possible to avoid the data I / O from becoming a bottleneck in the processing of the task using the accelerator having the accelerator memory, and to speed up the processing.
  • one data is divided and held in a plurality of accelerators, the processing of the user program is divided, and the processing is distributed to the accelerators holding the respective data partitions so that the data is loaded into the accelerator. Costs can be reduced and processing time can be reduced according to the number of accelerators used.
  • the accelerator control device of this embodiment has the same configuration as the accelerator control device 1 (FIGS. 8 to 21) of the first embodiment and performs the same operation, so only the difference will be described.
  • the task scheduler 321 receives the notification that the execution of the subtask (step B7 in FIG. 18) is completed from the task execution unit 322, and the execution of the subtask has occurred.
  • the subtask is moved by searching for a subtask to be moved from the inexecutable subtask storage unit 361 to the accelerator executable subtask storage unit 363 and a subtask to be moved from the accelerator executable subtask storage unit 363 to the executable subtask storage unit 362. (Step B10 in FIG. 18).
  • the task scheduler 321 receives a notification from the data scheduler 331 that the subtask is in the execution waiting state (step B5 in FIG.
  • a subtask to be moved is searched from the non-executable subtask storage unit 361 to the accelerator executable subtask storage unit 363, and the subtask is moved. Also, the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363.
  • the data scheduler 331 may search and move a subtask to be moved from the inexecutable subtask storage unit 361 to the accelerator executable subtask storage unit 363. That is, the data scheduler 331 locks the input / output data partition (step B4 in FIG. 18), and the execution of the subtask waiting for execution has caused the non-executable subtask storage unit 361 to transfer to the accelerator executable subtask storage unit 363.
  • the subtask may be moved by searching for the subtask to be moved.
  • the task scheduler 321 is in a subsequent stage that can be executed upon completion of the subtask when the subtask enters the “execution complete” state (see FIG. 4).
  • Subtasks are also added to the accelerator executable subtask storage unit 363.
  • the data scheduler 331 also performs the input / output data transfer for the subsequent task that can be executed by the completion of the task at the time of the “execution waiting” state before the task enters the “execution completion” state. Can be a candidate for the task to start preparation. Therefore, according to the present embodiment, the data scheduler 331 can start preparing input / output data for a subsequent subtask earlier than the first embodiment.
  • the I / O (Input / Output) band between the accelerator memory and the external memory can be further effectively used as compared with the first embodiment, and the accelerator having the memory is used. It is possible to further speed up the processing of the task that has been performed.
  • the operation of the accelerator control device 1 according to the first and second embodiments is performed on a computer having a CPU (Central Processing Unit) and a memory.
  • the CPU is caused to perform the functions of a user program 21, a DAG (Directed Acyclic Graph) creation unit 22, a program analysis unit 31, a task scheduler 321, a task execution unit 322, a data scheduler 331, and a data migration unit 332.
  • the memory of the computer is used as the data management table 34, the memory management table 35, the subtask storage unit 36, and the main memory 4.
  • the memory is a storage means in a broad sense, and includes a semiconductor memory and a hard disk or flash disk generally called secondary storage.
  • the accelerator is inserted into an I / O (Input / Output) slot of the computer.
  • the accelerator and the computer can be connected using an interconnection for the I / O device.
  • the present invention can be applied to, for example, an application for speeding up the processing of a computing device including one or more accelerators.

Landscapes

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

Abstract

The present invention increases the speed of processing of a task using an accelerator. An accelerator control device is provided with: a task storage unit that holds an executable task; a data scheduler that selects, from among the executable tasks, a task with a relatively small amount of data to be input/output to/from memory when executed with an accelerator having a memory, and instructs the accelerator to prepare for data input/output to/from memory for the selected task; and a task scheduler that instructs the accelerator to execute the selected task, and adds, to the task storage unit, the task which becomes executable due to completion of the selected task. The data scheduler, in accordance with the memory usage status, continues the selection of the next task from among the executable tasks held by the task storage unit and the preparations for data input/output in respect to the selected next task.

Description

アクセラレータ制御装置、アクセラレータ制御方法およびプログラムAccelerator control device, accelerator control method, and program
 (関連出願についての記載)
 本発明は、日本国特許出願:特願2016-015352号(2016年1月29日出願)の優先権主張に基づくものであり、同出願の全記載内容は引用をもって本書に組み込み記載されているものとする。
 本発明はアクセラレータ制御装置、アクセラレータ制御方法およびプログラムに関し、特にアクセラレータを用いた計算を制御するアクセラレータ制御装置、アクセラレータ制御方法およびプログラムに関する。
(Description of related applications)
The present invention is based on the priority claim of Japanese patent application: Japanese Patent Application No. 2016-015352 (filed on Jan. 29, 2016), the entire contents of which are incorporated herein by reference. Shall.
The present invention relates to an accelerator control device, an accelerator control method, and a program, and more particularly, to an accelerator control device, an accelerator control method, and a program that control computation using an accelerator.
 近年、衛星画像やセンサデータ等のビックデータをリアルタイムに解析し、未知の現象を発見し、または、将来起こり得る現象を予知ないし予兆することへのニーズが高まっている。ここで、解析対象とされるデータは、センシング精度の向上に伴い大容量化している。しかしながら、個々のオペレータ(ないし事業者)に対して、100ないし1000台規模のクラスタ(計算機クラスタ)を占有させることは、コストの観点から困難である。 In recent years, there has been a growing need for analyzing big data such as satellite images and sensor data in real time to discover unknown phenomena or foreseeing or predicting phenomena that may occur in the future. Here, the data to be analyzed is increased in capacity with the improvement of sensing accuracy. However, it is difficult to occupy a cluster (computer cluster) having a scale of 100 to 1000 for each operator (or business operator) from the viewpoint of cost.
 そこで、最近では、上記のリアルタイム解析において、GPU(Graphical Processing Unit)等を搭載したアクセラレータが用いられる機会が増えている。特許文献1には、アクセラレータ制御装置の一例が記載されている。図22に示すように、特許文献1に記載されたアクセラレータ制御装置は、情報処理装置8によって構成される。情報処理装置8は、共有メモリ81と、共有メモリ81に接続する複数のアクセラレータ821~823とを備えている。 Therefore, recently, in the above-described real-time analysis, there is an increased use of an accelerator equipped with a GPU (Graphical Processing Unit) or the like. Patent Document 1 describes an example of an accelerator control device. As shown in FIG. 22, the accelerator control device described in Patent Document 1 is configured by an information processing device 8. The information processing apparatus 8 includes a shared memory 81 and a plurality of accelerators 821 to 823 connected to the shared memory 81.
 共有メモリ81は、アクセラレータ821~823が処理するデータを保持する。アクセラレータ821~823は、共有メモリ81からアクセラレータ821~823のメモリ(非図示)に移動されたデータに対して処理を行う。アクセラレータ821~823は、処理を完了したデータを再び自身のメモリから共有メモリ81に移動する。これらのデータの移動と処理は、所望の処理が完了するまで繰り返して行われる。 The shared memory 81 holds data processed by the accelerators 821 to 823. The accelerators 821 to 823 perform processing on the data moved from the shared memory 81 to the memories (not shown) of the accelerators 821 to 823. The accelerators 821 to 823 move the processed data from their own memory to the shared memory 81 again. These data movement and processing are repeated until the desired processing is completed.
特開2013-025392号公報JP 2013-025392 A
 上記特許文献の全開示内容は、本書に引用をもって繰り込み記載されているものとする。以下の分析は、本発明者によってなされたものである。 The entire disclosure of the above patent document is incorporated herein by reference. The following analysis was made by the present inventors.
 特許文献1に記載された技術では、共有メモリからアクセラレータのメモリにデータを移動するのに時間を要するため、アクセラレータを用いた計算が高速に行えないおそれがある。また、同様の理由により、複数のアクセラレータを用いて計算を行う場合、用いるアクセラレータの数に応じて全体の計算時間を短縮できず、スケーラビリティが得られないおそれもある。 In the technique described in Patent Document 1, since it takes time to move data from the shared memory to the accelerator memory, there is a possibility that the calculation using the accelerator cannot be performed at high speed. For the same reason, when a calculation is performed using a plurality of accelerators, the total calculation time cannot be reduced depending on the number of accelerators used, and scalability may not be obtained.
 クラスタ技術を採用する代わりに、GPU(Graphical Processing Unit)等を搭載したアクセラレータを用いることにより、例えばノード数を1/10に削減できる。一方、アクセラレータを用いる場合、クラスタ技術と比較してメモリ容量は1/1000に減少する。したがって、アクセラレータのメモリ(アクセラレータメモリ)に収まらず、共有メモリ(ないしメインメモリ)とアクセラレータメモリとのデータのやり取りを伴うアウトオブコア(Out-of-Core)処理が増大する。典型的な例では、アクセラレータを用いることにより、処理性能およびメモリ容量は、クラスタ技術の場合におけるこれらの値から以下のように変化する。
 処理性能:100ギガフロップ(CPU:Central Processing Unit) ⇒ 1テラフロップ(GPU)
 メモリ容量:1テラバイト(CPU) ⇒ 10ギガバイト(GPU)
For example, the number of nodes can be reduced to 1/10 by using an accelerator equipped with a GPU (Graphical Processing Unit) or the like instead of employing the cluster technology. On the other hand, when an accelerator is used, the memory capacity is reduced to 1/1000 compared to the cluster technology. Therefore, out-of-core processing involving data exchange between the shared memory (or main memory) and the accelerator memory is increased, which does not fit in the accelerator memory (accelerator memory). In a typical example, by using an accelerator, processing performance and memory capacity change from these values in the case of cluster technology as follows:
Processing performance: 100 gigaflops (CPU: Central Processing Unit) ⇒ 1 teraflop (GPU)
Memory capacity: 1 terabyte (CPU) ⇒ 10 gigabyte (GPU)
 しかながら、アクセラレータにデータを入出力するためのI/O(Input/Output)帯域はGPUの演算性能と比較して極端に狭い。典型的な例では、1テラフロップ(TFlop)の演算性能に対してI/O帯域は32ギガバイト/秒(GB/s)である。したがって、アクセラレータメモリとメインメモリとの間のデータのI/Oが処理の高速化のボトルネックとなるおそれがある。 However, the I / O (Input / Output) bandwidth for inputting / outputting data to / from the accelerator is extremely narrow compared with the calculation performance of the GPU. In a typical example, the I / O bandwidth is 32 gigabytes / second (GB / s) for a computing performance of 1 teraflop (TFlop). Therefore, data I / O between the accelerator memory and the main memory may become a bottleneck in speeding up the processing.
 そこで、メモリを有するアクセラレータを用いたタスクの処理を高速化することが課題となる。本発明の目的は、かかる課題解決に寄与するアクセラレータ制御装置、アクセラレータ制御方法およびプログラムを提供することにある。なお、本発明のその他の課題ないし目的は、後述の発明を実施するための形態の説明において明らかとなる。 Therefore, it is an issue to speed up the task processing using an accelerator having a memory. An object of the present invention is to provide an accelerator control device, an accelerator control method, and a program that contribute to solving such a problem. In addition, the other subject thru | or objective of this invention become clear in description of the form for implementing invention mentioned later.
 本発明の第1の態様に係るアクセラレータ制御装置は、実行可能なタスクを保持するタスク記憶部と、メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示するデータスケジューラと、前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記タスク記憶部に追加するタスクスケジューラとを備え、前記データスケジューラは、前記メモリの使用状況に応じて、前記タスク記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する。 The accelerator control device according to the first aspect of the present invention includes a task storage unit that holds an executable task, and a task that has a relatively small amount of input / output data to and from the memory when executed on the accelerator. A data scheduler that instructs the accelerator to prepare for data input / output in the memory for the selected task, and instructs the accelerator to execute the selected task. A task scheduler that adds a task that can be executed upon completion of the selected task to the task storage unit, and the data scheduler executes execution held by the task storage unit in accordance with the use state of the memory Select the next task from the available tasks and select the next task To continue the preparation of the data input and output.
 本発明の第2の態様に係るアクセラレータ制御方法は、実行可能なタスクを記憶部に保持するステップと、メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示するステップと、前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記記憶部に追加するステップと、前記メモリの使用状況に応じて、前記記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続するステップと、を含む。 In the accelerator control method according to the second aspect of the present invention, the amount of input / output data to the memory is relatively small when the executable task is stored in the storage unit and executed on the accelerator having the memory. Selecting a task from the executable tasks, instructing the accelerator to prepare for data input / output in the memory for the selected task, and instructing the accelerator to execute the selected task Adding a task that can be executed upon completion of the selected task to the storage unit, and selecting a next task from among the executable tasks held by the storage unit according to the use state of the memory. Selecting and continuing to prepare for data input / output for the next selected task.
 本発明の第3の態様に係るプログラムは、実行可能なタスクを記憶部に保持する処理と、メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示する処理と、前記メモリにおけるデータ入出力の準備が完了すると、前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記記憶部に追加する処理と、前記メモリの使用状況に応じて、前記記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する処理と、をコンピュータに実行させる。なお、プログラムは、非一時的なコンピュータ可読記録媒体(non-transitory computer-readable storage medium)に記録されたプログラム製品として提供することもできる。 The program according to the third aspect of the present invention includes a process for holding an executable task in a storage unit, and a task having a relatively small amount of input / output data to the memory when executed on an accelerator having a memory. Selecting from the executable tasks, instructing the accelerator to prepare for data input / output in the memory for the selected task, and completing the data input / output preparation in the memory, the selected task The accelerator is instructed to execute the task, and a process for adding a task that can be executed upon completion of the selected task to the storage unit, and an execution held by the storage unit in accordance with the use status of the memory Selecting the next task from the possible tasks, and continuing to prepare for data I / O for the selected next task; To be executed by a computer. The program can also be provided as a program product recorded in a non-transitory computer-readable storage medium.
 本発明に係るアクセラレータ制御装置、アクセラレータ制御方法およびプログラムによると、メモリを有するアクセラレータを用いたタスクの処理を高速化することができる。 According to the accelerator control device, the accelerator control method, and the program according to the present invention, it is possible to speed up the task processing using the accelerator having the memory.
一実施形態に係るアクセラレータ制御装置の構成を例示するブロック図である。It is a block diagram which illustrates the composition of the accelerator control device concerning one embodiment. 一実施形態に係るアクセラレータ制御装置の動作を例示する図である。It is a figure which illustrates operation | movement of the accelerator control apparatus which concerns on one Embodiment. 一実施形態に係るアクセラレータ制御装置の他の構成を例示するブロック図である。It is a block diagram which illustrates other composition of the accelerator control device concerning one embodiment. 一実施形態に係るアクセラレータ制御装置の動作を説明するための図である。It is a figure for demonstrating operation | movement of the accelerator control apparatus which concerns on one Embodiment. 一実施形態に係るアクセラレータ制御装置の動作を例示する図である。It is a figure which illustrates operation | movement of the accelerator control apparatus which concerns on one Embodiment. 比較例の動作を説明するための図である。It is a figure for demonstrating operation | movement of a comparative example. 一実施形態に係るアクセラレータ制御装置の効果について説明するための図である。It is a figure for demonstrating the effect of the accelerator control apparatus which concerns on one Embodiment. 第1の実施形態に係るアクセラレータ制御装置の構成を例示するブロック図である。It is a block diagram which illustrates the composition of the accelerator control device concerning a 1st embodiment. 第1の実施形態に係るアクセラレータ制御装置における予約API(Application Programming Interface)および実行APIを例示する図である。It is a figure which illustrates reservation API (Application | Programming | Interface | Interface) and execution API in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置におけるDAG(Directed Acyclic Graph、有向非巡回グラフ)の構成を例示する図である。It is a figure which illustrates the structure of DAG (Directed | Acyclic | Graph, directed acyclic graph) in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置におけるデータおよび処理の分割について説明するための図である。It is a figure for demonstrating the division | segmentation of the data and process in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置におけるデータおよび処理の分割について説明するための図である。It is a figure for demonstrating the division | segmentation of the data and process in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置のアクセラレータ制御部の構成を例示するブロック図である。It is a block diagram which illustrates the composition of the accelerator control part of the accelerator control device concerning a 1st embodiment. 第1の実施形態に係るアクセラレータ制御装置におけるメモリ管理テーブルの構成を例示する図である。It is a figure which illustrates the structure of the memory management table in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置におけるデータ管理テーブルの構成を例示する図である。It is a figure which illustrates the structure of the data management table in the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置の実行不可能サブタスク記憶部が保持するタスクを例示する図である。It is a figure which illustrates the task which the non-executable subtask memory | storage part of the accelerator control apparatus which concerns on 1st Embodiment hold | maintains. 第1の実施形態に係るアクセラレータ制御装置の動作を例示するフロー図である。It is a flowchart which illustrates operation | movement of the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置の詳細な動作を例示するシーケンス図である。It is a sequence diagram which illustrates detailed operation | movement of the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置のデータスケジューラの動作を例示するフロー図である。It is a flowchart which illustrates operation | movement of the data scheduler of the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置の先読み判定部の動作を例示するフロー図である。It is a flowchart which illustrates operation | movement of the prefetch determination part of the accelerator control apparatus which concerns on 1st Embodiment. 第1の実施形態に係るアクセラレータ制御装置の次回サブタスク判定部の動作を例示するフロー図である。It is a flowchart which illustrates operation | movement of the next subtask determination part of the accelerator control apparatus which concerns on 1st Embodiment. 特許文献1に記載された関連技術を説明するための図である。It is a figure for demonstrating the related technique described in patent document 1. FIG.
 はじめに、一実施形態の概要について説明する。なお、この概要に付記する図面参照符号は、専ら理解を助けるための例示であり、本発明を図示の態様に限定することを意図するものではない。 First, an outline of one embodiment will be described. Note that the reference numerals of the drawings attached to this summary are merely examples for facilitating understanding, and are not intended to limit the present invention to the illustrated embodiment.
 図1は、一実施形態に係るアクセラレータ制御装置10の構成を例示するブロック図である。図1を参照すると、アクセラレータ制御装置10は、タスク記憶部11、データスケジューラ12、および、タスクスケジューラ13を備えている。 FIG. 1 is a block diagram illustrating the configuration of an accelerator control device 10 according to an embodiment. Referring to FIG. 1, the accelerator control device 10 includes a task storage unit 11, a data scheduler 12, and a task scheduler 13.
 タスク記憶部11は、実行可能なタスク(例えば、図10のタスク、または、図11、図12のサブタスクのうちの実行可能なもの)を保持する。データスケジューラ12は、メモリを有するアクセラレータ(例えば、図8のアクセラレータメモリを有するアクセラレータ)上で実行するときの当該メモリへの入出力データ量が相対的に少ない(例えば最小の)タスクを、上記実行可能なタスクの中から選択し、選択したタスクに対する当該メモリにおけるデータ入出力の準備をアクセラレータに指示する。タスクスケジューラ13は、(例えば上記メモリにおけるデータ入出力の準備が完了すると)選択されたタスクを実行するようにアクセラレータに指示するとともに、選択されたタスクの完了により実行可能となるタスク(例えば、図10のタスク71の完了により実行可能となるタスク72)をタスク記憶部11に追加する。ここで、データスケジューラ12は、上記メモリの使用状況に応じて、タスク記憶部11が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する。 The task storage unit 11 holds executable tasks (for example, the tasks shown in FIG. 10 or the subtasks shown in FIGS. 11 and 12). The data scheduler 12 executes the above-described task with a relatively small amount of input / output data to the memory (for example, the smallest) when executing on an accelerator having a memory (for example, an accelerator having the accelerator memory of FIG. 8). Select from the possible tasks and instruct the accelerator to prepare for data input / output in the memory for the selected task. The task scheduler 13 instructs the accelerator to execute the selected task (for example, when preparation for data input / output in the memory is completed), and a task that can be executed upon completion of the selected task (for example, FIG. A task 72) that can be executed upon completion of the ten tasks 71 is added to the task storage unit 11. Here, the data scheduler 12 selects the next task from among the executable tasks held by the task storage unit 11 and prepares data input / output for the selected next task in accordance with the use state of the memory. continue.
 すなわち、アクセラレータ制御装置10は、アクセラレータのメモリへのデータ入出力量が相対的に少ないタスクを次のタスクとして選択するとともに、当該メモリの使用状況に応じて(例えば余裕がある場合)、選択したタスクに対するデータ入出力の準備を継続する構成を採用する。これにより、アクセラレータメモリと外部メモリとのデータの入出力量を削減すると同時に、アクセラレータメモリと外部メモリとの間のI/O帯域を有効利用することができる。したがって、アクセラレータ制御装置10によると、メモリを有するアクセラレータを用いたタスクの処理を高速化することが可能となる。 That is, the accelerator control device 10 selects a task with a relatively small amount of data input / output to / from the memory of the accelerator as the next task, and selects the selected task according to the use status of the memory (for example, when there is a margin). Adopt a configuration that continues preparation for data input / output. As a result, the input / output amount of data between the accelerator memory and the external memory can be reduced, and at the same time, the I / O bandwidth between the accelerator memory and the external memory can be effectively used. Therefore, according to the accelerator control device 10, it is possible to speed up the task processing using the accelerator having a memory.
 図2は、図1に示すアクセラレータ制御装置10の動作を例示する図である。図2(a)は、ユーザプログラムの処理を示すDAG(Directed Acyclic Graph、有向非巡回グラフ)を例示する。ここでは、一例として、DAGの各ノードは、タスクを分割したサブタスク(図11、図12参照)を表すものとする。 FIG. 2 is a diagram illustrating the operation of the accelerator control device 10 shown in FIG. FIG. 2A illustrates a DAG (Directed Acyclic Graph, directed acyclic graph) indicating the processing of the user program. Here, as an example, each node of the DAG represents a subtask (see FIGS. 11 and 12) obtained by dividing the task.
 図2(b)を参照すると、タスクスケジューラ13とデータスケジューラ12は並列に動作している。タスクスケジューラ13は実行可能なサブタスク「1」~「3」をタスク記憶部11の実行可能リストに積む。データスケジューラ12はタスク記憶部11が保持する実行可能リストの中で最も入力データのアクセラレータ(ないしアクセラレータメモリ)へのI/Oが小さいサブタスクを選択し、そのサブタスクの実行に必要なデータのI/Oを行う。例えば、サブタスク「2」の入力データのみがアクセラレータのメモリにキャッシュされている場合、データスケジューラ12はサブタスク「2」を選択する。また、データスケジューラ12は、選択したサブタスク「2」のエントリをタスク記憶部11の実行可能リストから消去する。 Referring to FIG. 2B, the task scheduler 13 and the data scheduler 12 are operating in parallel. The task scheduler 13 loads the executable subtasks “1” to “3” in the executable list of the task storage unit 11. The data scheduler 12 selects a subtask having the smallest I / O to the accelerator (or accelerator memory) of the input data from the executable list held by the task storage unit 11, and the I / O of the data necessary for the execution of the subtask. O is performed. For example, when only the input data of the subtask “2” is cached in the accelerator memory, the data scheduler 12 selects the subtask “2”. Further, the data scheduler 12 deletes the entry of the selected subtask “2” from the executable list in the task storage unit 11.
 図2(c)を参照すると、データスケジューラ12はサブタスク「2」を実行するための入力データのI/Oと出力メモリの確保を完了し、それらのメモリ領域をロックし、タスクスケジューラ13にサブタスク「2」の実行可を通知する。データスケジューラ12は、タスク記憶部11の実行可能リストから次にI/Oを行うべきサブタスクを選択する。ここでは、一例として、データスケジューラ12はサブタスク「1」を選択したとする。また、タスクスケジューラ13はサブタスク「2」を実行する。 Referring to FIG. 2C, the data scheduler 12 completes the input data I / O and output memory allocation for executing the subtask “2”, locks the memory area, and sends the subtask to the task scheduler 13. Notify that execution of “2” is possible. The data scheduler 12 selects a subtask to be subjected to the next I / O from the executable list in the task storage unit 11. Here, as an example, it is assumed that the data scheduler 12 selects the subtask “1”. Further, the task scheduler 13 executes the subtask “2”.
 図2(d)を参照すると、タスクスケジューラ13はサブタスク「2」の実行を完了し、データスケジューラ12にサブタスク「2」の実行完了を通知する。データスケジューラ12は、サブタスク「2」の入出力データのロックを解除する。図2(a)のDAGによるとサブタスク「5」が実行可能となるため、タスクスケジューラ13はサブタスク「5」をタスク記憶部11の実行可能リストに積む。 Referring to FIG. 2D, the task scheduler 13 completes the execution of the subtask “2” and notifies the data scheduler 12 of the completion of the execution of the subtask “2”. The data scheduler 12 unlocks the input / output data of the subtask “2”. According to the DAG in FIG. 2A, the subtask “5” can be executed, so the task scheduler 13 loads the subtask “5” in the executable list of the task storage unit 11.
 以下、同様の処理がタスクスケジューラ13とデータスケジューラ12の並列動作によって行われる。なお、複数のアクセラレータが存在する場合、データスケジューラ12はアクセラレータごとに上記の処理を行う。 Hereinafter, the same processing is performed by the parallel operation of the task scheduler 13 and the data scheduler 12. When there are a plurality of accelerators, the data scheduler 12 performs the above process for each accelerator.
 このように、タスクスケジューラ13によるサブタスクの実行が行われる一方で、データスケジューラ12はアクセラレータのメモリへのデータ入出力量が最小となるサブタスクを次のタスクとして選択し、選択したサブタスクに対するデータ入出力の準備を継続する。これにより、アクセラレータメモリと外部メモリとのデータの入出力を削減し、かつ、アクセラレータメモリと外部メモリとの間のI/O帯域を有効に活用することが可能となる。 In this way, while the subtask is executed by the task scheduler 13, the data scheduler 12 selects the subtask that minimizes the data input / output amount to the memory of the accelerator as the next task, and performs data input / output for the selected subtask. Continue preparation. As a result, data input / output between the accelerator memory and the external memory can be reduced, and the I / O bandwidth between the accelerator memory and the external memory can be effectively utilized.
 図3は、一実施形態に係るアクセラレータ制御装置10の他の構成を例示するブロック図である。図3を参照すると、タスク記憶部11は、実行可能なタスク(ないしサブタスク)であって実行先のアクセラレータが制限されないタスクを保持する第1の記憶部14と、実行先のアクセラレータが制限されたタスクを保持する第2の記憶部15とを有する。このとき、データスケジューラ12は、アクセラレータ上で実行するときのメモリへの入出力データ量が相対的に少ない(例えば最小の)タスクを、第1の記憶部14が保持するタスク、および、第2の記憶部15が保持するタスクであって実行先が当該アクセラレータに制限されたタスクの中から選択する。 FIG. 3 is a block diagram illustrating another configuration of the accelerator control device 10 according to an embodiment. Referring to FIG. 3, the task storage unit 11 includes a first storage unit 14 that holds a task that is an executable task (or subtask) and whose execution destination accelerator is not limited, and the execution destination accelerator is limited. A second storage unit 15 for holding tasks. At this time, the data scheduler 12 includes a task that the first storage unit 14 holds a task that has a relatively small amount of input / output data to and from the memory when executed on the accelerator (for example, a minimum), and a second Are selected from the tasks held in the storage unit 15 whose execution destination is restricted to the accelerator.
 例えば、第1の記憶部14は、最上流のタスク、または、上流のすべてのタスクの実行が完了したタスクを保持する。一方、第2の記憶部15は、実行先のアクセラレータが制限されたタスクとして、上流のタスクの少なくとも1つが当該アクセラレータで実行待ち(すなわち、データ入出力の準備が完了し、アクセラレータで実行されるのを待っている状態)であり、かつ、上流の残りのすべてのタスクの実行が完了したタスクを保持する。 For example, the first storage unit 14 holds the most upstream task or a task for which all upstream tasks have been executed. On the other hand, in the second storage unit 15, at least one of the upstream tasks is waiting to be executed by the accelerator as a task whose execution destination accelerator is restricted (that is, preparation for data input / output is completed and executed by the accelerator) And the task that has completed the execution of all the remaining upstream tasks is held.
 図4は、図3に示すアクセラレータ制御装置10の動作を説明するための図である。ここでは、アクセラレータ51~5N(Nは自然数)は、それぞれGPU1~Nを有するものとする。第1の記憶部14は、実行先のアクセラレータが制限されないサブタスクを保持している。一方、第2の記憶部15は、実行先のアクセラレータ(ないしGPU)が制限されたサブタスクをアクセラレータごとに保持する。第1の記憶部14および第2の記憶部15に蓄積されたサブタスクは、「I/O待ち」状態である。 FIG. 4 is a diagram for explaining the operation of the accelerator control device 10 shown in FIG. Here, it is assumed that accelerators 51 to 5N (N is a natural number) have GPUs 1 to N, respectively. The first storage unit 14 holds subtasks whose execution destination accelerators are not limited. On the other hand, the 2nd memory | storage part 15 hold | maintains the subtask by which the accelerator (or GPU) of the execution destination was restrict | limited for every accelerator. The subtasks accumulated in the first storage unit 14 and the second storage unit 15 are in the “I / O wait” state.
 データスケジューラ12は、アクセラレータ(例えばGPU 1に対応するアクセラレータ)上で実行するときのメモリへの入出力データ量が最小のサブタスクを、第1の記憶部14が保持するサブタスク(Ready Sub Tasks)、および、第2の記憶部15が保持するサブタスクであって実行先が当該アクセラレータに制限されたサブタスク(例えばGPU 1 Ready Sub Tasks)の中から選択する。データスケジューラ12が選択したサブタスクは、当該サブタスクに対するデータ入出力の準備(図4のI/O)が完了すると、対応するGPUに対するキュー(FIFO:First-In First-Out)に格納され、「実行待ち」状態となる。キューに格納されたサブタスクは、対応するアクセラレータのGPU(例えばGPU 1)で順次実行され(図4のProcessing)、実行が完了すると、「実行完了」状態となる。 The data scheduler 12 is a subtask (Ready Sub Tasks) in which the first storage unit 14 holds subtasks having the smallest input / output data amount to the memory when executed on an accelerator (for example, an accelerator corresponding to GPU 1), Further, the subtask is held by the second storage unit 15 and the execution destination is selected from the subtasks limited to the accelerator (for example, GPU 1 Ready Sub Tasks). The subtask selected by the data scheduler 12 is stored in the queue (FIFO: First-In First-Out) for the corresponding GPU when the data input / output preparation for the subtask (I / O in FIG. 4) is completed. "Waiting" state. The subtasks stored in the queue are sequentially executed by the GPU of the corresponding accelerator (for example, GPU 1) (Processing in FIG. 4), and when the execution is completed, the state is “execution complete”.
 図5は、図3に示すアクセラレータ制御装置10の動作を例示する図である。図5(a)は、ユーザプログラムの処理を示すDAGを例示する。ここでは、一例として、DAGの各ノードは、タスクを分割したサブタスクを表すものとする。図5(b)を参照すると、データスケジューラ12(またはタスクスケジューラ13)は、サブタスク「2」をアクセラレータにおいて実行待ちとしたタイミングで、サブタスク「2」が完了したときに実行可能になるサブタスク「5」を第2の記憶部15が保持する当該アクセラレータ(ないしGPU)に対応するLocal Queueに追加する。データスケジューラ12は、サブタスクのスケジュールの際、第1の記憶部14が保持する実行可能リストと、第2の記憶部15が保持するスケジュール対象のアクセラレータ(ないしGPU)に対応するLocal Queueを参照し、これらのリストないしキューが保持するサブタスクの中から、当該アクセラレータ上で実行するときのメモリへの入出力データ量が最小のサブタスクを選択する。ここで、各アクセラレータ内では動作がシリアライズされることになるため、図5に示す状態において、サブタスク「5」を選択しても何ら問題はない。なお、データスケジューラ12は、サブタスクの選択において他のアクセラレータについては考慮しない。また、データスケジューラ12(またはタスクスケジューラ13)は、サブタスク「5」を選択する場合、サブタスク「5」の完了により実行可能になるサブタスクが存在するときには、さらに対応するアクセラレータ(ないしGPU)に対するLocal Queueに追加する。タスクスケジューラ13は、サブタスクの完了後、第2の記憶部15が保持するLocal Queueに該当エントリ(すなわち、実行先のアクセラレータが制限されないサブタスク、例えば上流のすべてのサブタスクの実行が完了したサブタスク)が存在する場合、かかるエントリを第2の記憶部15から第1の記憶部14が保持する実行可能リストに移動する。 FIG. 5 is a diagram illustrating the operation of the accelerator control device 10 shown in FIG. FIG. 5A illustrates a DAG indicating the processing of the user program. Here, as an example, each node of the DAG represents a subtask obtained by dividing a task. Referring to FIG. 5B, the data scheduler 12 (or the task scheduler 13) has the subtask “5” that can be executed when the subtask “2” is completed at the timing when the subtask “2” is awaiting execution in the accelerator. Is added to the Local queue corresponding to the accelerator (or GPU) held by the second storage unit 15. The data scheduler 12 refers to the executable list held in the first storage unit 14 and the local queue corresponding to the accelerator (or GPU) to be scheduled held in the second storage unit 15 when the subtask is scheduled. From the subtasks held in the list or queue, the subtask having the smallest input / output data amount to the memory when executed on the accelerator is selected. Here, since the operation is serialized in each accelerator, there is no problem even if the subtask “5” is selected in the state shown in FIG. The data scheduler 12 does not consider other accelerators in the selection of subtasks. When the data scheduler 12 (or the task scheduler 13) selects the subtask “5” and there is a subtask that can be executed upon completion of the subtask “5”, the data queue 12 (or the task scheduler 13) further selects a local queue for the corresponding accelerator (or GPU). Add to After the completion of the subtask, the task scheduler 13 has a corresponding entry in the Local Queue held by the second storage unit 15 (that is, a subtask whose execution destination accelerator is not limited, for example, a subtask in which all upstream subtasks have been executed). If the entry exists, the entry is moved from the second storage unit 15 to the executable list held by the first storage unit 14.
 このように、図3に示すアクセラレータ制御装置10は、最上流のタスク、または、上流のすべてのタスクの実行が完了したタスクを保持する第1の記憶部14と、実行先のアクセラレータが制限されたタスクとして、上流のタスクの少なくとも1つが当該アクセラレータで実行待ちであり、かつ、上流の残りのすべてのタスクの実行が完了したタスクを保持する第2の記憶部15とを有する。また、アクセラレータ制御装置10はデータスケジューラ12がアクセラレータ上で実行するときのメモリへの入出力データ量が最小のタスクを、第1の記憶部14が保持するタスク、および、第2の記憶部15が保持するタスクであって実行先が当該アクセラレータに制限されたタスクの中から選択する。これにより、メモリを有するアクセラレータを用いたタスクの処理をさらに高速化することが可能となる。なぜなら、データスケジューラ12は、タスクが実行完了となるよりも前の実行待ちの時点において、当該タスクの完了によって実行が可能となる後段のタスクについても、入出力データの準備を開始するタスクの候補とすることができるからである。 As described above, the accelerator control device 10 illustrated in FIG. 3 is limited in the first storage unit 14 that holds the most upstream task or the task for which all upstream tasks have been executed, and the execution destination accelerator. As a task, at least one of the upstream tasks is waiting to be executed by the accelerator, and the second storage unit 15 holds a task for which all the remaining upstream tasks have been executed. The accelerator control device 10 also includes a task that the first storage unit 14 holds a task having the smallest amount of input / output data to the memory when the data scheduler 12 executes on the accelerator, and a second storage unit 15. Is selected from the tasks whose execution destination is restricted to the accelerator. This makes it possible to further speed up the task processing using the accelerator having the memory. This is because the data scheduler 12 is a candidate for a task that starts the preparation of input / output data for a subsequent task that can be executed upon completion of the task at the time of execution waiting before the task is completed. Because it can be.
 次に、一実施形態に係るアクセラレータ制御装置10(図1、図3)によってもたらされる効果について、比較例と対比しつつ説明する。 Next, effects brought about by the accelerator control device 10 (FIGS. 1 and 3) according to an embodiment will be described in comparison with a comparative example.
 図6は、比較例の動作を説明するための図である。図6を参照すると、比較例においては、上流のサブタスクが完了し、実行可能となったサブタスクに対して、順番に入力データの準備と出力メモリ領域の確保が行われる。 FIG. 6 is a diagram for explaining the operation of the comparative example. Referring to FIG. 6, in the comparative example, input data is prepared and an output memory area is secured in order for subtasks that have been completed and are ready to be executed.
 図7は、一実施形態に係るアクセラレータ制御装置10の効果について説明するための図である。図7を参照すると、DAGのデータA~Cは、それぞれN個のデータパーティションに分割されている(Nは自然数)。同様に、タスクA、Bは、それぞれN個のサブタスクに分割されている。例えば、サブタスクSTa1~STaNをデータパーティションDPa1~DPaNに適用した場合、分割しない場合(すなわち、タスクAをデータAに適用した場合)と同一の結果が得られる。ここでは、データA、Bの双方のすべてのデータパーティションを、同時にアクセラレータメモリに保持することはできないものと仮定する。 FIG. 7 is a diagram for explaining the effect of the accelerator control device 10 according to the embodiment. Referring to FIG. 7, DAG data A to C are each divided into N data partitions (N is a natural number). Similarly, tasks A and B are each divided into N subtasks. For example, when the subtasks STa1 to STaN are applied to the data partitions DPa1 to DPaN, the same result as that obtained when the subtasks STa1 to STaN are not divided (that is, when the task A is applied to the data A) is obtained. Here, it is assumed that all data partitions of both data A and B cannot be simultaneously held in the accelerator memory.
 図6に示す比較例では、図7のサブタスクを処理する場合、まず、サブタスクSTa1~STaNがFIFOに積まれる。その後、サブタスクSTb1~STbNがFIFOに積まれる。しかしながら、データA、Bをアクセラレータのメモリにすべて搭載することは不可能であるため、サブタスクSTa1~STaNの実行において、後に使用されるデータパーティションDPb1~DPbNの少なくとも一部(例えばデータパーティションDPbx)をスワップアウト(Swap Out、すなわちアクセラレータメモリからメインメモリに移動)する必要がある。さらに、サブタスクSTbxの実行時にスワップアウトされていたデータパーティションDPbxをスワップイン(Swap In、すなわちメインメモリからアクセラレータメモリに移動)する必要もある。 In the comparative example shown in FIG. 6, when the subtask of FIG. 7 is processed, first, subtasks STa1 to STaN are stacked in the FIFO. Thereafter, subtasks STb1 to STbN are stacked in the FIFO. However, since it is impossible to mount all the data A and B in the memory of the accelerator, at least a part of the data partitions DPb1 to DPbN (for example, the data partition DPbx) used later in the execution of the subtasks STa1 to STaN is not possible. Swap out (Swap Out, ie move from accelerator memory to main memory). Furthermore, the data partition DPbx that has been swapped out when the subtask STbx is executed needs to be swapped in (Swap In, that is, moved from the main memory to the accelerator memory).
 一方、一実施形態に係るアクセラレータ制御装置10によると、サブタスクSTa1、STb1を実行した後、サブタスクSTa2、STb2を実行する、というように進めることができ、比較例のようにデータパーティション(例えばデータパーティションDPbx)に対するスワップ(Swap、すなわちI/O)が発生しない。したがって、一実施形態によると、アクセラレータとメインメモリとの間のデータのI/Oを比較例よりも少なくすることができ、処理の高速化を図ることが可能となる。 On the other hand, according to the accelerator control device 10 according to the embodiment, after the subtasks STa1 and STb1 are executed, the subtasks STa2 and STb2 can be executed. No swap (Swap, ie, I / O) occurs for DPbx). Therefore, according to one embodiment, data I / O between the accelerator and the main memory can be reduced as compared with the comparative example, and the processing speed can be increased.
<実施形態1>
 次に、第1の実施形態に係るアクセラレータ制御装置について、図面を参照して詳細に説明する。
<Embodiment 1>
Next, the accelerator control apparatus according to the first embodiment will be described in detail with reference to the drawings.
[構成]
 図8は、本実施形態に係るアクセラレータ制御装置1の構成を例示するブロック図である。図8を参照すると、アクセラレータ制御装置1は、アクセラレータ51~53、メインメモリ4、アクセラレータ制御部3、ユーザプログラム21、および、DAG(Directed Acyclic Graph)作成部22を備えている。アクセラレータ制御装置1は、一例として、ホストコンピュータによって実現される。なお、ユーザプログラム21は、アクセラレータ制御装置1の外部の構成としてもよい。
[Constitution]
FIG. 8 is a block diagram illustrating the configuration of the accelerator control device 1 according to this embodiment. Referring to FIG. 8, the accelerator control device 1 includes accelerators 51 to 53, a main memory 4, an accelerator control unit 3, a user program 21, and a DAG (Directed Acyclic Graph) creation unit 22. The accelerator control device 1 is realized by a host computer as an example. The user program 21 may be configured outside the accelerator control device 1.
 アクセラレータ51~53は、計算処理を実行する。 Accelerators 51 to 53 execute calculation processing.
 メインメモリ4は、アクセラレータ51~53のメモリリソースの不足により保持できなくなったデータを退避するためのメモリである。 The main memory 4 is a memory for saving data that cannot be held due to a shortage of memory resources of the accelerators 51 to 53.
 アクセラレータ制御部3は、アクセラレータ51~53を制御する。 The accelerator control unit 3 controls the accelerators 51 to 53.
 DAG作成部22は、ユーザプログラム21のAPI(Application Programming Interface)呼び出しにより、ユーザプログラム21の処理を示すDAG(Directed Acyclic Graph)を作成してアクセラレータ制御部3に送信する。 The DAG creation unit 22 creates a DAG (Directed Acyclic Graph) indicating the processing of the user program 21 by calling an API (Application Programming Interface) of the user program 21 and transmits it to the accelerator control unit 3.
 図8において、アクセラレータの数は説明の都合上3つとしている。ただし、アクセラレータの数は1つ以上であればよく、図示の態様に限定されない。アクセラレータとは、特に限定されないが、例えばNVIDIA社のGPU(Graphical Processing Unit)、Intel社のXeon Phi等である。アクセラレータはコンピュータのCPU(Central Processing Unit)のコプロセッサであり、例えばコンピュータのI/O(Input/Output)スロットに挿入する形で実装される。 In FIG. 8, the number of accelerators is three for convenience of explanation. However, the number of accelerators should just be one or more, and is not limited to the aspect of illustration. Examples of the accelerator include, but are not limited to, GPU (Graphical Processing Unit) from NVIDIA, Xeon Phi from Intel, and the like. The accelerator is a coprocessor of a CPU (Central Processing の Unit) of the computer, and is implemented, for example, by being inserted into an I / O (Input / Output) slot of the computer.
 以下では、複数のアクセラレータ51~53についての説明が重複する場合、アクセラレータ51についてのみ説明する。アクセラレータ52、53については、同様の説明があてはまる。 In the following, when the descriptions of the plurality of accelerators 51 to 53 overlap, only the accelerator 51 will be described. The same description applies to the accelerators 52 and 53.
 アクセラレータ51は、データを処理するプロセッサ511と、データを格納するアクセラレータメモリ521を備えている。ここでは、アクセラレータが有するローカルメモリをアクセラレータメモリという。 The accelerator 51 includes a processor 511 that processes data and an accelerator memory 521 that stores data. Here, the local memory included in the accelerator is referred to as an accelerator memory.
 ユーザプログラム21は、アクセラレータ51~53を利用するプログラマ(ユーザ)が作成するアプリケーションプログラム、または、ユーザによって実行されるアプリケーションプログラムである。ユーザプログラム21は、一例として、DAG作成部22によって提供されるAPIを用いて実装される。DAG作成部22によって提供されるAPIには、例えば、図9に示すように予約APIおよび実行APIの2種類のAPIが含まれる。 The user program 21 is an application program created by a programmer (user) using the accelerators 51 to 53 or an application program executed by the user. The user program 21 is implemented using an API provided by the DAG creation unit 22 as an example. The API provided by the DAG creation unit 22 includes, for example, two types of APIs, a reservation API and an execution API, as shown in FIG.
 予約APIは、図10に示すDAGのタスク(ないし処理)の1つに対応する。ユーザプログラム21から予約APIが呼び出されると、DAG作成部22は、DAGに対して1つのタスクと、そのタスクが生成するデータとを追加する。例えば、図10において、データ61に対して予約APIを用いてタスク71が呼ばれた場合、DAG作成部22はタスク71とその出力データであるデータ62をDAGに付加する。なお、予約APIは、タスクを予約するためのAPIである。すなわち、予約APIが呼び出された直後には、アクセラレータ51~53でタスクは実行されず、DAGが生成されるにすぎない。 The reservation API corresponds to one of the tasks (or processes) of the DAG shown in FIG. When the reservation API is called from the user program 21, the DAG creation unit 22 adds one task to the DAG and data generated by the task. For example, in FIG. 10, when the task 71 is called for the data 61 using the reservation API, the DAG creation unit 22 adds the task 71 and its output data 62 to the DAG. The reservation API is an API for reserving a task. That is, immediately after the reservation API is called, no tasks are executed in the accelerators 51 to 53, and only a DAG is generated.
 一方、実行APIが呼び出された場合、新たなタスクとそのタスクが生成するデータがDAGに付加される場合とされない場合がある。また、実行APIの呼び出しは、それまでに生成されたDAGのタスクの実行をトリガする。実行APIに属するタスクは、ユーザプログラム21内でDAGが処理された後のデータが必要となる場合や、計算結果のデータをアクセラレータメモリにデータオブジェクトとして保持するstoreObjectの場合等である。 On the other hand, when the execution API is called, a new task and data generated by the task may or may not be added to the DAG. In addition, calling the execution API triggers the execution of a DAG task generated so far. The tasks belonging to the execution API include a case where data after the DAG is processed in the user program 21 and a case of a storeObject that holds data as a data object in the accelerator memory.
 予約APIや実行APIは、図9に示すように1つまたは複数の引数α、β、γ、…を持つ場合がある。これらの引数のうちの1つは、カーネル関数である場合がある。ここで、カーネル関数とは、ユーザプログラム21がデータに対し実行する処理を示す関数である。APIが引数として関数をとるか否かは、予約APIや実行APIの種類に依存する。予約APIや実行APIはデータに対し行われる処理のパターンを示し、実際の具体的な処理はユーザプログラム21内で予約APIと実行APIの引数として与えられるカーネル関数によって行われる。 The reservation API and execution API may have one or more arguments α, β, γ,... As shown in FIG. One of these arguments may be a kernel function. Here, the kernel function is a function indicating processing executed by the user program 21 on data. Whether an API takes a function as an argument depends on the type of reservation API or execution API. The reservation API and the execution API indicate patterns of processing performed on the data, and actual specific processing is performed in the user program 21 by a kernel function given as an argument of the reservation API and the execution API.
 カーネル関数を引数とするAPIの一例は、mapである。mapでは、入力データを構成するすべての要素に対してカーネル関数が適用される。DAGの入力データは、例えば、画像やデータベースのテーブルである。これらのデータにmapが適用された場合、カーネル関数は画像の各画素や、データベースの各エントリに対して個別に適用される。 An example of an API that takes a kernel function as an argument is map. In the map, a kernel function is applied to all elements constituting input data. The DAG input data is, for example, an image or a database table. When map is applied to these data, the kernel function is applied individually to each pixel of the image and each entry in the database.
 一方、カーネル関数を必要としないAPIとして、例えば、storeObject,appendObject,readがある。storeObjectは、計算結果をアクセラレータメモリ521~523にデータオブジェクトとして保持するAPIである。storeObjectによると、アクセラレータメモリ521~523にデータオブジェクトとして保持するデータに名前付けを行うことが可能となる。このとき、storeObjectの引数としてオブジェクトの名前を渡す。また、appendObjectは、すでに存在するオブジェクトの末尾にデータを付加する場合に用いられるAPIである。さらに、readは、アクセラレータ51~53上に存在するデータオブジェクトの内容をユーザ空間に取得するAPIである。 On the other hand, APIs that do not require kernel functions include, for example, storeObject, appendObject, and read. storeObject is an API that stores the calculation result as a data object in the accelerator memories 521 to 523. According to storeObject, it is possible to name data stored as data objects in the accelerator memories 521 to 523. At this time, the name of the object is passed as an argument of storeObject. Further, appendObject is an API used when adding data to the end of an existing object. Furthermore, “read” is an API for acquiring the contents of the data object existing on the accelerators 51 to 53 in the user space.
 また、DAGが示すタスクの入力データとして、アクセラレータメモリ521~523が保持するデータオブジェクトを指定することが可能である。この場合、予約APIや実行APIで行う処理の入力データとして、アクセラレータ51~53が保持するオブジェクトの名前を指定する。この名前は、storeObjectを呼び出したプログラムが付けたものである。 Also, it is possible to specify data objects held in the accelerator memories 521 to 523 as input data of tasks indicated by the DAG. In this case, the name of an object held by the accelerators 51 to 53 is designated as input data for processing performed by the reservation API or execution API. This name is given by the program that called storeObject.
 ここで、DAGの各データは、図11に示すように2つ以上の分割(データパーティション)から構成されてもよい。図11は、図10のDAGのデータ61、タスク71、データ62、タスク72、および、データ63において、データを2つのデータパーティションで構成した例である。この場合、例えば、タスク71を、データパーティション61-1とデータパーティション61-2の両方に適用すれば、データ61を分割しない場合の処理と同一の結果が得られる。これは、並列計算ではデータパラレルという処理形態に属し、本発明の属する技術分野の技術者の間では一般的に知られている処理である。図11では、データパーティション61-1に対する処理をサブタスク71-1等と記しているが、サブタスク71-1の処理内容は図10におけるタスク71と同一である。また、複数の分割(データパーティション)に対する処理を、異なるアクセラレータが分散して実行するようにしてもよい。 Here, each data of the DAG may be composed of two or more divisions (data partitions) as shown in FIG. FIG. 11 shows an example in which the data is composed of two data partitions in the data 61, task 71, data 62, task 72, and data 63 of the DAG in FIG. In this case, for example, if the task 71 is applied to both the data partition 61-1 and the data partition 61-2, the same result as the processing when the data 61 is not divided can be obtained. This is a process that belongs to the processing mode of data parallel in parallel calculation and is generally known among engineers in the technical field to which the present invention belongs. In FIG. 11, the processing for the data partition 61-1 is described as a subtask 71-1, etc., but the processing content of the subtask 71-1 is the same as the task 71 in FIG. Further, the processing for a plurality of divisions (data partitions) may be executed by different accelerators in a distributed manner.
 図12は、データ61がデータパーティション61-1~61-4に分割されている場合を示す。ここで、データパーティション61-1とデータパーティション61-2は、アクセラレータ51で処理される。一方、データパーティション61-3とデータパーティション61-4は、アクセラレータ52で処理される。この場合、4つすべてのデータパーティションを1つのアクセラレータで処理する場合と比較して、理想的なケースでは2倍の計算性能が得られる。 FIG. 12 shows a case where the data 61 is divided into data partitions 61-1 to 61-4. Here, the data partition 61-1 and the data partition 61-2 are processed by the accelerator 51. On the other hand, the data partition 61-3 and the data partition 61-4 are processed by the accelerator 52. In this case, compared with the case where all four data partitions are processed by one accelerator, in the ideal case, the calculation performance is doubled.
 なお、以下の説明では、誤解のおそれがない場合、データやタスクを分割する場合について説明し、データやタスクを分割しない場合についての説明を省略する。したがって、データを分割しない場合、以下の説明におけるデータパーティションは分割前の元のデータそのものを意味し、データパーティションに対するサブタスクは元のデータに対するタスクを意味する。 In the following description, when there is no possibility of misunderstanding, the case of dividing data and tasks will be described, and the case of not dividing data and tasks will be omitted. Therefore, when data is not divided, the data partition in the following description means the original data itself before the division, and the subtask for the data partition means the task for the original data.
 DAG作成部22は、ユーザプログラム21が予約APIと実行APIを呼び出す度にDAGを生成する。予約APIが呼ばれた場合、DAG作成部22はDAGに対応する処理と出力データを付加する。一方、実行APIが呼ばれた場合、DAG作成部22はDAG処理と出力データの追加が必要であれば追加し、それまで生成したDAGをアクセラレータ制御部3に通知する。 The DAG creation unit 22 generates a DAG every time the user program 21 calls a reservation API and an execution API. When the reservation API is called, the DAG creation unit 22 adds processing corresponding to the DAG and output data. On the other hand, when the execution API is called, the DAG creation unit 22 adds DAG processing and output data if necessary, and notifies the accelerator control unit 3 of the DAG generated so far.
 なお、DAG作成部22が作成するDAGは、ユーザプログラム21が呼び出した予約APIや実行APIの種類、各APIに与えられたカーネル関数を含む。また、DAG作成部22は、DAGを通知する際、ユーザプログラム21の識別子を送信する。また、DAG作成部22は、ユーザプログラム21が終了する場合、アクセラレータ制御部3にユーザプログラム21の識別子を送信し、ユーザプログラム21が生成したデータのうちのstoreObjectで保持が指定された以外の中間データを消去するように要求する。 Note that the DAG created by the DAG creation unit 22 includes the type of reservation API and execution API called by the user program 21 and the kernel function assigned to each API. The DAG creation unit 22 transmits the identifier of the user program 21 when notifying the DAG. In addition, when the user program 21 is terminated, the DAG creation unit 22 transmits the identifier of the user program 21 to the accelerator control unit 3, and intermediate data other than the data specified by the storeObject among the data generated by the user program 21 Request to erase data.
 図13は、図8に示すアクセラレータ制御装置1のアクセラレータ制御部3の構成を例示するブロック図である。図13を参照すると、アクセラレータ制御部3は、プログラム解析部31、タスク処理部32、サブタスク記憶部36、データ管理部33、データ管理テーブル34、および、メモリ管理テーブル35を備えている。プログラム解析部31は、DAG作成部22から受信したユーザプログラム21の処理を示すDAGを解析する。タスク処理部32は、DAGの処理を実行する。サブタスク記憶部36は、DAGに含まれるサブタスクを実行可能なものと、それ以外のものとに分類して保持する。データ管理部33は、DAGの処理に必要なデータの管理や準備を行う。メモリ管理テーブル35は、アクセラレータのメモリを管理する。データ管理テーブル34は、アクセラレータのメモリ上のデータを管理する。以下、これらの各構成について詳述する。 FIG. 13 is a block diagram illustrating the configuration of the accelerator control unit 3 of the accelerator control device 1 shown in FIG. Referring to FIG. 13, the accelerator control unit 3 includes a program analysis unit 31, a task processing unit 32, a subtask storage unit 36, a data management unit 33, a data management table 34, and a memory management table 35. The program analysis unit 31 analyzes the DAG indicating the processing of the user program 21 received from the DAG creation unit 22. The task processing unit 32 executes DAG processing. The subtask storage unit 36 classifies and holds subtasks included in the DAG that can be executed and those that can be executed. The data management unit 33 manages and prepares data necessary for DAG processing. The memory management table 35 manages the memory of the accelerator. The data management table 34 manages data on the memory of the accelerator. Hereinafter, each of these configurations will be described in detail.
 メモリ管理テーブル35は、アクセラレータメモリ521~523を管理するテーブルである。アクセラレータメモリ521~523は、一定サイズのページに分割して管理される。ページサイズは、例えば、4KBや64KBである。メモリ管理テーブル35は、図14に示すように、各ページに関する情報をエントリとして保持する。各ページの情報は、そのページが属するアクセラレータ番号と、ページ番号と、そのページが使用中であることを示す使用中フラグと、そのページが使用中である場合、ページが保持するデータの識別子を示すデータ番号と、そのページが保持するデータはデータのうちのどのデータパーティションかを示すパーティション番号と、そのページが計算に使用中であり解放することが禁止されていることを示すロックフラグとを保持する。使用中フラグおよびロックフラグは、ブール値である。データの識別子は、DAGのデータに割り当てられる。 The memory management table 35 is a table for managing the accelerator memories 521 to 523. The accelerator memories 521 to 523 are divided into pages of a certain size and managed. The page size is, for example, 4 KB or 64 KB. As shown in FIG. 14, the memory management table 35 holds information about each page as an entry. The information of each page includes an accelerator number to which the page belongs, a page number, an in-use flag indicating that the page is in use, and an identifier of data held by the page when the page is in use. A data number to indicate, a partition number indicating which data partition of the data the data held by the page is, and a lock flag indicating that the page is in use for calculation and is not allowed to be released Hold. The in-use flag and the lock flag are Boolean values. The data identifier is assigned to DAG data.
 ここでは、一例として、使用中フラグは、ページが使用中である場合には「1」とし、それ以外の場合には「0」とする。また、ロックフラグは、ページの解放が禁止される場合には「1」とし、それ以外の場合には「0」とする。 Here, as an example, the in-use flag is “1” when the page is in use, and “0” otherwise. The lock flag is “1” when page release is prohibited, and “0” otherwise.
 例えば、図14に示すメモリ管理テーブル35の最初のエントリは、アクセラレータ51が保持するアクセラレータメモリ521のページ1は、データパーティション62-1(すなわち、データ61の1番目のデータパーティション)によって使用され、このページは現在計算に使用されているためロック中であることを示す。なお、ロック中のページが保持するデータは、メインメモリ4に退避させることができない。 For example, in the first entry of the memory management table 35 shown in FIG. 14, page 1 of the accelerator memory 521 held by the accelerator 51 is used by the data partition 62-1 (that is, the first data partition of the data 61). This page is locked because it is currently being used for calculations. Note that the data held by the locked page cannot be saved in the main memory 4.
 データ管理テーブル34は、アクセラレータメモリ521~523上のデータを管理する。データ管理テーブル34は、図15に示すように、ユーザプログラム21から送信されたDAG内のデータに関する情報を保持する。各エントリは、データ番号と、各データのパーティション番号と、そのデータが計算済みか否かを示す計算済フラグと、そのデータがメインメモリ4に退避されていることを示すスワップフラグと、そのデータを保持するアクセラレータ番号を示すアクセラレータ番号と、データを保持するアクセラレータのページ番号とを保持する。計算済フラグおよびスワップフラグは、ブール値である。 The data management table 34 manages data on the accelerator memories 521 to 523. As shown in FIG. 15, the data management table 34 holds information about data in the DAG transmitted from the user program 21. Each entry includes a data number, a partition number of each data, a calculated flag indicating whether the data has been calculated, a swap flag indicating that the data has been saved in the main memory 4, and the data The accelerator number indicating the accelerator number that holds and the page number of the accelerator that holds the data are held. The calculated flag and the swap flag are Boolean values.
 ここでは、一例として、計算済フラグは計算済である場合には「1」とし、それ以外の場合には「0」とする。また、スワップフラグは、データがメインメモリ4に退避されている場合には「1」とし、それ以外の場合には「0」とする。 Here, as an example, the calculated flag is “1” when it has been calculated, and “0” otherwise. The swap flag is “1” when the data is saved in the main memory 4, and is “0” otherwise.
 例えば、図15に示すデータ管理テーブル34の最初のエントリは、データ番号が62であるデータの1番目のデータパーティション(すなわち、データパーティション62-1)は既に計算済みであり、アクセラレータ51のアクセラレータメモリ521のページ1に保持されていることを示す。データ管理テーブル34のエントリが保持するアクセラレータ番号とページ番号より、メモリ管理テーブル35の該当エントリを参照し、各データが使用するページの情報を検索したり、計算に使用する場合にページをロックしたりすることが可能となる。 For example, in the first entry of the data management table 34 shown in FIG. 15, the first data partition (that is, the data partition 62-1) of the data whose data number is 62 has already been calculated, and the accelerator memory of the accelerator 51 This indicates that the data is held on page 1 of 521. Based on the accelerator number and page number held by the entry in the data management table 34, the corresponding entry in the memory management table 35 is referred to retrieve the page information used by each data, or lock the page when used for calculation. It becomes possible to do.
 プログラム解析部31は、DAG作成部22から受信したユーザの処理を示すDAGを解析し、データとタスクに分割する。プログラム解析部31は、DAG内のデータについて、データ管理テーブル34にエントリを作成する。ここで、プログラム解析部31は、データパーティション数に応じた数のエントリを作成する。なお、データのエントリ作成時点では、まだ各データパーティションの計算が行われていないため、データ管理テーブル34における計算済フラグは「0」となる。 The program analysis unit 31 analyzes the DAG indicating the user process received from the DAG creation unit 22 and divides it into data and tasks. The program analysis unit 31 creates an entry in the data management table 34 for the data in the DAG. Here, the program analysis unit 31 creates a number of entries corresponding to the number of data partitions. At the time of data entry creation, calculation of each data partition has not yet been performed, so the calculated flag in the data management table 34 is “0”.
 一方、DAGの入力データとしてユーザプログラム21の今回より前のDAGが出力したデータや、ユーザプログラム21とは別のユーザプログラムが以前に作成し、アクセラレータ上のメモリにストアしたデータオブジェクトのデータについては、エントリがすでに存在している。したがって、プログラム解析部31は、これらのデータのエントリを新たに作成する必要はない。また、これらのエントリの計算済フラグは、データ管理テーブル34において「1」にセットされている。 On the other hand, regarding the data output by the DAG before this time of the user program 21 as the input data of the DAG or the data of the data object previously created by the user program different from the user program 21 and stored in the memory on the accelerator , The entry already exists. Therefore, the program analysis unit 31 does not need to newly create these data entries. Further, the calculated flag of these entries is set to “1” in the data management table 34.
 プログラム解析部31は、DAGの「タスク」の単位に分割した処理を実行するようにタスク処理部32に要求する。プログラム解析部31は、DAGのタスク1つにつき、データパーティション数に応じてサブタスクの要求を行う。また、プログラム解析部31は、消去したエントリが使用していたページのメモリ管理テーブル35の使用中フラグを解除する(例えば、使用中フラグを「1」から「0」に変更する)ことで、アクセラレータメモリ521~523を解放する。 The program analysis unit 31 requests the task processing unit 32 to execute processing divided into units of DAG “tasks”. The program analysis unit 31 makes a subtask request for each DAG task according to the number of data partitions. Further, the program analysis unit 31 cancels the in-use flag in the memory management table 35 of the page used by the deleted entry (for example, changes the in-use flag from “1” to “0”), The accelerator memories 521 to 523 are released.
 データ管理部33は、データスケジューラ331とデータ移動部332を備えている。データスケジューラ331は、アクセラレータメモリ521~523が保持するデータの管理や、メモリの確保を指示する。データ移動部332は、アクセラレータ51~53にデータをロードし、アクセラレータメモリ521~523の確保を行う。 The data management unit 33 includes a data scheduler 331 and a data moving unit 332. The data scheduler 331 instructs management of data held in the accelerator memories 521 to 523 and reservation of the memory. The data moving unit 332 loads data to the accelerators 51 to 53 and secures the accelerator memories 521 to 523.
 データスケジューラ331は、メモリ管理テーブル35を参照して、アクセラレータ51のアクセラレータメモリ521を管理する。また、データスケジューラ331は、他のアクセラレータ52、53についても、同様に管理する。さらに、データスケジューラ331は、タスク処理部32からサブタスクの実行に必要な入力データと出力データの要求を受ける。 The data scheduler 331 manages the accelerator memory 521 of the accelerator 51 with reference to the memory management table 35. The data scheduler 331 also manages the other accelerators 52 and 53 in the same manner. Further, the data scheduler 331 receives a request for input data and output data necessary for executing the subtask from the task processing unit 32.
 実行するサブタスクがDAGの最初のサブタスクである場合、入力データとしてアクセラレータメモリが保持するデータオブジェクトの識別子が指定されている。また、実行するサブタスクが最初のサブタスク以外のサブタスクである場合、DAGにおける前段のサブタスクが完了していれば、そのサブタスクの出力データがすでに計算されている。いずれの場合も、データ管理テーブル34の対応するエントリのスワップフラグが「0」であれば、それらのデータパーティションがメインメモリ4に退避されていないため、アクセラレータメモリ上において準備が完了している。 When the subtask to be executed is the first subtask of the DAG, the identifier of the data object held in the accelerator memory is specified as input data. When the subtask to be executed is a subtask other than the first subtask, if the previous subtask in the DAG has been completed, the output data of that subtask has already been calculated. In any case, if the swap flag of the corresponding entry in the data management table 34 is “0”, those data partitions have not been saved in the main memory 4, so that the preparation is completed on the accelerator memory.
 一方、スワップフラグが「1」の場合、データスケジューラ331はそのデータパーティションをアクセラレータメモリ上に用意する。データスケジューラ331は、メモリ管理テーブル35を参照し、退避されたデータパーティションをロードするために十分な空きページがいずれかのアクセラレータ51~53に存在するか否かを確認する。十分な空きページが存在する場合、データスケジューラ331は退避されたデータをその空きページにロードするようにデータ移動部332に要求する。一方、空きページが十分でない場合、データスケジューラ331はデータ管理テーブル34およびメモリ管理テーブル35を参照し、ロックされていないページが保持するデータパーティションを選択し、そのデータパーティションをメインメモリ4に退避するようにデータ移動部332に要求する。ここで、データスケジューラ331は、データパーティションを単位として退避の要求を行う。これにより、入力データをロードするためのメモリが確保できるため、データスケジューラ331はデータ移動部332に入力データのデータパーティションをロードするよう通知する。 On the other hand, when the swap flag is “1”, the data scheduler 331 prepares the data partition in the accelerator memory. The data scheduler 331 refers to the memory management table 35 and confirms whether any of the accelerators 51 to 53 has enough free pages to load the saved data partition. If there are enough free pages, the data scheduler 331 requests the data moving unit 332 to load the saved data into the free pages. On the other hand, if there are not enough free pages, the data scheduler 331 refers to the data management table 34 and the memory management table 35, selects a data partition held by an unlocked page, and saves the data partition to the main memory 4. The data transfer unit 332 is requested as follows. Here, the data scheduler 331 makes a save request in units of data partitions. Thereby, since a memory for loading input data can be secured, the data scheduler 331 notifies the data moving unit 332 to load the data partition of the input data.
 データスケジューラ331は、サブタスクの出力データに関しては、メモリ管理テーブル35を参照し、タスク処理部32が要求するサブタスクの出力データに必要なページ数が空きページから確保可能であれば、メモリを確保するようデータ移動部332に要求する。このとき、データスケジューラ331はページを確保するアクセラレータも指定する。 For the output data of the subtask, the data scheduler 331 refers to the memory management table 35 and secures the memory if the number of pages necessary for the output data of the subtask requested by the task processing unit 32 can be secured from the free page. The data moving unit 332 is requested. At this time, the data scheduler 331 also designates an accelerator that secures a page.
 一方、空きページから確保可能でない場合、データスケジューラ331は、退避された入力データをロードするためにメモリを確保する上述の場合と同様の動作を行う。すなわち、データスケジューラ331は、まず、アクセラレータメモリ上でロックされていないページが保持するデータパーティションをメインメモリ4に退避するようにデータ移動部332に通知した後、データ移動部332に出力データを出力するためのページ数を確保させる。 On the other hand, if it is not possible to secure from a free page, the data scheduler 331 performs the same operation as the above-described case of securing memory for loading the saved input data. That is, the data scheduler 331 first notifies the data moving unit 332 to save the data partition held by the unlocked page on the accelerator memory to the main memory 4, and then outputs the output data to the data moving unit 332 Ensure the number of pages to do.
 また、データスケジューラ331は、入力データと出力データのメモリ領域をロックするようにデータ移動部332に要求する。さらに、データスケジューラ331は、タスク処理部32から処理の完了通知を受信し、データ移動部332にロック中のページのロックを解除し、データ管理テーブル34における出力データの計算済フラグを「1」にセットするように通知する。 Further, the data scheduler 331 requests the data moving unit 332 to lock the memory area for input data and output data. Further, the data scheduler 331 receives a processing completion notification from the task processing unit 32, unlocks the page locked by the data moving unit 332, and sets the calculated flag of output data in the data management table 34 to “1”. To be set to.
 なお、タスクスケジューラ321が実行を要求するサブタスクの種類によっては、入力データと出力メモリ領域の一方のみを準備すればよい場合がある。例えば、データオブジェクトの内容を取得するreadの実行要求では、出力メモリ領域を用意する必要はない。 Note that depending on the type of subtask that the task scheduler 321 requests to execute, only one of the input data and the output memory area may be prepared. For example, it is not necessary to prepare an output memory area for a read execution request for acquiring the contents of a data object.
 データ移動部332は、データスケジューラ331からの指示を受け、アクセラレータのメモリの確保や、アクセラレータに対するデータの移動を行う。 The data moving unit 332 receives an instruction from the data scheduler 331, secures the memory of the accelerator, and moves data to the accelerator.
 データ移動部332は、データスケジューラ331からの指示を受け、アクセラレータのメモリの確保を行い、メモリ管理テーブル35に確保したメモリのページのエントリを登録する。また、データ移動部332は、データ管理テーブル34のデータパーティションのエントリに、確保したメモリに該当するアクセラレータ番号とページ番号を登録する。 The data moving unit 332 receives the instruction from the data scheduler 331, secures the accelerator memory, and registers the memory page entry secured in the memory management table 35. In addition, the data moving unit 332 registers the accelerator number and page number corresponding to the reserved memory in the data partition entry of the data management table 34.
 データ移動部332は、データスケジューラ331からの指示を受け、計算に使用中のページのロックフラグを「1」にセットする。また、データ移動部332は、計算が完了したページのロックフラグを「1」から「0」に解除する。さらに、データ移動部332は、データ管理テーブル34において出力データの計算済フラグを「1」にセットする。 The data moving unit 332 receives an instruction from the data scheduler 331 and sets the lock flag of the page being used for calculation to “1”. Further, the data moving unit 332 releases the lock flag of the page for which calculation has been completed from “1” to “0”. Further, the data moving unit 332 sets the calculated flag of the output data to “1” in the data management table 34.
 データ移動部332は、データスケジューラ331からの指示を受け、データパーティションをメインメモリ4に退避する。この場合、データ移動部332は、退避したデータパーティションのデータ管理テーブル34のエントリのスワップフラグをセットする。また、データ移動部332は、退避したデータパーティションが使用していたページのメモリ管理テーブル35のエントリの使用中フラグを解除する。 The data moving unit 332 receives the instruction from the data scheduler 331 and saves the data partition to the main memory 4. In this case, the data migration unit 332 sets the swap flag of the entry in the data management table 34 of the saved data partition. In addition, the data migration unit 332 releases the in-use flag of the entry in the memory management table 35 of the page used by the saved data partition.
 タスク処理部32は、タスクスケジューラ321と、タスク実行部322を備えている。タスクスケジューラ321は、サブタスクの実行に必要な入力データと出力データのメモリ領域を要求し、また、サブタスクの実行を要求する。また、タスク実行部322は、アクセラレータ51~53にサブタスクを実行させる。 The task processing unit 32 includes a task scheduler 321 and a task execution unit 322. The task scheduler 321 requests a memory area for input data and output data necessary for execution of the subtask, and requests execution of the subtask. In addition, the task execution unit 322 causes the accelerators 51 to 53 to execute the subtask.
 タスクスケジューラ321は、プログラム解析部31からDAGに含まれるサブタスクの実行要求を受信する。タスクスケジューラ321は、データパーティションに対する処理実行の単位で要求を受信する。タスクスケジューラ321は、受信した要求に含まれるサブタスクのうち、DAGの上流から順番にサブタスクを実行する。図11で示したDAGでは、サブタスク71が上流のサブタスクに相当する。DAGにおいて、上流のサブタスクが完了しなければ、下流の(次段の)サブタスクを実行することができない。タスクスケジューラ321は、実行する各サブタスクに必要な入力データと出力データのメモリ領域をデータスケジューラ331に要求する。タスクスケジューラ321は、データスケジューラ331から要求したサブタスクに対するデータとメモリ領域の確保完了を受信後、タスク実行部322に該当するサブタスクを実行するために必要なアクセラレータ番号、入力データのアドレス、出力データを書き込むアドレス、または、これらの情報を知るために必要なデータ管理テーブル34とメモリ管理テーブル35のエントリ情報を通知し、タスク実行部322にサブタスクを実行させる。この処理は、データパーティションの単位で行われる。 The task scheduler 321 receives an execution request for a subtask included in the DAG from the program analysis unit 31. The task scheduler 321 receives a request in units of processing execution for the data partition. The task scheduler 321 executes the subtasks in order from the upstream of the DAG among the subtasks included in the received request. In the DAG shown in FIG. 11, the subtask 71 corresponds to the upstream subtask. In the DAG, if the upstream subtask is not completed, the downstream (next stage) subtask cannot be executed. The task scheduler 321 requests the data scheduler 331 for memory areas for input data and output data necessary for each subtask to be executed. The task scheduler 321 receives the data and memory area reservation completion for the subtask requested from the data scheduler 331, and then receives the accelerator number, input data address, and output data necessary to execute the subtask corresponding to the task execution unit 322. The write address or entry information of the data management table 34 and the memory management table 35 necessary to know the information is notified, and the task execution unit 322 is caused to execute the subtask. This process is performed in units of data partitions.
 要求するサブタスクが、アクセラレータが保持するデータオブジェクトにデータを追記するappendObjectである場合、タスクスケジューラ321は追記する情報をタスク実行部322に渡す。このデータは、プログラム解析部31がユーザプログラム21のDAGを受信する中に含まれている。 When the requested subtask is appendObject for adding data to the data object held by the accelerator, the task scheduler 321 passes the information to be added to the task execution unit 322. This data is included when the program analysis unit 31 receives the DAG of the user program 21.
 タスクスケジューラ321は、タスク実行部322からサブタスクの完了通知を受信し、サブタスクが完了した際には、入力データと出力データのロックを解除するようにデータスケジューラ331に通知する。 The task scheduler 321 receives the subtask completion notification from the task execution unit 322, and when the subtask is completed, notifies the data scheduler 331 to unlock the input data and the output data.
 さらに、タスクスケジューラ321は、タスク実行部322に要求したサブタスクがアクセラレータのメモリが保持するデータオブジェクトの内容を取得するreadである場合、readを実行したタスク実行部322からデータを取得し、取得したデータを、プログラム解析部31を介してユーザプログラム21に伝える。 Furthermore, when the subtask requested to the task execution unit 322 is a read that acquires the contents of the data object held in the accelerator memory, the task scheduler 321 acquires the data from the task execution unit 322 that executed the read and acquires the data Data is transmitted to the user program 21 through the program analysis unit 31.
 タスク実行部322は、タスクスケジューラ321からの指示を受け、タスクスケジューラ321から受信したユーザプログラム21のカーネル関数を用いて指定されたアクセラレータの指定された入力アドレスと出力アドレスに対して処理を行う。また、タスク実行部322は、処理完了をタスクスケジューラ321に通知する。要求されたサブタスクがappendObjectである場合、タスク実行部322は指定されたデータオブジェクトに対してデータを追記する。一方、要求されたサブタスクがデータオブジェクトの内容を取得するreadである場合、タスク実行部322は指定されたデータオブジェクトの該当番地から情報を取得してタスクスケジューラ321に通知する。 The task execution unit 322 receives an instruction from the task scheduler 321, and processes the specified input address and output address of the accelerator specified using the kernel function of the user program 21 received from the task scheduler 321. Also, the task execution unit 322 notifies the task scheduler 321 of the completion of processing. If the requested subtask is appendObject, the task execution unit 322 adds data to the specified data object. On the other hand, when the requested subtask is “read” for acquiring the contents of the data object, the task execution unit 322 acquires information from the corresponding address of the designated data object and notifies the task scheduler 321 of the information.
 次に、サブタスク記憶部36が保持する情報と、タスクスケジューラ321およびデータスケジューラ331の機能のうちの、かかる情報に関連した機能について説明する。 Next, functions related to the information among the information stored in the subtask storage unit 36 and the functions of the task scheduler 321 and the data scheduler 331 will be described.
 はじめに、サブタスクの分類について説明する。サブタスクには、以下の4つの状態がある。
(1)I/O待ち
 サブタスクの入力データパーティションの準備および出力データパーティションのメモリ確保を、サブタスクを実行するアクセラレータのメモリに対して行うことを待っている状態(例えば図4のI/O前の状態)
(2)実行待ち
 入力データパーティションの準備および出力データパーティションのメモリ確保が完了し、アクセラレータでサブタスクが実行されるのを待っている状態(例えば図4のI/Oが完了してFIFOに蓄積された状態)
(3)実行中
 サブタスクがアクセラレータ上のプロセッサで実行中の状態(例えば図4のProcessingの状態)
(4)実行完了
 サブタスクの実行が完了した状態(例えば図4のProcessingが完了した状態)
First, subtask classification will be described. The subtask has the following four states.
(1) Waiting for I / O Waiting to prepare the input data partition of the subtask and secure the memory of the output data partition for the memory of the accelerator that executes the subtask (for example, before I / O in FIG. 4) Status)
(2) Waiting for execution State where input data partition preparation and output data partition memory reservation are complete and waiting for execution of subtask by accelerator (for example, I / O in FIG. 4 is completed and stored in FIFO) State)
(3) Running State where the subtask is being executed by the processor on the accelerator (eg, Processing state in FIG. 4)
(4) Execution complete State in which execution of subtask is completed (for example, state in which processing in FIG. 4 is completed)
 以下では、アクセラレータにおけるサブタスクの入力データパーティションの準備および出力データパーティションのメモリ確保を「サブタスクの入出力データの準備」という。 In the following, the preparation of the input data partition of the subtask and the memory allocation of the output data partition in the accelerator are referred to as “preparation of input / output data of subtask”.
 図13を参照すると、サブタスク記憶部36は、実行不可能サブタスク記憶部361、実行可能サブタスク記憶部362、および、アクセラレータ実行可能サブタスク記憶部363を有する。 Referring to FIG. 13, the subtask storage unit 36 includes an inexecutable subtask storage unit 361, an executable subtask storage unit 362, and an accelerator executable subtask storage unit 363.
 実行不可能サブタスク記憶部361が記憶するサブタスクは、ユーザプログラム21から実行を依頼されたDAGが含むサブタスクの中で、データスケジューラ331が入出力データの準備を行う候補とならないサブタスクである。 ここで、入出力データの準備を行う候補とならないサブタスクとは、当該サブタスクより上流のサブタスクにI/O待ちのサブタスクを含むか、2つ以上の実行待ちサブタスクを含み、それらのサブタスクの実行を待っているアクセラレータがすべて同一でない場合である。また、実行待ちのサブタスクとは、データスケジューラ331の依頼によるデータ移動部332での入出力データの準備が完了し、タスクスケジューラ321に実行準備完了の通知が渡ったサブタスクであるが、まだデータスケジューラ331の依頼によるサブタスクの実行がタスク実行部322で開始されていない(すなわち未実行の)サブタスクである。 The subtask stored in the non-executable subtask storage unit 361 is a subtask that is not a candidate for the data scheduler 331 to prepare input / output data among the subtasks included in the DAG requested to be executed by the user program 21. Here, a subtask that is not a candidate for preparing input / output data includes a subtask that is waiting for I / O in a subtask upstream from the subtask or includes two or more execution subtasks, and executes those subtasks. This is the case when all waiting accelerators are not identical. The subtask waiting for execution is a subtask in which the preparation of input / output data in the data moving unit 332 at the request of the data scheduler 331 is completed, and the task scheduler 321 is notified of completion of execution preparation. The execution of the subtask at the request of 331 is a subtask that is not started (that is, not executed) by the task execution unit 322.
 図16は、実行不可能サブタスク記憶部361に記憶されるサブタスクの例を示す。例えば、図16(a)においてサブタスク「1」がI/O待ちの場合、サブタスク「2」は実行不可能サブタスク記憶部361に記憶される。また、図16(b)においてサブタスク「a」とサブタスク「b」が異なるアクセラレータで実行待ちの場合、サブタスク「c」は実行不可能サブタスク記憶部361に記憶される。 FIG. 16 shows an example of a subtask stored in the non-executable subtask storage unit 361. For example, in FIG. 16A, when the subtask “1” is waiting for I / O, the subtask “2” is stored in the non-executable subtask storage unit 361. In FIG. 16B, when subtask “a” and subtask “b” are waiting for execution by different accelerators, subtask “c” is stored in non-executable subtask storage unit 361.
 実行可能サブタスク記憶部362が記憶するサブタスクは、ユーザプログラム21から実行を依頼されたDAGが含むサブタスクの中で、データスケジューラ331が入出力データの準備を行う候補となるサブタスクであり、かつ、入出力データの準備を行うアクセラレータに制限がないサブタスクである。 ここで、入出力データの準備を行うアクセラレータに制限がないサブタスクとは、当該サブタスクがDAGの最も上流のサブタスクであり、それより上流のサブタスクが存在しないか、または、当該サブタスクが依存する当該サブタスクより上流のすべてのサブタスクが実行完了状態であり、当該サブタスクの入力データパーティションがメインメモリ4、または、いずれかのアクセラレータのアクセラレータメモリに保持されているサブタスクである。 The subtasks stored in the executable subtask storage unit 362 are subtasks included in the DAG requested to be executed by the user program 21 and are candidates for the data scheduler 331 to prepare input / output data, This subtask has no limitation on the accelerator that prepares the output data. Here, the subtask with no restriction on the accelerator for preparing input / output data is the subtask that is the most upstream subtask of the DAG and there is no subtask upstream from it, or the subtask on which the subtask depends All the subtasks upstream are in a state of completion of execution, and the input data partition of the subtask is a subtask held in the main memory 4 or the accelerator memory of any accelerator.
 アクセラレータ実行可能サブタスク記憶部363は、アクセラレータ数分の記憶領域を含む。各アクセラレータに対応する記憶領域に記憶されるサブタスクは、ユーザプログラム21から実行を依頼されたDAGが含むサブタスクの中で、データスケジューラ331が当該アクセラレータでのみ入出力データを準備するサブタスクの候補とすることができるサブタスクである。ここで、ただ1つのアクセラレータでのみ入出力データの準備を行うサブタスクの候補とすることができるサブタスクとは、当該サブタスクが依存するサブタスクがすべて実行待ち、または、実行完了状態であり、それらのサブタスクの少なくとも1つは実行待ちのサブタスクであり、実行待ちのサブタスクはすべて当該サブタスクが記憶される領域に対応するアクセラレータで実行待ちであるサブタスクである。 The accelerator-executable subtask storage unit 363 includes storage areas for the number of accelerators. The subtasks stored in the storage area corresponding to each accelerator are candidates for subtasks in which the data scheduler 331 prepares input / output data only in the accelerator among the subtasks included in the DAG requested to be executed by the user program 21. A subtask that can Here, a subtask that can be a candidate for a subtask that prepares input / output data with only one accelerator is a subtask on which all the subtasks that the subtask depends depend on or are in an execution complete state. At least one of the subtasks is waiting for execution, and all the subtasks waiting for execution are subtasks waiting for execution by an accelerator corresponding to the area in which the subtask is stored.
 タスクスケジューラ321は、プログラム解析部31からサブタスクの実行要求を受ける。実行要求を受けたサブタスクはすべてI/O待ち状態である。タスクスケジューラ321はサブタスクの中でDAGの一番上流のサブタスクを実行可能サブタスク記憶部362に記憶し、それ以外のサブタスクを実行不可能サブタスク記憶部361に記憶する。一番上流のサブタスクとは、そのサブタスクが依存するサブタスクが存在しないサブタスクである。タスクスケジューラ321はデータスケジューラ331に実行可能サブタスク記憶部362にサブタスクを記憶したことを通知する。  The task scheduler 321 receives a subtask execution request from the program analysis unit 31. All subtasks that have received an execution request are in an I / O waiting state. The task scheduler 321 stores the subtask upstream of the DAG among the subtasks in the executable subtask storage unit 362 and stores the other subtasks in the nonexecutable subtask storage unit 361. The uppermost subtask is a subtask in which there is no subtask on which the subtask depends. The task scheduler 321 notifies the data scheduler 331 that the subtask is stored in the executable subtask storage unit 362.
 また、タスクスケジューラ321はデータスケジューラ331から入出力データの準備が完了し実行待ちになったサブタスクと、実行を待っているアクセラレータの識別子の通知を受信し、タスク実行部322に通知されたサブタスクを通知されたアクセラレータで実行するように要求する。 Also, the task scheduler 321 receives from the data scheduler 331 the notification of the subtask that has been ready for input / output data and has been waiting for execution, and the identifier of the accelerator waiting for execution, and the subtask notified to the task execution unit 322 Request to run with the notified accelerator.
 さらに、タスクスケジューラ321は、タスク実行部322からサブタスクの実行が完了し実行完了状態になったとの通知を受信し、サブタスクの入力データと出力メモリ領域のロックを解除するようデータスケジューラ331に通知する。また、タスクスケジューラ321は、実行が完了したサブタスクにより実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363、またアクセラレータ実行可能サブタスク記憶部363から実行可能サブタスク記憶部362に移動すべきサブタスクを探索して移動させる。このとき、タスクスケジューラ321はアクセラレータ実行可能サブタスク記憶部363と実行可能サブタスク記憶部362にサブタスクを移動させたことをデータスケジューラ331に通知する。この通知は、サブタスクの移動がアクセラレータ実行可能サブタスク記憶部363と実行可能サブタスク記憶部362の双方、または、どちらか一方に発生した場合に行う。 Further, the task scheduler 321 receives a notification from the task execution unit 322 that the execution of the subtask has been completed and has entered the execution completion state, and notifies the data scheduler 331 to release the lock on the input data and the output memory area of the subtask. . In addition, the task scheduler 321 moves subtasks to be moved from the subtask storage unit 361 that cannot be executed by the subtask that has been executed to the accelerator executable subtask storage unit 363, and from the accelerator executable subtask storage unit 363 to the executable subtask storage unit 362. Search and move. At this time, the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362. This notification is performed when movement of a subtask occurs in both or either of the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362.
 データスケジューラ331は、タスクスケジューラ321からサブタスクの実行完了通知を受信し、サブタスクの入出力データパーティションのロックを解除する。このときロックを解除したアクセラレータに対してデータ移動部332にデータの入出力を行わせていない場合、データスケジューラ331は後述の「入出力開始処理」を実施する。 The data scheduler 331 receives the subtask execution completion notification from the task scheduler 321 and releases the lock on the input / output data partition of the subtask. At this time, if the data mover 332 does not input / output data to the accelerator that has been unlocked, the data scheduler 331 performs an “input / output start process” described later.
 また、データスケジューラ331はタスクスケジューラ321からサブタスクを新たに実行可能サブタスク記憶部362またはアクセラレータ実行可能サブタスク記憶部363に記憶した通知を受信し、データ移動部332にデータの入出力を行わせていないアクセラレータがある場合、それらのすべてのアクセラレータについて後述の「入出力開始処理」を実施する。  Further, the data scheduler 331 receives the notification stored in the sub-task storage unit 362 or the accelerator-executable sub-task storage unit 363 that can newly execute the subtask from the task scheduler 321 and does not cause the data movement unit 332 to input / output data. If there are accelerators, the “input / output start processing” described later is performed for all of those accelerators.
 さらに、データスケジューラ331は、データ移動部332からサブタスクの入出力データの準備完了の通知を受信し、入出力データパーティションを保持するメモリ領域をメモリ管理テーブル35においてロックし、サブタスクを実行待ち状態とし、タスクスケジューラ321にサブタスクが実行待ち状態となったことを通知する。また、データスケジューラ331は、サブタスクの入出力データの準備を完了したアクセラレータに対し、次の入出力処理を行わせるための後述の「入出力開始処理」を実施する。 Further, the data scheduler 331 receives a notification of the completion of the input / output data of the subtask from the data moving unit 332, locks the memory area holding the input / output data partition in the memory management table 35, and puts the subtask in the execution waiting state. Then, the task scheduler 321 is notified that the subtask is in the execution waiting state. In addition, the data scheduler 331 performs an “input / output start process” to be described later for causing the accelerator that has completed the preparation of the input / output data of the subtask to perform the next input / output process.
 データスケジューラ331は、「入出力開始処理」として、データの入出力を行わせていないアクセラレータに対し、次の入出力の要求を行う。データスケジューラ331は、先読み判定部334を用いてアクセラレータに次に要求する入出力処理を決定する。 The data scheduler 331 makes the next input / output request to the accelerator that is not performing data input / output as “input / output start processing”. The data scheduler 331 uses the prefetch determination unit 334 to determine the next input / output process requested to the accelerator.
 先読み判定部334がデータパーティションのスワップアウトを決定した場合、データスケジューラ331はアクセラレータが保持するデータパーティションの内、今後のDAGが含むサブタスクの処理で入力データパーティションとして使用しないデータパーティションを選択し、データ移動部332に当該データパーティションのメインメモリ4への退避指示を送信する。また、入力データパーティションとして使用しないデータパーティションが存在しない場合、データスケジューラ331は入力パーティションとして使用するデータパーティションの内、最近最も参照されなかったデータパーティションを選択し、データ移動部332にメインメモリ4への退避指示を送信する。最近最も参照されなかったデータパーティションの選択は、LRU(Least Recently Used)の基準に基づく管理方式であり、当該技術分野の技術者にとって一般的な知識である。なお、退避されるデータパーティションを保持するメモリ領域は、メモリ管理テーブル35によってロックされていないことが必要である。ロックされていないデータパーティションが存在しない場合、データスケジューラ331は何も行わない。 When the prefetch determination unit 334 determines that the data partition is swapped out, the data scheduler 331 selects a data partition that is not used as an input data partition in the processing of subtasks included in the DAG in the future from among the data partitions held by the accelerator. An instruction to save the data partition to the main memory 4 is transmitted to the moving unit 332. If there is no data partition that is not used as an input data partition, the data scheduler 331 selects a data partition that has not been referred to most recently from data partitions that are used as an input partition, and sends the data partition 332 to the main memory 4. Send the save instruction. The selection of the data partition that has been least referenced recently is a management method based on the LRU (Least Recently Used) standard, and is common knowledge for engineers in the technical field. Note that the memory area holding the saved data partition must not be locked by the memory management table 35. If there is no unlocked data partition, the data scheduler 331 does nothing.
 一方、先読み判定部334が決定した入出力処理がデータパーティションの準備指示の場合、データスケジューラ331は次回サブタスク判定部336を用いて当該アクセラレータに対して行わせる入出力データの準備の対象となるサブタスクを決定する。次回サブタスク判定部336が決定したサブタスクの入力データパーティションを当該アクセラレータがアクセラレータメモリに保持する場合、データスケジューラ331は入力データパーティションをロックする。また、データスケジューラ331は、当該アクセラレータが保持しない入力データパーティションの準備と出力データパーティションの確保をデータ移動部332に要求する。  On the other hand, when the input / output processing determined by the prefetch determination unit 334 is a data partition preparation instruction, the data scheduler 331 uses the subtask determination unit 336 next time to create a subtask to be prepared for input / output data to be executed by the accelerator. To decide. When the accelerator stores the input data partition of the subtask determined by the subtask determination unit 336 next time in the accelerator memory, the data scheduler 331 locks the input data partition. Further, the data scheduler 331 requests the data moving unit 332 to prepare an input data partition that is not held by the accelerator and to secure an output data partition.
 さらに、データスケジューラ331はデータ移動部332からデータパーティションのメインメモリ4への退避の完了通知を受信し、退避が完了したアクセラレータに次のデータの入出力を行わせるために入出力開始処理を実行する。 Further, the data scheduler 331 receives a notification of completion of saving of the data partition from the data migration unit 332 to the main memory 4 and executes an input / output start process for causing the accelerator that has completed the saving to input / output the next data. To do.
 先読み判定部334は、データスケジューラ331のために、アクセラレータに要求する入出力処理を決定する。先読み判定部334は、メモリ管理テーブル35を参照し、アクセラレータメモリの使用量がしきい値(例えば、アクセラレータメモリの容量の70%~80%)以上であれば、データスケジューラ331にデータパーティションのスワップアウトを行わせる。一方、しきい値未満であれば、先読み判定部334は、データスケジューラ331にデータパーティションの準備を行わせる。 The prefetch determination unit 334 determines an input / output process requested to the accelerator for the data scheduler 331. The prefetch determination unit 334 refers to the memory management table 35, and if the usage amount of the accelerator memory is equal to or greater than a threshold value (for example, 70% to 80% of the capacity of the accelerator memory), the data scheduler 331 swaps the data partition. Let out. On the other hand, if it is less than the threshold value, the prefetch determination unit 334 causes the data scheduler 331 to prepare a data partition.
 次回サブタスク判定部336は、データスケジューラ331のために、指定されたアクセラレータに対して次に入出力データの準備を行わせるサブタスクを指定する。次回サブタスク判定部336は、実行可能サブタスク記憶部362と、アクセラレータ実行可能サブタスク記憶部363と、データ管理テーブル34を参照し、入出力データの準備においてアクセラレータへのデータのI/Oが最小となるサブタスクを、次に入出力データを準備するサブタスクとして指定する。 The next-time subtask determination unit 336 designates a subtask for the data scheduler 331 that causes the designated accelerator to prepare the next input / output data. The next subtask determination unit 336 refers to the executable subtask storage unit 362, the accelerator executable subtask storage unit 363, and the data management table 34, and minimizes the data I / O to the accelerator in the preparation of input / output data. Designate the subtask as the next subtask to prepare the input / output data.
 具体的には、次回サブタスク判定部336は、アクセラレータのデータI/Oが最小となるサブタスクの選択の際、アクセラレータ実行可能サブタスク記憶部363の当該アクセラレータが該当する領域と、実行可能サブタスク記憶部362が記憶するサブタスクを全探索することで選択する。次回サブタスク判定部336は、探索するサブタスクにおいて、入力データパーティションに関しては指定されたアクセラレータメモリが保持しないデータパーティションをI/Oが必要なデータパーティションとしてそのデータ容量を総I/O容量にカウントする。また、次回サブタスク判定部336は、出力データパーティションに関しては、出力データパーティションのデータ容量を確保するとアクセラレータメモリの使用量がしきい値を超える場合、しきい値を超える分の容量を総I/O容量にカウントする。これは、サブタスクの入出力データの準備を行う場合、しきい値を超える分のデータ容量に当たるデータパーティションをアクセラレータから退避する必要があるからである。次回サブタスク判定部336は、各サブタスクについてカウントした総I/O容量が最小となるサブタスクを、アクセラレータのデータI/Oが最小となるサブタスクとして選択する。 Specifically, the next-time subtask determination unit 336 selects an area corresponding to the accelerator in the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362 when selecting a subtask that minimizes the data I / O of the accelerator. Select by sub-searching the subtasks memorized. Next time, the subtask determination unit 336 counts the data capacity of the input data partition as the data partition that requires the I / O as the total I / O capacity in the subtask to be searched as a data partition that requires I / O. Further, the next subtask determination unit 336, regarding the output data partition, if the data capacity of the output data partition is secured and the amount of use of the accelerator memory exceeds the threshold value, the capacity exceeding the threshold value is calculated as the total I / O capacity. Count on capacity. This is because, when preparing the input / output data of the subtask, it is necessary to save the data partition corresponding to the data capacity exceeding the threshold from the accelerator. The next subtask determination unit 336 selects the subtask having the smallest total I / O capacity counted for each subtask as the subtask having the smallest data I / O of the accelerator.
 データ移動部332は、データスケジューラ331からサブタスクの入出力データの準備と、入出力データの準備を行うアクセラレータの指定を受信し、入出力データの準備を行う。データ移動部332は、入力データパーティションに関しては、入力データパーティションを保持するメインメモリ4や他のアクセラレータから入力データパーティションをロードする。一方、データ移動部332は、入出力データパーティションに関しては、データパーティションを出力するために必要なメモリ領域を確保する。また、データ移動部332は、入出力データパーティションとそれらが使用するメモリ領域に関してメモリ管理テーブル35とデータ管理テーブル34が保持する関連情報を更新する。 The data moving unit 332 receives input of the subtask input / output data and the designation of the accelerator for preparing the input / output data from the data scheduler 331, and prepares the input / output data. Regarding the input data partition, the data moving unit 332 loads the input data partition from the main memory 4 or another accelerator that holds the input data partition. On the other hand, regarding the input / output data partition, the data moving unit 332 secures a memory area necessary for outputting the data partition. Further, the data moving unit 332 updates related information held in the memory management table 35 and the data management table 34 regarding the input / output data partitions and the memory areas used by them.
 さらに、データ移動部332はデータスケジューラ331からデータパーティションのメインメモリ4への退避の指示を受信し、指定されたデータパーティションをメインメモリ4に退避する。また、データ移動部332は、退避したデータパーティションとそれが使用するメモリ領域に関してメモリ管理テーブル35とデータ管理テーブル34が保持する関連情報を更新する。 Further, the data moving unit 332 receives an instruction to save the data partition to the main memory 4 from the data scheduler 331 and saves the designated data partition to the main memory 4. Further, the data migration unit 332 updates related information held in the memory management table 35 and the data management table 34 regarding the saved data partition and the memory area used by the data partition.
[動作]
 次に、本実施形態の動作について、図8、図13および図17を参照して詳細に説明する。図17は、本実施形態に係るアクセラレータ制御装置1の動作を例示するフロー図である。
[Operation]
Next, the operation of this embodiment will be described in detail with reference to FIG. 8, FIG. 13, and FIG. FIG. 17 is a flowchart illustrating the operation of the accelerator control device 1 according to this embodiment.
 まず、予約APIと実行APIを用いて作成されたユーザプログラム21が実行される(ステップA1)。 First, the user program 21 created using the reservation API and the execution API is executed (step A1).
 ユーザプログラム21が実行APIを呼び出すと(ステップA2のYes)、DAG作成部22は、それまでに生成したDAGを通知する処理に移行する。 When the user program 21 calls the execution API (Yes in step A2), the DAG creation unit 22 proceeds to a process of notifying the DAG generated so far.
 一方、実行API呼び出しでない場合(ステップA2のNo)、DAG作成部22は予約API呼び出しか否かを確認する(ステップA3)。 On the other hand, if it is not an execution API call (No in Step A2), the DAG creation unit 22 checks whether or not it is a reservation API call (Step A3).
 予約API呼び出しである場合(ステップA3のYes)、DAG作成部22は予約APIで指定されたタスクとデータをそれまで生成したDAGに追加する(ステップA4)。 If it is a reservation API call (Yes in step A3), the DAG creation unit 22 adds the task and data specified by the reservation API to the DAG generated so far (step A4).
 次に、ユーザプログラム21が終了する場合(ステップA5のYes)、ユーザプログラム21の実行は完了する。 Next, when the user program 21 ends (Yes in step A5), the execution of the user program 21 is completed.
 一方、ユーザプログラム21が終了しない場合(ステップA5のNo)、ステップA1に戻り、ユーザプログラム21の実行が継続される。 On the other hand, when the user program 21 does not end (No in step A5), the process returns to step A1 and the execution of the user program 21 is continued.
 実行APIが呼び出された場合(ステップA2のYes)、DAG作成部22は、必要であればDAGに最後のタスクとデータを追加し、DAGをプログラム解析部31に通知する(ステップA6)。 When the execution API is called (Yes in Step A2), the DAG creation unit 22 adds the last task and data to the DAG if necessary, and notifies the program analysis unit 31 of the DAG (Step A6).
 プログラム解析部31は、DAGを受信し、DAGを構成するタスクを個別に分解する。次に、プログラム解析部31は、各サブタスクの実行をタスク処理部32に要求する(ステップA7)。要求されたサブタスクの実行は、データパーティションの単位で行う。例えば、図11に示すタスク71では、タスク71がサブタスク71-1とサブタスク71-2の2つから構成されるため、2個の個別のタスクがプログラム解析部31により生成され、タスク処理部32に要求される。なお、個別のデータパーティションに対するタスクをサブタスクと呼ぶ代わりに、単にタスクとも呼ぶ。 The program analysis unit 31 receives the DAG and disassembles the tasks constituting the DAG individually. Next, the program analysis unit 31 requests the task processing unit 32 to execute each subtask (step A7). The requested subtask is executed in units of data partitions. For example, in the task 71 shown in FIG. 11, since the task 71 includes two subtasks 71-1 and 71-2, two individual tasks are generated by the program analysis unit 31, and the task processing unit 32 As required. A task for an individual data partition is simply called a task instead of a subtask.
 タスクスケジューラ321は、次のサブタスクの実行に必要な入力データと出力データのメモリ領域をデータ管理部33に要求する(ステップA8)。 The task scheduler 321 requests the memory area of input data and output data necessary for execution of the next subtask from the data management unit 33 (step A8).
 データスケジューラ331は、データ管理テーブル34を参照し、要求されたデータのスワップフラグが「1」にセットされていなければ、データが準備完了であると判断する(ステップA9のYes)。そして、データスケジューラ331は入力データが使用するメモリページのメモリ管理テーブル35の該当するエントリのロックフラグをセットするようにデータ移動部332に要求する。 The data scheduler 331 refers to the data management table 34, and determines that the data is ready if the swap flag of the requested data is not set to “1” (Yes in step A9). Then, the data scheduler 331 requests the data moving unit 332 to set the lock flag of the corresponding entry in the memory management table 35 of the memory page used by the input data.
 一方、要求されたデータのスワップフラグが「1」にセットされている場合(ステップA9のNo)、タスクスケジューラ321は、メモリ管理テーブル35を参照し、メインメモリ4に退避されたデータを収容するために十分なメモリ空き領域を保持するアクセラレータが存在するとき、そのアクセラレータに入力データをロードするようにデータ移動部332に要求する。データ移動部332は、指定されたアクセラレータに入力データをロードし、データ管理テーブル34の該当するデータのスワップフラグ、アクセラレータ番号、ページ番号を更新する(ステップA10)。また、データスケジューラ331は、メモリ管理テーブル35において、ロードしたデータが使用するページについて、使用中フラグ、データ番号、および、パーティション番号を更新する。また、データスケジューラ331は、メモリ管理テーブル35においてロックフラグを「1」にセットする。 On the other hand, when the swap flag of the requested data is set to “1” (No in step A9), the task scheduler 321 refers to the memory management table 35 and accommodates the data saved in the main memory 4. Therefore, when there is an accelerator that holds a sufficient memory free area, the data moving unit 332 is requested to load input data to the accelerator. The data moving unit 332 loads input data to the designated accelerator, and updates the swap flag, accelerator number, and page number of the corresponding data in the data management table 34 (step A10). In addition, the data scheduler 331 updates the in-use flag, the data number, and the partition number for the page used by the loaded data in the memory management table 35. Further, the data scheduler 331 sets the lock flag to “1” in the memory management table 35.
 一方、メインメモリ4に退避されたデータを収容するために十分なメモリ空き領域を保持するアクセラレータが存在しない場合、データスケジューラ331はメモリ管理テーブル35を参照し、ロックフラグがセットされていないページを使用しているデータを選択し、メインメモリ4に退避するようにデータ移動部332に要求する。データ移動部332は指定されたデータを退避し、データ管理テーブル34におけるスワップフラグとアクセラレータ番号とページ番号を更新する。データがメインメモリ4に退避されると、そのデータのアクセラレータ番号とページ番号は無効となる。データスケジューラ331は、入力データをアクセラレータにロードするために必要なメモリ領域が空くまで、データ退避の要求を継続する。入力データをロードするためのメモリが空きになると、その後のデータをロードする処理は、メインメモリ4に退避されたデータを収容するために十分なメモリ空き領域を保持するアクセラレータが存在する場合のデータのロードの処理と同様である。 On the other hand, when there is no accelerator that holds sufficient memory free space to accommodate the data saved in the main memory 4, the data scheduler 331 refers to the memory management table 35 and selects a page for which the lock flag is not set. The data moving unit 332 is requested to select the data being used and save it in the main memory 4. The data mover 332 saves the designated data and updates the swap flag, accelerator number, and page number in the data management table 34. When data is saved in the main memory 4, the accelerator number and page number of the data become invalid. The data scheduler 331 continues the data save request until a memory area necessary for loading the input data into the accelerator becomes available. When the memory for loading the input data becomes empty, the subsequent data loading process is performed when there is an accelerator that has sufficient memory free space to accommodate the data saved in the main memory 4. This is the same as the loading process.
 次に、データスケジューラ331は、要求されたサブタスクの出力メモリ領域がサブタスクの入力データを保持するアクセラレータに確保可能か否かを確認する(ステップA11)。ここで、空きメモリ領域が十分である場合、確保可能と判断する(ステップA11のYes)。 Next, the data scheduler 331 checks whether or not the output memory area of the requested subtask can be secured in the accelerator that holds the input data of the subtask (step A11). If the free memory area is sufficient, it is determined that it can be secured (Yes in step A11).
 一方、空きメモリ領域が十分でない場合(ステップA11のNo)、データスケジューラ331は、メモリ管理テーブル35を参照し、ロックフラグがセットされていないページを使用するデータを退避するようデータ移動部332に要求する。データ移動部332が指定されたデータを退避する動作(ステップA12)は、ステップA10においてデータを退避する場合の動作と同様である。 On the other hand, when the free memory area is not sufficient (No in step A11), the data scheduler 331 refers to the memory management table 35 and instructs the data moving unit 332 to save the data using the page for which the lock flag is not set. Request. The operation (step A12) for saving the designated data by the data moving unit 332 is the same as the operation for saving the data in step A10.
 アクセラレータに出力データを収容するために十分なメモリ領域が空くと、データスケジューラ331は、データ移動部332に出力データのメモリを確保するように要求する(ステップA13)。 When the memory area sufficient to accommodate the output data is available in the accelerator, the data scheduler 331 requests the data moving unit 332 to secure the output data memory (step A13).
 データ移動部332はメモリを確保し、出力データの該当するデータ管理テーブル34のエントリにおいてアクセラレータ番号とページ番号を記載する。また、使用しているページのメモリ管理テーブル35のロックフラグをセットする。データスケジューラ331は、入力データと出力データのメモリ領域がアクセラレータ上に用意されると、タスク処理部32にデータの用意完了を通知する(ステップA14)。 The data moving unit 332 reserves a memory, and describes the accelerator number and page number in the entry of the corresponding data management table 34 of the output data. In addition, the lock flag of the memory management table 35 of the page being used is set. When the memory area for input data and output data is prepared on the accelerator, the data scheduler 331 notifies the task processing unit 32 of the completion of data preparation (step A14).
 タスクスケジューラ321は、データ用意完了通知を受け、タスク実行部322にサブタスクの実行を要求する(ステップA15)。 The task scheduler 321 receives the data preparation completion notification and requests the task execution unit 322 to execute the subtask (step A15).
 実行するサブタスクの要求がユーザプログラム21により与えられたカーネル関数の実行である場合、タスク実行部322はデータを保持するアクセラレータを用いて入力データに対しカーネル関数を実行させ、出力メモリ領域に結果を出力させる。一方、実行するサブタスクの要求がデータのreadである場合、タスク実行部322はデータを保持するアクセラレータからデータを読み、タスクスケジューラ321に通知する。また、実行するサブタスクの要求がデータを付加するappendである場合、タスク実行部322はデータを保持するアクセラレータのメモリ領域に与えられたデータを書き込む。タスクスケジューラ321は、タスク実行部322によるサブタスクの実行が完了すると、データ管理部33にサブタスク完了を通知する(ステップA16)。 When the request for the subtask to be executed is the execution of the kernel function given by the user program 21, the task execution unit 322 executes the kernel function on the input data using the accelerator that holds the data, and the result is stored in the output memory area. Output. On the other hand, when the request for the subtask to be executed is data read, the task execution unit 322 reads the data from the accelerator that holds the data and notifies the task scheduler 321 of the data. If the request for the subtask to be executed is append to add data, the task execution unit 322 writes the given data to the memory area of the accelerator that holds the data. When the task execution unit 322 completes the execution of the subtask, the task scheduler 321 notifies the data management unit 33 of the completion of the subtask (step A16).
 タスクスケジューラ321は、処理が完了した入力データと出力データについて、メモリ管理テーブル35におけるロックフラグを解除するとともに、出力データについてデータ管理テーブル34における該当エントリの計算済フラグをセットするように、データ移動部332に要求する(ステップA17)。データ移動部332は、要求された処理を行う。 The task scheduler 321 releases the lock flag in the memory management table 35 for the input data and output data for which processing has been completed, and sets the calculated flag of the corresponding entry in the data management table 34 for the output data. Request to the unit 332 (step A17). The data moving unit 332 performs the requested process.
 タスクスケジューラ321は、プログラム解析部31から要求されたDAGのすべてのサブタスクが完了するまで(ステップA18のNo)、サブタスクに関するデータの要求とサブタスクの実行を継続する。 The task scheduler 321 continues to request data on the subtask and execute the subtask until all the subtasks of the DAG requested from the program analysis unit 31 are completed (No in Step A18).
 一方、DAGの処理が完了すると(ステップA18のYes)、ステップA1に戻る。 On the other hand, when the DAG processing is completed (Yes in step A18), the process returns to step A1.
 次に、タスクスケジューラ321およびデータスケジューラ331の動作のうちの、サブタスク記憶部36が保持する情報に基づく動作について説明する。 Next, of the operations of the task scheduler 321 and the data scheduler 331, an operation based on information held by the subtask storage unit 36 will be described.
 図18は、タスクスケジューラ321とデータスケジューラ331の詳細な動作を例示するシーケンス図である。 FIG. 18 is a sequence diagram illustrating detailed operations of the task scheduler 321 and the data scheduler 331.
 図18を参照すると、タスクスケジューラ321は、プログラム解析部31からサブタスクの実行要求を受けると、サブタスクの中でDAGの一番上流のサブタスクを実行可能サブタスク記憶部362に記憶し、それ以外のサブタスクを実行不可能サブタスク記憶部361に記憶する(ステップB1)。タスクスケジューラ321は、実行可能サブタスク記憶部362にサブタスクを記憶したことをデータスケジューラ331に通知する(ステップB2)。 Referring to FIG. 18, when the task scheduler 321 receives a subtask execution request from the program analysis unit 31, the task scheduler 321 stores the subtask upstream of the DAG in the subtask in the executable subtask storage unit 362, and other subtasks Is stored in the inexecutable subtask storage unit 361 (step B1). The task scheduler 321 notifies the data scheduler 331 that the subtask has been stored in the executable subtask storage unit 362 (step B2).
 データスケジューラ331はタスクスケジューラ321からサブタスクを新たに実行可能サブタスク記憶部362に記憶した通知を受信し、データ移動部332にデータの入出力を行わせていないアクセラレータがある場合、それらのすべてのアクセラレータについて「入出力開始処理」を実施する(ステップB3)。 The data scheduler 331 receives the notification stored in the subtask storage unit 362 that can newly execute the subtask from the task scheduler 321, and if there is an accelerator that does not cause the data moving unit 332 to input / output data, all of those accelerators The "input / output start process" is performed for (Step B3).
 また、データスケジューラ331は、データ移動部332からサブタスクの入出力データの準備完了の通知を受信し、入出力データパーティションを保持するメモリ領域をメモリ管理テーブル35においてロックしてサブタスクを実行待ち状態とし(ステップB4)、タスクスケジューラ321にサブタスクが実行待ち状態となった旨を通知する(ステップB5)。さらに、データスケジューラ331は、サブタスクの入出力データの準備を完了したアクセラレータに対し、次の入出力処理を行わせるための「入出力開始処理」を実施する(ステップB6)。 In addition, the data scheduler 331 receives a notification of the completion of input / output data of the subtask from the data mover 332, locks the memory area holding the input / output data partition in the memory management table 35, and puts the subtask into the execution waiting state. (Step B4), the task scheduler 321 is notified that the subtask is waiting to be executed (Step B5). Further, the data scheduler 331 performs “input / output start processing” for causing the accelerator that has completed the preparation of the input / output data of the subtask to perform the next input / output processing (step B6).
 タスクスケジューラ321は入出力データの準備が完了し実行待ちになったサブタスクと、実行を待っているアクセラレータの識別子の通知をデータスケジューラ331から受信し、タスク実行部322に通知されたサブタスクを通知されたアクセラレータで実行するように要求する(ステップB7)。 The task scheduler 321 receives from the data scheduler 331 the notification of the subtask that has been ready for input / output data and is waiting for execution, and the identifier of the accelerator waiting for execution, and is notified of the subtask notified to the task execution unit 322. Request to be executed by the accelerator (step B7).
 また、タスクスケジューラ321は、タスク実行部322からサブタスクの実行が完了し実行完了状態になったとの通知を受信し、サブタスクの入力データと出力メモリ領域のロックを解除するようデータスケジューラ331に通知する(ステップB8)。データスケジューラ331は、タスクスケジューラ321からサブタスクの実行完了通知を受信し、サブタスクの入出力データパーティションのロックを解除する(ステップB9)。 Also, the task scheduler 321 receives a notification from the task execution unit 322 that the execution of the subtask has been completed and has entered the execution completion state, and notifies the data scheduler 331 to release the lock on the input data and the output memory area of the subtask. (Step B8). The data scheduler 331 receives the subtask execution completion notification from the task scheduler 321 and releases the lock of the input / output data partition of the subtask (step B9).
 さらに、タスクスケジューラ321は、実行が完了したサブタスクが生じたことにより、実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363に移動すべきサブタスクと、アクセラレータ実行可能サブタスク記憶部363から実行可能サブタスク記憶部362に移動すべきサブタスクを探索して移動させる(ステップB10)。また、タスクスケジューラ321はアクセラレータ実行可能サブタスク記憶部363と実行可能サブタスク記憶部362にサブタスクを移動させたことを、データスケジューラ331に通知する(ステップB11)。 Further, the task scheduler 321 can execute the subtask to be moved from the non-executable subtask storage unit 361 to the accelerator-executable subtask storage unit 363 and the accelerator-executable subtask storage unit 363 when a subtask that has been executed has occurred. A subtask to be moved is searched for and moved to the subtask storage unit 362 (step B10). Further, the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363 and the executable subtask storage unit 362 (step B11).
 データスケジューラ331はタスクスケジューラ321からサブタスクを新たに実行可能サブタスク記憶部362またはアクセラレータ実行可能サブタスク記憶部363に記憶した通知を受信し(ステップB11)、データ移動部332にデータの入出力を行わせていないアクセラレータがある場合、それらのすべてのアクセラレータについて「入出力開始処理」を実施する(ステップB12)。 The data scheduler 331 receives the notification stored in the sub-task storage unit 362 or the accelerator-executable sub-task storage unit 363 that can newly execute the subtask from the task scheduler 321 (step B11), and causes the data movement unit 332 to input / output data. If there are any accelerators that are not present, the "input / output start processing" is performed for all the accelerators (step B12).
 図19は、データスケジューラ331による上述の「入出力開始処理」(図18のステップB3、B6、B12)を例示するフロー図である。図19を参照すると、データスケジューラ331は、先読み判定部334を用いてアクセラレータに次に要求する入出力処理を決定する(ステップC1)。 FIG. 19 is a flowchart illustrating the above-described “input / output start processing” (steps B3, B6, and B12 in FIG. 18) by the data scheduler 331. Referring to FIG. 19, the data scheduler 331 uses the prefetch determination unit 334 to determine an input / output process to be requested next to the accelerator (step C1).
 先読み判定部334がデータパーティションのスワップアウトを決定した場合(ステップC2のYes)、データスケジューラ331はアクセラレータが保持するデータパーティションの内、今後のDAGが含むサブタスクの処理で入力データパーティションとして使用しないデータパーティション、または、データスケジューラ331は入力データパーティションとして使用するデータパーティションの内、最近最も参照されなかったデータパーティションを選択し、データ移動部332にメインメモリ4への退避指示を送信する(ステップC3)。 When the prefetch determination unit 334 decides to swap out the data partition (Yes in Step C2), the data scheduler 331 uses the data partition held by the accelerator and does not use it as the input data partition in the processing of the subtask included in the future DAG. The partition or the data scheduler 331 selects a data partition that has not been referred to most recently among the data partitions used as the input data partition, and transmits a save instruction to the main memory 4 to the data moving unit 332 (step C3). .
 一方、先読み判定部334が決定した入出力処理がデータパーティションの準備指示の場合(ステップC2のNo)、データスケジューラ331は次回サブタスク判定部336を用いて当該アクセラレータに対して行わせる入出力データの準備の対象となるサブタスクを決定する(ステップC4)。さらに、データスケジューラ331は、次回サブタスク判定部336が決定したサブタスクの入力データパーティションを当該アクセラレータがアクセラレータメモリに保持する場合、入力データパーティションをロックする。また、データスケジューラ331は、当該アクセラレータが保持しない入力データパーティションの準備と出力データパーティションの確保をデータ移動部332に要求する(ステップC5)。 On the other hand, when the input / output processing determined by the prefetch determination unit 334 is a data partition preparation instruction (No in step C2), the data scheduler 331 uses the subtask determination unit 336 next time to input / output data to be performed by the accelerator. A subtask to be prepared is determined (step C4). Further, the data scheduler 331 locks the input data partition when the accelerator stores the input data partition of the subtask determined by the next subtask determination unit 336 in the accelerator memory. Further, the data scheduler 331 requests the data migration unit 332 to prepare an input data partition that is not held by the accelerator and to secure an output data partition (step C5).
 図20は、先読み判定部334の動作(図19のステップC1)を例示するフロー図である。図20を参照すると、先読み判定部334は、メモリ管理テーブル35を参照する(ステップD1)。アクセラレータのメモリの使用量がしきい値以上である場合(ステップD2のYes)、先読み判定部334はデータスケジューラ331にデータパーティションのスワップアウトを行わせる(ステップD3)。一方、しきい値未満である場合(ステップD2のNo)、先読み判定部334はデータスケジューラ331にデータパーティションの準備を行わせる(ステップD4)。 FIG. 20 is a flowchart illustrating the operation of the prefetch determination unit 334 (step C1 in FIG. 19). Referring to FIG. 20, the prefetch determination unit 334 refers to the memory management table 35 (step D1). If the accelerator memory usage is equal to or greater than the threshold (Yes in Step D2), the prefetch determination unit 334 causes the data scheduler 331 to swap out the data partition (Step D3). On the other hand, when it is less than the threshold (No in Step D2), the prefetch determination unit 334 causes the data scheduler 331 to prepare the data partition (Step D4).
 図21は、次回サブタスク判定部336の動作(図19のステップC4)を例示するフロー図である。図21を参照すると、次回サブタスク判定部336は、アクセラレータ実行可能サブタスク記憶部363の当該アクセラレータが該当する領域と、実行可能サブタスク記憶部362が記憶するサブタスクを全探索して、1つのサブタスクを選択する(ステップE1)。 FIG. 21 is a flowchart illustrating the operation of the next subtask determination unit 336 (step C4 in FIG. 19). Referring to FIG. 21, the next subtask determination unit 336 searches all areas corresponding to the accelerator in the accelerator executable subtask storage unit 363 and the subtask stored in the executable subtask storage unit 362 and selects one subtask. (Step E1).
 次回サブタスク判定部336は、選択したサブタスクをアクセラレータ上で実行する際に、アクセラレータメモリに対して必要とされる総I/O量を算出する。ここで、次回サブタスク判定部336は、総I/O量を
「アクセラレータにロードする入力データ量」+「アクセラレータからスワップアウトされるデータ量」
から算出する。
Next time, the subtask determination unit 336 calculates the total I / O amount required for the accelerator memory when the selected subtask is executed on the accelerator. Here, the next subtask determination unit 336 calculates the total I / O amount as “the amount of input data to be loaded into the accelerator” + “the amount of data swapped out from the accelerator”.
Calculate from
 次回サブタスク判定部336は、入力データパーティションに関しては、指定されたアクセラレータメモリが保持しないデータパーティションをI/Oが必要なデータパーティションとし、そのデータ量を上式第1項の「アクセラレータにロードする入力データ量」にカウントする(ステップE2)。 The next subtask determination unit 336 regards the input data partition as a data partition that requires I / O as the data partition that the specified accelerator memory does not hold, and sets the amount of data as “input to be loaded into the accelerator” Count to “data amount” (step E2).
 また、次回サブタスク判定部336は、上式第2項の「アクセラレータからスワップアウトされるデータ量」を
「上式第1項としてロードされる入力データ量」+「出力領域としてアクセラレータメモリ上に確保すべき領域のサイズ」-「ロード先のアクセラレータメモリのしきい値までの空き容量」
から算出する(ステップE3)。一例として、しきい値までの空きメモリ容量を1GBとし、新たにアクセラレータにロードする入力データを500MBとし、確保する出力領域を1GBとした場合、上式第2項の「アクセラレータからスワップアウトされるデータ」量は、
500MB(ロードする入力データ) + 1GB(確保する出力領域) - 1GB(空き領域) = 500MB
となる。
In addition, the subtask determination unit 336 next time secures “the amount of data swapped out from the accelerator” in the second term of the above equation “the amount of input data loaded as the first term of the above equation” + “the output area on the accelerator memory. Area size to be "-" free space up to the threshold of the accelerator memory at the load destination "
(Step E3). As an example, if the free memory capacity up to the threshold is 1GB, the input data to be newly loaded into the accelerator is 500MB, and the output area to be secured is 1GB, the second term "swapped out from the accelerator" The amount of “data” is
500MB (input data to load) + 1GB (output area to secure)-1GB (free space) = 500MB
It becomes.
 次回サブタスク判定部336は、アクセラレータ実行可能サブタスク記憶部363の当該アクセラレータが該当する領域と、実行可能サブタスク記憶部362が記憶するすべてのサブタスクについて、上記のステップE1~E3の処理を完了すると(ステップE4のYes)、カウントした総I/O量が最小となるサブタスクを、アクセラレータのデータI/Oが最小となるサブタスクとして選択する(ステップE5)。 When the next subtask determination unit 336 completes the processing of the above steps E1 to E3 for the area corresponding to the accelerator in the accelerator executable subtask storage unit 363 and all the subtasks stored in the executable subtask storage unit 362 (step S1). (Yes in E4), the subtask with the smallest total I / O count is selected as the subtask with the smallest accelerator data I / O (step E5).
 本実施形態に係るアクセラレータ制御装置1によると、タスクスケジューラ321によるサブタスクの実行が行われる一方で、データスケジューラ331はアクセラレータメモリへのデータ入出力量が最小となるタスクを次のタスクとして選択し、選択したタスクに対するデータ入出力の準備を継続する。これにより、アクセラレータメモリとメインメモリ4とのデータの入出力を削減しつつ、同時にアクセラレータメモリとメインメモリ4との間のI/O帯域を有効に活用することが可能となる。したがって、本実施形態のアクセラレータ制御装置によるとアクセラレータメモリを有するアクセラレータを用いたタスクの処理において、データI/Oがボトルネックとなることを回避し、処理を高速化することが可能となる。 According to the accelerator control device 1 according to the present embodiment, the task scheduler 321 executes the subtask, while the data scheduler 331 selects the task that minimizes the data input / output amount to the accelerator memory as the next task and selects it. Continue preparing for data I / O for the task. Thereby, it is possible to effectively utilize the I / O bandwidth between the accelerator memory and the main memory 4 while reducing the input / output of data between the accelerator memory and the main memory 4. Therefore, according to the accelerator control device of the present embodiment, it is possible to avoid the data I / O from becoming a bottleneck in the processing of the task using the accelerator having the accelerator memory, and to speed up the processing.
 本実施形態では、1つのデータを複数のアクセラレータに分割して保持し、ユーザプログラムの処理を分割し、各データパーティションを保持するアクセラレータに処理を分配して行わせることで、アクセラレータへのデータロードコストを削減し、用いるアクセラレータ数に応じて処理時間を削減することが可能となる。 In this embodiment, one data is divided and held in a plurality of accelerators, the processing of the user program is divided, and the processing is distributed to the accelerators holding the respective data partitions so that the data is loaded into the accelerator. Costs can be reduced and processing time can be reduced according to the number of accelerators used.
<実施形態2>
 次に、第2の実施形態に係るアクセラレータ制御装置について説明する。本実施形態のアクセラレータ制御装置は、第1の実施形態のアクセラレータ制御装置1(図8~図21)と同様の構成を有し、同様の動作を行うことから、差分についてのみ説明する。
<Embodiment 2>
Next, an accelerator control device according to the second embodiment will be described. The accelerator control device of this embodiment has the same configuration as the accelerator control device 1 (FIGS. 8 to 21) of the first embodiment and performs the same operation, so only the difference will be described.
 第1の実施形態では、タスクスケジューラ321は、タスク実行部322からサブタスクの実行(図18のステップB7)が完了した旨の通知を受信したタイミングで、実行が完了したサブタスクが生じたことにより、実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363に移動すべきサブタスクと、アクセラレータ実行可能サブタスク記憶部363から実行可能サブタスク記憶部362に移動すべきサブタスクを探索して、サブタスクを移動させるものとした(図18のステップB10)。一方、本実施形態では、さらに、タスクスケジューラ321がデータスケジューラ331からサブタスクを実行待ち状態とした旨の通知を受けたタイミングで(図18のステップB5)、実行待ちのサブタスクが生じたことにより、実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363に移動すべきサブタスクを探索して、サブタスクを移動させる。また、タスクスケジューラ321はアクセラレータ実行可能サブタスク記憶部363にサブタスクを移動させたことをデータスケジューラ331に通知する。 In the first embodiment, the task scheduler 321 receives the notification that the execution of the subtask (step B7 in FIG. 18) is completed from the task execution unit 322, and the execution of the subtask has occurred. The subtask is moved by searching for a subtask to be moved from the inexecutable subtask storage unit 361 to the accelerator executable subtask storage unit 363 and a subtask to be moved from the accelerator executable subtask storage unit 363 to the executable subtask storage unit 362. (Step B10 in FIG. 18). On the other hand, in the present embodiment, when the task scheduler 321 receives a notification from the data scheduler 331 that the subtask is in the execution waiting state (step B5 in FIG. 18), A subtask to be moved is searched from the non-executable subtask storage unit 361 to the accelerator executable subtask storage unit 363, and the subtask is moved. Also, the task scheduler 321 notifies the data scheduler 331 that the subtask has been moved to the accelerator executable subtask storage unit 363.
 さらに、実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363に移動すべきサブタスクの探索と移動を、タスクスケジューラ321ではなく、データスケジューラ331が行ってもよい。すなわち、データスケジューラ331は、入出力データパーティションをロックしたタイミングで(図18のステップB4)、実行待ちのサブタスクが生じたことにより、実行不可能サブタスク記憶部361からアクセラレータ実行可能サブタスク記憶部363に移動すべきサブタスクを探索して、サブタスクを移動させるようにしてもよい。 Furthermore, instead of the task scheduler 321, the data scheduler 331 may search and move a subtask to be moved from the inexecutable subtask storage unit 361 to the accelerator executable subtask storage unit 363. That is, the data scheduler 331 locks the input / output data partition (step B4 in FIG. 18), and the execution of the subtask waiting for execution has caused the non-executable subtask storage unit 361 to transfer to the accelerator executable subtask storage unit 363. The subtask may be moved by searching for the subtask to be moved.
 本実施形態によると、タスクスケジューラ321は、サブタスクが「実行完了」状態となるよりも前の「実行待ち」状態の時点において(図4参照)、当該サブタスクの完了によって実行が可能となる後段のサブタスクについても、アクセラレータ実行可能サブタスク記憶部363に追加する。このとき、データスケジューラ331は、タスクが「実行完了」状態となるよりも前の「実行待ち」状態の時点において、当該タスクの完了によって実行が可能となる後段のタスクについても、入出力データの準備を開始するタスクの候補とすることができる。したがって、本実施形態によると、データスケジューラ331は、第1の実施形態と比較してさらに早期に後段のサブタスクに対する入出力データの準備に着手することができる。よって、本実施形態によると、第1の実施形態と比較してアクセラレータメモリと外部メモリとの間のI/O(Input/Output)帯域をさらに有効利用することができ、メモリを有するアクセラレータを用いたタスクの処理をさらに高速化することが可能となる。 According to the present embodiment, the task scheduler 321 is in a subsequent stage that can be executed upon completion of the subtask when the subtask enters the “execution complete” state (see FIG. 4). Subtasks are also added to the accelerator executable subtask storage unit 363. At this time, the data scheduler 331 also performs the input / output data transfer for the subsequent task that can be executed by the completion of the task at the time of the “execution waiting” state before the task enters the “execution completion” state. Can be a candidate for the task to start preparation. Therefore, according to the present embodiment, the data scheduler 331 can start preparing input / output data for a subsequent subtask earlier than the first embodiment. Therefore, according to the present embodiment, the I / O (Input / Output) band between the accelerator memory and the external memory can be further effectively used as compared with the first embodiment, and the accelerator having the memory is used. It is possible to further speed up the processing of the task that has been performed.
<実施形態3>
 次に、第3の実施形態について説明する。本実施形態では、CPU(Central Processing Unit)とメモリを備えたコンピュータに対して、第1、第2の実施形態に係るアクセラレータ制御装置1の動作を行わせる。特に、CPUに対して、ユーザプログラム21、DAG(Directed Acyclic Graph)作成部22、プログラム解析部31、タスクスケジューラ321、タスク実行部322、データスケジューラ331、および、データ移動部332の機能を行わせる。一方、コンピュータのメモリを、データ管理テーブル34、メモリ管理テーブル35、サブタスク記憶部36、および、メインメモリ4として使用する。ここで、メモリとは、広義の記憶手段であり、半導体メモリおよび一般に二次記憶と呼ばれるハードディスクやフラッシュディスクを含む。また、アクセラレータはコンピュータのI/O(Input/Output)スロットに挿入する。あるいは、I/Oデバイス用のインターコネクションを用いてアクセラレータとコンピュータを接続することも可能である。
<Embodiment 3>
Next, a third embodiment will be described. In this embodiment, the operation of the accelerator control device 1 according to the first and second embodiments is performed on a computer having a CPU (Central Processing Unit) and a memory. In particular, the CPU is caused to perform the functions of a user program 21, a DAG (Directed Acyclic Graph) creation unit 22, a program analysis unit 31, a task scheduler 321, a task execution unit 322, a data scheduler 331, and a data migration unit 332. . On the other hand, the memory of the computer is used as the data management table 34, the memory management table 35, the subtask storage unit 36, and the main memory 4. Here, the memory is a storage means in a broad sense, and includes a semiconductor memory and a hard disk or flash disk generally called secondary storage. The accelerator is inserted into an I / O (Input / Output) slot of the computer. Alternatively, the accelerator and the computer can be connected using an interconnection for the I / O device.
 本発明は、一例として、1つ以上のアクセラレータを含む計算装置の処理高速化といった用途に適用することができる。 The present invention can be applied to, for example, an application for speeding up the processing of a computing device including one or more accelerators.
 なお、上記特許文献の全開示内容は、本書に引用をもって繰り込み記載されているものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態の変更・調整が可能である。また、本発明の全開示の枠内において種々の開示要素(各請求項の各要素、各実施形態の各要素、各図面の各要素等を含む)の多様な組み合わせ、ないし、選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。特に、本書に記載した数値範囲については、当該範囲内に含まれる任意の数値ないし小範囲が、別段の記載のない場合でも具体的に記載されているものと解釈されるべきである。 It should be noted that the entire disclosure of the above patent document is incorporated herein by reference. Within the scope of the entire disclosure (including claims) of the present invention, the embodiment can be changed and adjusted based on the basic technical concept. Further, various combinations or selections of various disclosed elements (including each element of each claim, each element of each embodiment, each element of each drawing, etc.) are possible within the framework of the entire disclosure of the present invention. is there. That is, the present invention of course includes various variations and modifications that could be made by those skilled in the art according to the entire disclosure including the claims and the technical idea. In particular, with respect to the numerical ranges described in this document, any numerical value or small range included in the range should be construed as being specifically described even if there is no specific description.
1、10  アクセラレータ制御装置
3  アクセラレータ制御部
4  メインメモリ
8  情報処理装置
11  タスク記憶部
12  データスケジューラ
13  タスクスケジューラ
14  第1の記憶部
15  第2の記憶部
21  ユーザプログラム
22  DAG作成部
31  プログラム解析部
32  タスク処理部
33  データ管理部
34  データ管理テーブル
35  メモリ管理テーブル
36  サブタスク記憶部
51~53  アクセラレータ
61~66  データ
61-1~61-4、62-1~62-4、63-1~63-4 データパーティション
71~74  タスク
71-1~71-4、72-1~72-4  サブタスク
81  共有メモリ
321  タスクスケジューラ
322  タスク実行部
331  データスケジューラ
332  データ移動部
334  先読み判定部
336  次回サブタスク判定部
361  実行不可能サブタスク記憶部
362  実行可能サブタスク記憶部
363  アクセラレータ実行可能サブタスク記憶部
511~513  プロセッサ
521~523  アクセラレータメモリ
821~823  アクセラレータ
1, 10 Accelerator control device 3 Accelerator control unit 4 Main memory 8 Information processing device 11 Task storage unit 12 Data scheduler 13 Task scheduler 14 First storage unit 15 Second storage unit 21 User program 22 DAG creation unit 31 Program analysis unit 32 Task processing unit 33 Data management unit 34 Data management table 35 Memory management table 36 Subtask storage units 51 to 53 Accelerators 61 to 66 Data 61-1 to 61-4, 62-1 to 62-4, 63-1 to 63- 4 Data partitions 71 to 74 Tasks 71-1 to 71-4, 72-1 to 72-4 Subtask 81 Shared memory 321 Task scheduler 322 Task execution unit 331 Data scheduler 332 Data migration unit 334 Prefetch determination unit 336 Times subtask determination unit 361 infeasible subtask storage unit 362 executable subtasks storage unit 363 accelerator executable subtasks storage unit 511-513 processors 521-523 accelerator memories 821-823 Accelerator

Claims (15)

  1.  実行可能なタスクを保持するタスク記憶部と、
     メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示するデータスケジューラと、
     前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記タスク記憶部に追加するタスクスケジューラと、を備え、
     前記データスケジューラは、前記メモリの使用状況に応じて、前記タスク記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する、
     ことを特徴とするアクセラレータ制御装置。
    A task storage unit that holds executable tasks;
    A task having a relatively small amount of input / output data to / from the memory when executing on an accelerator having a memory is selected from the executable tasks, and preparation for data input / output in the memory for the selected task is performed. A data scheduler for instructing the accelerator;
    A task scheduler that instructs the accelerator to execute the selected task, and adds a task that can be executed upon completion of the selected task to the task storage unit,
    The data scheduler continues the selection of the next task from the executable tasks held by the task storage unit and the preparation of data input / output for the selected next task in accordance with the use state of the memory.
    An accelerator control device characterized by that.
  2.  前記データスケジューラは、前記アクセラレータ上で実行するときに前記メモリへロードすべき入力データ量と、前記メモリから外部のメモリに退避すべき出力データ量の和が相対的に少ないタスクを、前記タスク記憶部が保持するタスクの中から選択する、
     請求項1に記載のアクセラレータ制御装置。
    The data scheduler is configured to store a task having a relatively small sum of input data amount to be loaded into the memory and output data amount to be saved from the memory to an external memory when executing on the accelerator. Select from the tasks held by the department,
    The accelerator control device according to claim 1.
  3.  前記データスケジューラは、前記メモリの使用量が所定のしきい値未満の場合、次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する、
     請求項1または2に記載のアクセラレータ制御装置。
    The data scheduler continues the selection of the next task and the preparation of data input / output for the selected next task when the memory usage is less than a predetermined threshold value.
    The accelerator control device according to claim 1.
  4.  前記タスク記憶部は、
     実行可能なタスクであって実行先のアクセラレータが制限されないタスクを保持する第1の記憶部と、
     実行先のアクセラレータが制限されたタスクを保持する第2の記憶部と、を有し、
     前記データスケジューラは、アクセラレータ上で実行するときのメモリへの入出力データ量が相対的に少ないタスクを、前記第2の記憶部が保持するタスクであって実行先が該アクセラレータに制限されたタスク、および、前記第1の記憶部が保持するタスクの中から選択する、
     請求項1ないし3のいずれか1項に記載のアクセラレータ制御装置。
    The task storage unit
    A first storage unit holding a task that is an executable task and whose execution accelerator is not limited;
    A second storage unit for holding a task whose execution accelerator is restricted;
    The data scheduler is a task held in the second storage unit that has a relatively small amount of input / output data to / from a memory when executed on an accelerator, and a task whose execution destination is limited to the accelerator And selecting from tasks held by the first storage unit,
    The accelerator control device according to any one of claims 1 to 3.
  5.  前記第1の記憶部は、最上流のタスク、または、上流のすべてのタスクの実行が完了したタスクを保持し、
     前記第2の記憶部は、実行先のアクセラレータが制限されたタスクとして、上流のタスクの少なくとも1つが該アクセラレータで実行待ちであり、かつ、上流の残りのすべてのタスクの実行が完了したタスクを保持する、
     請求項4に記載のアクセラレータ制御装置。
    The first storage unit holds a task in which the uppermost task or all upstream tasks have been executed,
    The second storage unit stores a task in which at least one upstream task is waiting to be executed by the accelerator and the execution of all the remaining upstream tasks is completed as a task whose execution destination accelerator is restricted. Hold,
    The accelerator control device according to claim 4.
  6.  前記タスクスケジューラは、前記選択されたタスクの実行が完了した場合、前記第1および/または第2の記憶部が保持するタスクを更新する、
     請求項5に記載のアクセラレータ制御装置。
    The task scheduler updates a task held by the first and / or second storage unit when the execution of the selected task is completed;
    The accelerator control device according to claim 5.
  7.  前記データスケジューラまたは前記タスクスケジューラは、前記選択されたタスクに対するデータ入出力の準備が完了した場合、第2の記憶部が保持するタスクを更新する、
     請求項5または6に記載のアクセラレータ制御装置。
    The data scheduler or the task scheduler updates a task held by a second storage unit when preparation for data input / output with respect to the selected task is completed.
    The accelerator control device according to claim 5 or 6.
  8.  実行可能なタスクを記憶部に保持するステップと、
     メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示するステップと、
     前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記記憶部に追加するステップと、
     前記メモリの使用状況に応じて、前記記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続するステップと、を含む、
     ことを特徴とするアクセラレータ制御方法。
    Holding an executable task in a storage unit;
    A task having a relatively small amount of input / output data to / from the memory when executing on an accelerator having a memory is selected from the executable tasks, and preparation for data input / output in the memory for the selected task is performed. Instructing the accelerator;
    Instructing the accelerator to execute the selected task, and adding a task that can be executed upon completion of the selected task to the storage unit;
    Selecting the next task from among the executable tasks held by the storage unit according to the use status of the memory, and continuing the preparation of data input / output for the selected next task,
    An accelerator control method characterized by the above.
  9.  前記アクセラレータ上で実行するときに前記メモリへロードすべき入力データ量と、前記メモリから外部のメモリに退避すべき出力データ量の和が相対的に少ないタスクを、前記記憶部が保持するタスクの中から選択する、
     請求項8に記載のアクセラレータ制御方法。
    Tasks held by the storage unit are tasks having a relatively small sum of the amount of input data to be loaded into the memory when executed on the accelerator and the amount of output data to be saved from the memory to an external memory. Choose from,
    The accelerator control method according to claim 8.
  10.  前記メモリの使用量が所定のしきい値未満の場合、次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する、
     請求項8または9に記載のアクセラレータ制御方法。
    If the memory usage is below a predetermined threshold, continue to select the next task and prepare for data I / O for the selected next task.
    The accelerator control method according to claim 8 or 9.
  11.  実行可能なタスクであって実行先のアクセラレータが制限されない第1のタスクを前記記憶部に保持するステップと、
     実行先のアクセラレータが制限された第2のタスクを前記記憶部に保持するステップと、を含み、
     アクセラレータ上で実行するときのメモリへの入出力データ量が相対的に少ないタスクは、前記第2のタスクであって実行先が該アクセラレータに制限されたタスク、および、前記第1のタスクの中から選択される、
     請求項8ないし10のいずれか1項に記載のアクセラレータ制御方法。
    Holding in the storage unit a first task that is an executable task and whose execution destination accelerator is not limited;
    A second task whose execution accelerator is restricted is held in the storage unit, and
    A task having a relatively small amount of input / output data to / from memory when executing on the accelerator is the second task whose execution destination is restricted to the accelerator, and among the first task Selected from the
    The accelerator control method according to any one of claims 8 to 10.
  12.  前記第1のタスクは、最上流のタスク、または、上流のすべてのタスクの実行が完了したタスクであり、
     前記第2のタスクは、実行先のアクセラレータが制限されたタスクであって、上流のタスクの少なくとも1つが該アクセラレータで実行待ちであり、かつ、上流の残りのすべてのタスクの実行が完了したタスクである、
     請求項11に記載のアクセラレータ制御方法。
    The first task is the most upstream task or a task in which all upstream tasks have been executed,
    The second task is a task whose execution destination accelerator is restricted, and at least one of the upstream tasks is waiting to be executed by the accelerator, and the execution of all the remaining upstream tasks is completed. Is,
    The accelerator control method according to claim 11.
  13.  前記記憶部が保持する前記第1および/または第2のタスクは、前記選択されたタスクの実行が完了した場合に更新される、
     請求項12に記載のアクセラレータ制御方法。
    The first and / or second task held by the storage unit is updated when the execution of the selected task is completed.
    The accelerator control method according to claim 12.
  14.  前記記憶部が保持する前記第2のタスクは、前記選択されたタスクに対するデータ入出力の準備が完了した場合に更新される、
     請求項11または12に記載のアクセラレータ制御方法。
    The second task held by the storage unit is updated when preparation for data input / output with respect to the selected task is completed.
    The accelerator control method according to claim 11 or 12.
  15.  実行可能なタスクを記憶部に保持する処理と、
     メモリを有するアクセラレータ上で実行するときの前記メモリへの入出力データ量が相対的に少ないタスクを、前記実行可能なタスクの中から選択し、選択したタスクに対する前記メモリにおけるデータ入出力の準備を前記アクセラレータに指示する処理と、
     前記選択されたタスクを実行するように前記アクセラレータに指示し、前記選択されたタスクの完了により実行可能となるタスクを前記記憶部に追加する処理と、
     前記メモリの使用状況に応じて、前記記憶部が保持する実行可能なタスクの中から次のタスクの選択と、選択した次のタスクに対するデータ入出力の準備を継続する処理と、をコンピュータに実行させる、
     ことを特徴とするプログラム。
    A process of storing executable tasks in the storage unit;
    A task having a relatively small amount of input / output data to / from the memory when executing on an accelerator having a memory is selected from the executable tasks, and preparation for data input / output in the memory for the selected task is performed. Processing to instruct the accelerator;
    Instructing the accelerator to execute the selected task, and adding a task that can be executed upon completion of the selected task to the storage unit;
    Depending on the use status of the memory, the next task is selected from among the executable tasks held by the storage unit, and the process of continuing preparation for data input / output for the selected next task is executed on the computer Let
    A program characterized by that.
PCT/JP2017/003028 2016-01-29 2017-01-27 Accelerator control device, accelerator control method and program WO2017131187A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/070,312 US10831547B2 (en) 2016-01-29 2017-01-27 Accelerator control apparatus for analyzing big data, accelerator control method, and program
JP2017563868A JP6897574B2 (en) 2016-01-29 2017-01-27 Accelerator controller, accelerator control method and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016-015352 2016-01-29
JP2016015352 2016-01-29

Publications (1)

Publication Number Publication Date
WO2017131187A1 true WO2017131187A1 (en) 2017-08-03

Family

ID=59397956

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/003028 WO2017131187A1 (en) 2016-01-29 2017-01-27 Accelerator control device, accelerator control method and program

Country Status (3)

Country Link
US (1) US10831547B2 (en)
JP (1) JP6897574B2 (en)
WO (1) WO2017131187A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021210123A1 (en) * 2020-04-16 2021-10-21 日本電信電話株式会社 Scheduling method, scheduler, gpu cluster system, and program

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180150256A1 (en) * 2016-11-29 2018-05-31 Intel Corporation Technologies for data deduplication in disaggregated architectures
US11502948B2 (en) 2017-10-16 2022-11-15 Mellanox Technologies, Ltd. Computational accelerator for storage operations
US11005771B2 (en) 2017-10-16 2021-05-11 Mellanox Technologies, Ltd. Computational accelerator for packet payload operations
US10841243B2 (en) 2017-11-08 2020-11-17 Mellanox Technologies, Ltd. NIC with programmable pipeline
US10708240B2 (en) 2017-12-14 2020-07-07 Mellanox Technologies, Ltd. Offloading communication security operations to a network interface controller
US10877766B2 (en) * 2018-05-24 2020-12-29 Xilinx, Inc. Embedded scheduling of hardware resources for hardware acceleration
US10705993B2 (en) 2018-11-19 2020-07-07 Xilinx, Inc. Programming and controlling compute units in an integrated circuit
US10824469B2 (en) * 2018-11-28 2020-11-03 Mellanox Technologies, Ltd. Reordering avoidance for flows during transition between slow-path handling and fast-path handling
US11184439B2 (en) 2019-04-01 2021-11-23 Mellanox Technologies, Ltd. Communication with accelerator via RDMA-based network adapter
JP7370158B2 (en) * 2019-04-03 2023-10-27 株式会社Preferred Networks Information processing device and information processing method
CN110032453B (en) * 2019-04-19 2022-05-03 上海兆芯集成电路有限公司 Processing system for task scheduling and distribution and acceleration method thereof
EP4120077A4 (en) * 2020-03-31 2023-04-05 Huawei Technologies Co., Ltd. Method for scheduling hardware accelerator, and task scheduler
IL276538B2 (en) 2020-08-05 2023-08-01 Mellanox Technologies Ltd Cryptographic data communication apparatus
CN114095153A (en) 2020-08-05 2022-02-25 迈络思科技有限公司 Cipher data communication device
US11386034B2 (en) 2020-10-30 2022-07-12 Xilinx, Inc. High throughput circuit architecture for hardware acceleration
US11934658B2 (en) 2021-03-25 2024-03-19 Mellanox Technologies, Ltd. Enhanced storage protocol emulation in a peripheral device
US11934333B2 (en) 2021-03-25 2024-03-19 Mellanox Technologies, Ltd. Storage protocol emulation in a peripheral device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112388A1 (en) * 2004-11-22 2006-05-25 Masaaki Taniguchi Method for dynamic scheduling in a distributed environment
JP2008152470A (en) * 2006-12-15 2008-07-03 Hitachi Ltd Data processing system and semiconductor integrated circuit
WO2011078162A1 (en) * 2009-12-24 2011-06-30 日本電気株式会社 Scheduling device, scheduling method and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013025392A (en) 2011-07-15 2013-02-04 Nec Corp Information processing apparatus, data allocation method and, program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060112388A1 (en) * 2004-11-22 2006-05-25 Masaaki Taniguchi Method for dynamic scheduling in a distributed environment
JP2008152470A (en) * 2006-12-15 2008-07-03 Hitachi Ltd Data processing system and semiconductor integrated circuit
WO2011078162A1 (en) * 2009-12-24 2011-06-30 日本電気株式会社 Scheduling device, scheduling method and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021210123A1 (en) * 2020-04-16 2021-10-21 日本電信電話株式会社 Scheduling method, scheduler, gpu cluster system, and program
JP7385156B2 (en) 2020-04-16 2023-11-22 日本電信電話株式会社 Scheduling method, scheduler, GPU cluster system and program

Also Published As

Publication number Publication date
JPWO2017131187A1 (en) 2018-11-15
US10831547B2 (en) 2020-11-10
US20190026157A1 (en) 2019-01-24
JP6897574B2 (en) 2021-06-30

Similar Documents

Publication Publication Date Title
WO2017131187A1 (en) Accelerator control device, accelerator control method and program
US11550627B2 (en) Hardware accelerated dynamic work creation on a graphics processing unit
US9535756B2 (en) Latency-hiding context management for concurrent distributed tasks in a distributed system
US8141076B2 (en) Cell processor methods and apparatus
US20100153957A1 (en) System and method for managing thread use in a thread pool
US20170344398A1 (en) Accelerator control device, accelerator control method, and program storage medium
JP6724908B2 (en) Accelerator control device, accelerator control method and program
CN103608776A (en) Dynamic work partitioning on heterogeneous processing device
JP2008140046A (en) Image processor, image processing program
EP2770430A1 (en) System and method for scheduling atomic jobs in a multi-core processor to avoid processing jobs of the same atomicity in parallel
US8775767B2 (en) Method and system for allocating memory to a pipeline
JP2007188523A (en) Task execution method and multiprocessor system
US9542319B2 (en) Method and system for efficient communication and command system for deferred operation
JP5158576B2 (en) I / O control system, I / O control method, and I / O control program
CN114930292A (en) Cooperative work stealing scheduler
WO2016208178A1 (en) Accelerator control device, accelerator control method, and storage medium
US9384047B2 (en) Event-driven computation
JP2022079764A (en) Synchronous control system and synchronous control method
Suzuki et al. Victream: Computing framework for out-of-core processing on multiple GPUs
CN117149398A (en) Memory allocation method and device
EP4226294A1 (en) Methods and apparatus for parallel quantum computing
JP7014173B2 (en) Distributed processing system
US9378062B2 (en) Interface between a resource manager and a scheduler in a process
US20240069965A1 (en) Systems and methods for executing compute functions
JP2019204387A (en) Program execution control method and program converter

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: 17744417

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2017563868

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17744417

Country of ref document: EP

Kind code of ref document: A1