WO2018179873A1 - アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ - Google Patents

アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ Download PDF

Info

Publication number
WO2018179873A1
WO2018179873A1 PCT/JP2018/004146 JP2018004146W WO2018179873A1 WO 2018179873 A1 WO2018179873 A1 WO 2018179873A1 JP 2018004146 W JP2018004146 W JP 2018004146W WO 2018179873 A1 WO2018179873 A1 WO 2018179873A1
Authority
WO
WIPO (PCT)
Prior art keywords
accelerator
data
processing
data processing
arithmetic device
Prior art date
Application number
PCT/JP2018/004146
Other languages
English (en)
French (fr)
Inventor
悠記 小林
Original Assignee
日本電気株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電気株式会社 filed Critical 日本電気株式会社
Publication of WO2018179873A1 publication Critical patent/WO2018179873A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0804Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with main memory updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • 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]

Definitions

  • the present invention relates to a library for a computer having an accelerator in addition to a processor as an arithmetic unit, and to a library that prevents a decrease in the performance of the computer, and an accelerator that can prevent a decrease in the performance of the computer.
  • CPU Central Processing Unit
  • accelerator a hardware accelerator
  • the accelerator is, for example, a GPU (Graphics Processing Unit) or an FPGA (Field Programmable Gate Array).
  • GPGPU General Purpose computing on Graphics Processing Unit
  • each of the CPU and the accelerator may be referred to as an arithmetic unit.
  • Patent Document 5 describes a method for converting a part of software processing into hardware. Furthermore, a method is described in which a hardware software part is replaced with software that controls a hardware circuit.
  • Patent Document 6 describes a method of taking an execution trace of software and executing a process with the longest execution time by hardware.
  • the hardware described in Patent Document 6 is an FPGA.
  • the overhead for transferring the matrix input / output data between the CPU and the FPGA becomes relatively large. Therefore, the effect of offloading to the FPGA is reduced. If a calculation related to a large matrix is executed by the CPU, the benefits of speedup by the FPGA cannot be obtained. Therefore, the effect of offloading to the FPGA is also reduced.
  • An object of the present invention is to prevent the execution efficiency of a program from being reduced in a computer having a processor and an accelerator.
  • the library according to the present invention is a library for a computer having an accelerator, and includes an attribute acquisition unit that acquires attribute information of data to be processed, and an arithmetic device that executes data processing based on the acquired attribute information.
  • the processing start means for starting data processing using the processor
  • the arithmetic device selection means selects the accelerator as the arithmetic device
  • an instruction unit for instructing the accelerator to execute data processing.
  • An accelerator has a local cache memory, and requests first state information indicating whether or not the latest data is held in the local cache memory and a write back of data from the local cache memory to the main memory.
  • Data processing means for performing data processing on data to be processed including second state information as attribute information, monitoring means for monitoring the second state information, and from the local cache memory to the main memory using the second state information
  • the write-back means for writing the data to be processed stored in the local cache memory back to the main memory and the first data when the data to be processed are stored in the local cache memory.
  • the state information is set to the first state indicating that the latest data is held in the local cache memory.
  • a library program includes a process for acquiring attribute information of data to be processed in a computer, a process for selecting an arithmetic device for executing data processing based on the acquired attribute information, and a processor as an arithmetic device. When selected, a process for starting data processing using a processor and a process for instructing the accelerator to execute data processing when an accelerator is selected as an arithmetic unit are executed.
  • a computer-readable recording medium stores a library program for a computer having an accelerator, and the library program acquires attribute information of data to be processed when it is executed by a processor. Based on the attribute information, an arithmetic device that executes data processing is selected, and when a processor is selected as the arithmetic device, data processing using the processor is started, and when an accelerator is selected as the arithmetic device, the accelerator Is instructed to execute data processing.
  • FIG. 1 is a block diagram showing a first embodiment of a computer to which a library is applied.
  • the computer 10 shown in FIG. 1 includes a CPU 20, an accelerator 30, a program memory 40, and a data memory 50.
  • an FPGA is used as the accelerator 30.
  • an element having another calculation function such as a GPU may be used.
  • the accelerator 30 may be expressed as an FPGA 30.
  • the program memory 40 an application program 41 and library software 42 are stored.
  • the program memory 40 is a non-temporary nonvolatile memory such as a ROM (Read Only Memory) or a flash memory.
  • the library software 42 includes, for example, a matrix operation function such as a matrix product (GEMM: GeneralpMatrix Multiply).
  • the application program 41 includes, for example, an analysis program that repeats matrix products.
  • the data memory 50 stores data to be processed (data to be calculated).
  • a matrix is taken as an example of data to be processed.
  • FIG. 2 is a flowchart showing a processing procedure by the library software 42.
  • the processing based on the library software 42 will be described with reference to FIG. In the following description, the processing is executed by the library software 42, but the actual processing subject is the CPU 20.
  • step S11 the library software 42 acquires attribute information of data to be processed.
  • the size of the matrix is used as an attribute. That is, when the row size of the matrix is M and the column size is N, the library software 42 acquires M and N as attribute information.
  • the library software 42 determines a computing device that executes processing based on the acquired attribute information. For example, when the determination function is T> FUNC (M, N), the CPU 20 is selected as the arithmetic device. If not, the FPGA 30 is selected. T is a constant that is a threshold value, and FUNC is a determination function that takes M and N as arguments. As the determination function, a max function that returns the maximum value of M and N, an add function that returns the sum of M and N, and a mul function that returns the product of M and N are conceivable. However, the present invention is not limited to these, and other functions may be used.
  • the library software 42 selects the CPU 20 when the product of the size of the matrix row and column, that is, the number of elements of the matrix is less than 100, and when 100 or more Select FPGA.
  • the library software 42 instructs the CPU 20 to start data processing.
  • data is processed using the CPU 20. That is, the matrix data is processed using a matrix product program operating on the CPU 20 (steps S13 and S14).
  • the processing is offloaded to the FPGA 30. That is, the library software 42 instructs the FPGA 30 to execute data processing (steps S13 and S15). For example, the library software 42 causes the FPGA 30 to start an operation by setting an address of the matrix data and a flag for instructing the start of the operation of the matrix product to the matrix product operation circuit configured in the FPGA 30.
  • the library software 42 waits for completion of data processing of the FPGA 30 (step S16).
  • an operation completion flag may be provided in the matrix operation circuit, and the library software 42 may allow the CPU 20 to check (polling) the operation completion flag. Further, the completion of data processing may be notified from the matrix operation circuit to the CPU 20 by means such as interruption.
  • an appropriate arithmetic device is dynamically selected according to the data to be processed, and data is selected by the selected arithmetic device. Processing is executed. Therefore, the execution performance of the process is improved as compared with the case where it is not configured as in the present embodiment.
  • the threshold value is set based on, for example, offload overhead and FPGA processing capability. For example, when the offload overhead is relatively large, the threshold value is set to a large value. When the processing capacity of the FPGA is relatively high, the threshold value is set to a small value.
  • the computer 10 may include a plurality of accelerators.
  • a plurality of accelerators for example, FPGA and GPGPU
  • the determination function of the arithmetic device may be set so that any arithmetic device is selected.
  • the matrix size is used as the data attribute (attribute information), but the attribute information is not limited to the matrix size.
  • information on a computing device used most recently may be used as attribute information, and the determination function of the computing device may be set in consideration of such attribute information.
  • an accelerator 30 such as an FPGA has a cache mechanism
  • the execution of the accelerator 30 reduces the memory access overhead, so that improvement in execution performance can be expected.
  • a matrix is used as an example of data to be processed, but the data to be processed is not limited to a matrix.
  • the data to be processed may be other forms of data such as vector data.
  • the computing device is automatically determined at the time of execution of processing by a predetermined determination function.
  • the arithmetic device may be specified by a program.
  • FIG. 3 is an example in which a compiler or preprocessor is notified of an arithmetic unit that executes processing by a “pragma” described as a comment in the program. If notified, the compiler or preprocessor generates code to skip execution of the decision function.
  • “// pragma: mause_FPGA” and “// pragma: use_CPU” correspond to “pragmas”.
  • a “hint” may be given as a function argument as shown in FIG.
  • “USE_FPGA” and “USE_CPU” correspond to “hint”.
  • “USE_AUTO” means that it is desired that the arithmetic device is determined by the determination function.
  • FIG. FIG. 5 is a block diagram showing a second embodiment of a computer to which a library is applied.
  • a local cache (local cache memory) 32 is mounted on an accelerator 31 such as an FPGA in order to reduce memory access overhead. Note that the local cache 32 is not consistent with the data memory 50 (cache coherency).
  • the processing result in the accelerator 31 is stored in the local cache 32. In that case, when data processing using the processing result is executed by the accelerator 31, the accelerator 31 can execute the processing without accessing the data memory 50. Therefore, improvement in performance can be expected.
  • flag A is a flag updated by the accelerator 31 and indicates that the latest data is in the local cache 32 of the accelerator 31.
  • the flag B is a flag for the CPU 20 to request the accelerator 31 to write back from the local cache 32 to the data memory 50.
  • the flag B is changed to true if the flag A is true before the CPU 20 starts data processing until the flag A becomes false.
  • a waiting process is added to the library software 42.
  • Accelerator 31 monitors flag B at regular intervals, at least when flag A is true. When the flag B becomes true, the accelerator 31 writes the data in the local cache 32 back to the data memory 50 and sets the flag A to false. If the contents of the data memory 50 are changed after copying the data in the local cache 32, the flag A is set to true.
  • the accelerator 31 may incorporate a mechanism that directly notifies the accelerator 31 from the CPU 20 when the content of the flag B is changed by the CPU 20.
  • a mechanism may be considered in which the CPU 20 notifies the accelerator 31 by means such as an interrupt.
  • an FPGA is used as the accelerator 31.
  • an element having another calculation function such as a GPU may be used.
  • the accelerator 31 may be expressed as an FPGA 31.
  • FIG. 6 is a flowchart showing a processing procedure by the library software in the second embodiment.
  • FIG. 7 is a block diagram for explaining the operation of the computer 11 according to the second embodiment.
  • the CPU 20 includes a confirmation / waiting process 22 and a calculation process 23 as a function 21.
  • the confirmation / waiting process 22 and the calculation process 23 are realized by the CPU 20 executing processes according to the library software 42.
  • data 51 is stored, and the data 51 includes a data body 52 and an attribute 53 to be operated.
  • the attribute 53 includes a flag A and a flag B.
  • the FPGA 31 has a local cache memory (local cache) 32, and further includes a flag change circuit 35, a monitoring circuit 36, and a write-back circuit 37.
  • the flag change circuit 35 changes the value of the flag A (“true” or “false”).
  • the monitoring circuit 36 monitors the value of the flag B (“true” or “false”).
  • the write-back circuit 37 writes the data held in the local cache 32 back to the data memory 50 when a predetermined condition is satisfied.
  • steps S11 to S16 is the same as the processing in the first embodiment.
  • the processing is executed by the library software 42, but the actual processing subject is the CPU 20.
  • the library software 42 confirms the flag A by the confirmation / waiting process 22 before the arithmetic process for the data to be processed is executed (step S21). .
  • the arithmetic processing by the CPU 20 is started (step S14). If the value of the flag A is true, the library software 42 changes the flag B to true by the confirmation / waiting process 22 (step S22) and waits until the value of the flag A becomes false (step S22). S23).
  • the FPGA 31 sets the value of the flag A to true when the data is changed after the data is stored in the local cache 32.
  • the monitoring circuit 36 monitors the flag B at regular intervals.
  • the write-back circuit 37 writes the data in the local cache 32 back to the data memory 50 as the data body 52.
  • the flag change circuit 35 sets the value of the flag A to false.
  • step S23 When the library software 42 confirms that the value of the flag A is false (step S23), the library software 42 changes the value of the flag B to false (step S24). Then, the CPU 20 performs arithmetic processing on the data stored in the data memory 50 (step S14).
  • an appropriate arithmetic device means an arithmetic device that can shorten the calculation time comprehensively in consideration of off-load overhead and calculation speed (or calculation time).
  • the library software in each of the above embodiments can be suitably applied as library software that operates on a tightly coupled processor including a processor such as a CPU and an accelerator such as an FPGA. That is, in a tightly coupled processor, the present invention can be applied to an application in which an arithmetic unit that executes library software is dynamically switched according to a data size or the like.
  • FIG. 8 is a block diagram showing the main part of the library.
  • the library 100 illustrated in FIG. 8 includes attribute acquisition means (attribute acquisition unit) 110 that acquires attribute information (for example, information indicating the size of a matrix) of data to be processed, and data based on the acquired attribute information.
  • An arithmetic device selection means (arithmetic device selection unit) 120 that selects an arithmetic device to execute processing, and when the arithmetic device selection means 120 selects a processor (for example, CPU) as an arithmetic device, data processing using the processor is performed.
  • Processing start means processing start section
  • processing instruction means processing to instruct the accelerator to execute data processing when the processing device selection means 120 selects an accelerator (for example, FPGA) as the processing device.
  • Instruction unit 140 Instruction unit
  • FIG. 9 is a block diagram showing the main part of the library according to another aspect.
  • the library 100 shown in FIG. 9 further includes processing completion detection means (processing completion detection unit) 150 that waits for completion of data processing of the accelerator.
  • processing completion detection means processing completion detection unit 150 that waits for completion of data processing of the accelerator.
  • FIG. 10 is a block diagram showing the main part of the accelerator.
  • the accelerator 200 shown in FIG. 10 includes first state information (flag A in the embodiment) indicating whether or not the latest data is held in the local cache memory 220 (local cache 32 in the embodiment) and the local cache memory 220.
  • Data processing is performed on data to be processed that includes, as attribute information, second state information (in the embodiment, flag B) for requesting data write back from the main memory to the main memory (in the embodiment, the data memory 50)
  • Data processing means (data processing unit) 210 that performs the processing, and when the second state information is requested to write back data from the local cache memory 220 to the main memory, the processing target stored in the local cache memory 220
  • Write-back means (write-back unit) 230 for writing data back to the main memory (in the embodiment, the write-back circuit 3
  • the first state information indicates that the latest data is held in the local cache memory (for example, “true”).
  • State change means (state change unit) 240 (implemented by the flag change circuit 35 in the embodiment) is provided.
  • the accelerator 200 may include state monitoring means (state monitoring unit: realized by the monitoring circuit 36 in the embodiment) that monitors the second state information.
  • state monitoring unit realized by the monitoring circuit 36 in the embodiment
  • a library for a computer having an accelerator Attribute acquisition means for acquiring attribute information of data to be processed; Based on the acquired attribute information, arithmetic device selection means for selecting an arithmetic device that performs data processing; Processing start means for starting data processing using a processor when the arithmetic device selection means selects a processor as the arithmetic device; A processing instruction means for instructing the accelerator to execute data processing when the arithmetic device selecting means selects an accelerator as the arithmetic device.
  • the processing start means includes a mechanism for starting data processing after completion of data write back from the accelerator to the main memory when the latest data is held in the accelerator. 2.
  • the library according to 2.
  • the attribute information includes first state information indicating whether or not the latest data is held in the accelerator, and second state information for requesting data write back from the accelerator to the main memory. ,
  • first state information indicates that the latest data is held in the accelerator
  • second state information for requesting data write back from the accelerator to the main memory.
  • An accelerator having a local cache memory, Processing including, as attribute information, first state information indicating whether or not the latest data is held in the local cache memory and second state information for requesting writing back of data from the local cache memory to the main memory Data processing means for performing data processing on the target data; A write-back means for writing back data to be processed stored in the local cache memory to the main memory when data write-back from the local cache memory to the main memory is requested in the second state information; When the data to be processed is stored in the local cache memory, the first state information is set to a first state indicating that the latest data is held in the local cache memory, and is stored in the local cache memory.
  • An accelerator comprising: state changing means for setting the first state information to a second state different from the first state when the data to be processed is written back to the main memory.
  • Attribute acquisition means for acquiring attribute information of data to be processed, arithmetic device selection means for selecting an arithmetic device for executing data processing based on the acquired attribute information, and arithmetic device selection means
  • the processing start means for starting the data processing using the processor
  • the arithmetic device selection means selects the accelerator as the arithmetic device
  • the accelerator executes the data processing.
  • a library program for a computer having an accelerator On the computer, A process of acquiring attribute information of data to be processed; Based on the acquired attribute information, a process of selecting a computing device that performs data processing; A process of starting data processing using a processor when a processor is selected as an arithmetic unit; A library program for executing processing that instructs the accelerator to execute data processing when an accelerator is selected as an arithmetic unit.
  • Appendix 8 The library program according to appendix 7, for further executing processing for waiting for completion of accelerator data processing.
  • the attribute information includes first state information indicating whether or not the latest data is held in the accelerator, and second state information for requesting data write back from the accelerator to the main memory.
  • first state information indicates that the latest data is held in the accelerator
  • second state information requests to write back the data from the accelerator to the main memory, and the data from the accelerator to the main memory.
  • a storage medium storing a library program for a computer having an accelerator, and when executed by a processor, the library program is Get attribute information of data to be processed, Based on the acquired attribute information, select a computing device that executes data processing, When the arithmetic device selection means selects a processor as the arithmetic device, data processing using the processor is started, When the arithmetic device selection means selects an accelerator as the arithmetic device, it instructs the accelerator to execute data processing.
  • the attribute information includes first state information indicating whether or not the latest data is held in the accelerator, and second state information for requesting data write back from the accelerator to the main memory.
  • first state information indicates that the latest data is held in the accelerator when the library program stored in the storage medium described in Appendix 13 is executed by the processor
  • second state information When the accelerator requests the data write back to the main memory and the completion of the data write back from the accelerator to the main memory is detected, the data processing is started.

Landscapes

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

Abstract

プロセッサとアクセラレータとを有する計算機において、プログラムの実行効率を低下させないようにするために、ライブラリ100は、処理対象のデータの属性情報を取得する属性取得手段110と、取得された属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段120と、演算装置選択手段120が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段130と、演算装置選択手段120が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段140とを備えている。

Description

アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ
 本発明は、演算装置としてプロセッサの他にアクセラレータを有する計算機のためのライブラリであって計算機の性能低下を防止するライブラリ、および計算機の性能低下を防止しうるアクセラレータに関する。
 計算機の高性能化と低消費電力を実現するために、プロセッサ(以下、CPU:Central Processing Unit という。)とハードウェアアクセラレータ(以下、アクセラレータという。)とを組み合わせる技術が採用されている(例えば、特許文献1-4参照)。アクセラレータは、例えばGPU(Graphics Processing Unit)やFPGA(Field Programmable Gate Array )である。なお、GPUの概念には、GPGPU(General Purpose computing on Graphics Processing Unit )として使用されるということも含まれる。
 以下、CPUとアクセラレータとの各々を、演算装置ということがある。
 また、特許文献5には、ソフトウェアの一部の処理をハードウェア化する方法が記載されている。さらに、ハードウェア化されたソフトウェア部分を、ハードウェア化した回路を制御するソフトウェアで置き換える方法が記載されている。
 また、特許文献6には、ソフトウェアの実行トレースを取り、最も実行時間が長い処理をハードウェアで実行する方法が記載されている。特許文献6に記載されているハードウェアは、FPGAである。
特開平4-314133号公報 特表2016-531366号公報 特表2015-524597号公報 特開2006-244382号公報 特開2003-114914号公報 特開2006-11840号公報
 複数の演算装置が存在する計算機が使用される場合に、一般に、プログラムにおいて、一律にいずれかの演算装置を使うようにしか記述できない。その結果、演算過程で行列サイズが変化するプログラムなどが実行される場合には、演算の実行効率が低下するおそれがある。
 例えば、小さい行列に関する演算がFPGAで実行される場合、CPUとFPGAの間で行列の入出力データを転送するオーバヘッドが相対的に大きくなる。よって、FPGAにオフロードする効果が低減する。大きい行列に関する演算がCPUで実行されると、FPGAによる高速化の恩恵を受けられない。よって、やはり、FPGAにオフロードする効果が低減する。
 すなわち、演算過程で行列サイズが大きくなったり小さくなったりするプログラムが実行される場合、演算装置としてCPUを使うようにプログラムを記載すると、行列サイズが大きくなった場合に、演算の実行効率が低下する。また、演算装置としてFPGAを使うようにプログラムが記述されると、行列サイズが小さくなった場合に、演算の実行効率が低下する。
 本発明は、プロセッサとアクセラレータとを有する計算機において、プログラムの実行効率を低下させないようにすることを目的とする。
 本発明によるライブラリは、アクセラレータを有する計算機のためのライブラリであって、処理対象のデータの属性情報を取得する属性取得手段と、取得された属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段と、演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段と、演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段とを備える。
 本発明によるアクセラレータは、ローカルキャッシュメモリを有し、最新データがローカルキャッシュメモリに保持されているか否かを示す第1状態情報とローカルキャッシュメモリから主メモリへのデータの書き戻しを要求するための第2状態情報とを属性情報として含む処理対象のデータに対してデータ処理を行うデータ処理手段と、第2状態情報を監視する監視手段と、第2状態情報でローカルキャッシュメモリから主メモリへのデータの書き戻しが要求された場合に、ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻す書戻手段と、処理対象のデータをローカルキャッシュメモリに格納したときに、第1状態情報を最新データがローカルキャッシュメモリに保持されていることを示す第1状態にし、ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻したときに、第1状態情報を第1状態とは異なる第2状態にする状態変更手段とを備える。
 本発明によるライブラリプログラムは、コンピュータに、処理対象のデータの属性情報を取得する処理と、取得された属性情報にもとづいて、データ処理を実行する演算装置を選択する処理と、演算装置としてプロセッサが選択された場合に、プロセッサを用いたデータ処理を開始する処理と、演算装置としてアクセラレータが選択された場合に、アクセラレータに対してデータ処理の実行を指示する処理とを実行させる。
 本発明によるコンピュータ読み取り可能な記録媒体は、アクセラレータを有する計算機のためのライブラリプログラムを格納し、ライブラリプログラムは、プロセッサによって実行されるときに、処理対象のデータの属性情報を取得し、取得された属性情報にもとづいて、データ処理を実行する演算装置を選択し、演算装置としてプロセッサが選択された場合に、プロセッサを用いたデータ処理を開始し、演算装置としてアクセラレータが選択された場合に、アクセラレータに対してデータ処理の実行を指示する。
 本発明は、プログラマが意識しなくても動的に適切な演算装置が選択されてデータ処理が実行されるので、アプリケーションプログラムの実行性能が向上する。
ライブラリが適用された計算機の第1の実施形態を示すブロック図である。 ライブラリ・ソフトウェアによる処理手順を示すフローチャートである。 プログラムの一例を示す説明図である。 プログラムの一例を示す説明図である。 ライブラリが適用された計算機の第2の実施形態を示すブロック図である。 第2の実施形態におけるライブラリ・ソフトウェアによる処理手順を示すフローチャートである。 第2の実施形態の計算機の動作を説明するためのブロック図である。 ライブラリの主要部を示すブロック図である。 他の態様のライブラリの主要部を示すブロック図である。 アクセラレータの主要部を示すブロック図である。
実施形態1.
 以下、本発明の実施形態を図面を参照して説明する。
 図1は、ライブラリが適用された計算機の第1の実施形態を示すブロック図である。図1に示す計算機10は、CPU20と、アクセラレータ30と、プログラムメモリ40と、データメモリ50とを含む。
 なお、本実施形態では、アクセラレータ30としてFPGAが使用される。しかし、アクセラレータ30として、GPUなどの他の演算機能を有する素子が使用されてもよい。以下、アクセラレータ30をFPGA30と表現することがある。
 プログラムメモリ40には、アプリケーションプログラム41と、ライブラリ・ソフトウェア42とが記憶される。プログラムメモリ40は、例えば、ROM(Read Only Memory)やフラッシュメモリなどの非一時的な不揮発性メモリである。
 ライブラリ・ソフトウェア42は、例えば、行列積など行列演算関数(GEMM:General Matrix Multiply など)を含む。アプリケーションプログラム41は、例えば、行列積を繰り返す解析プログラムを含む。データメモリ50には、処理対象のデータ(演算対象のデータ)が格納される。ここでは、処理対象のデータとして行列を例にする。
 図2は、ライブラリ・ソフトウェア42による処理手順を示すフローチャートである。図2を参照して、ライブラリ・ソフトウェア42にもとづく処理を説明する。以下、ライブラリ・ソフトウェア42によって処理が実行されるように表現するが、実際の処理の主体は、CPU20である。
 まず、ライブラリ・ソフトウェア42は、ステップS11で、処理対象のデータの属性情報を取得する。ここでは、属性として行列のサイズが用いられる。すなわち、行列の行サイズをMとし、列のサイズをNとした場合、ライブラリ・ソフトウェア42は、属性情報としてMとNとを取得する。
 次に、ライブラリ・ソフトウェア42は、ステップS12で、取得された属性情報を基に、処理を実行する演算装置を決定する。例えば、決定関数が、T>FUNC(M,N)の場合、演算装置としてCPU20を選択する。そうでない場合には、FPGA30を選択することにする。Tはしきい値である定数、FUNCはMとNとを引数とする判定関数である。判定関数として、MとNとのうちの最大値を返すmax関数や、MとNとの和を返すadd関数や、MとNとの積を返すmul関数が考えられる。しかし、それらに限られず、他の関数を用いてもよい。
 例えば、T=100、FUNC=mulとした場合、ライブラリ・ソフトウェア42は、行列の行と列とのサイズの積すなわち行列の要素数が100未満の場合にはCPU20を選択し、100以上の場合にはFPGAを選択する。
 そして、演算装置としてCPU20が選択された場合、ライブラリ・ソフトウェア42は、データ処理の開始をCPU20に指示する。その結果、CPU20を用いてデータが処理される。すなわち、CPU20で動作する行列積プログラムを用いて行列データが処理される(ステップS13,S14)。
 演算装置としてFPGA30が選択された場合、処理はFPGA30にオフロードされる。すなわち、ライブラリ・ソフトウェア42は、FPGA30にデータ処理の実行を指示する(ステップS13,S15)。例えば、ライブラリ・ソフトウェア42は、FPGA30において構成されている行列積演算回路に対して、行列データのアドレスおよび行列積の演算開始を指示するフラグを設定することによって、FPGA30に演算を開始させる。
 そして、ライブラリ・ソフトウェア42は、FPGA30のデータ処理の完了を待つ(ステップS16)。データ処理の完了を知るために、例えば、行列演算回路中に演算完了フラグが設けられ、ライブラリ・ソフトウェア42は、CPU20が演算完了フラグを確認(ポーリング)するようにしてもよい。また、行列演算回路からCPU20に、割り込みなどの手段でデータ処理の完了を通知するようにしてもよい。
 本実施形態では、属性情報、演算装置の決定関数およびしきい値を適切に設定することによって、処理対象のデータに応じて動的に適切な演算装置が選択され、選択された演算装置でデータ処理が実行される。よって、本実施形態のように構成しない場合と比較して、処理の実行性能が向上する。しきい値は、例えば、オフロードのオーバヘッドとFPGAの処理能力等にもとづいて設定される。例えば、オフロードのオーバヘッドが相対的に大きい場合には、しきい値は、大きな値に設定される。FPGAの処理能力が相対的に高い場合には、しきい値は、小さい値に設定される。
 なお、図1には、1つのアクセラレータ30が例示されているが、計算機10は、複数のアクセラレータを含んでいてもよい。さらに、種類が異なる複数のアクセラレータ(例えば、FPGAとGPGPU)を含んでいてもよい。その場合には、演算装置の決定関数を、いずれかの演算装置が選択されるように設定すればよい。
 また、本実施形態では、行列のサイズがデータの属性(属性情報)として利用されたが、属性情報は、行列のサイズに限られない。一例として、直近に利用された演算装置の情報を属性情報として、そのような属性情報を勘案して演算装置の決定関数を設定してもよい。例えば、CPU20だけでなく、FPGAなどのアクセラレータ30もキャッシュ機構を有している場合、処理対象のデータは直近に利用した演算装置内に格納されている可能性が高い。その場合、多少小さいデータであってもアクセラレータ30で実行した方がメモリアクセスのオーバヘッドが低減されるので、実行性能の向上が期待できる。
 また、本実施形態では、処理対象のデータとして行列を例にしたが、処理対象のデータは行列に限られない。処理対象のデータは、ベクトルデータなどの他の形態のデータでもよい。
 また、本実施形態では、あらかじめ設定された決定関数によって、処理の実行時に、自動的に演算装置が決定される。しかし、プログラマが、決定関数の判定によらず適切な演算装置を事前に判断できる場合には、プログラムによって演算装置が指定されるようにしてもよい。
 プログラマがどうしてもアクセラレータ30またはCPU20に処理を実行させたい場合には、一例として、プログラム中に「ヒント」が記述されるようにしてもよい。図3に示す例は、プログラム中にコメントとして記載される「プラグマ」によって、コンパイラまたはプリプロセッサに、処理を実行する演算装置が通知される例である。通知がなされた場合には、コンパイラまたはプリプロセッサは、決定関数の実行をスキップするようコードを生成する。図3に示す例では、"// pragma: use_FPGA" および"// pragma: use_CPU"が「プラグマ」に相当する。
 また、プラグマではなく、図4に示すように、関数の引数として「ヒント」が与えられるようにしてもよい。図4に示す例では、"USE_FPGA"および"USE_CPU"が「ヒント」に相当する。なお、"USE_AUTO"は、決定関数によって演算装置が決定されることが希望されることを意味する。
実施形態2.
 図5は、ライブラリが適用された計算機の第2の実施形態を示すブロック図である。
 第2の実施形態では、計算機11において、メモリアクセスのオーバヘッドの低減のためにFPGA等のアクセラレータ31に、ローカルキャッシュ(ローカルキャッシュメモリ)32が実装されている。なお、ローカルキャッシュ32は、データメモリ50と整合性(キャッシュコヒーレンシ)がないとする。
 アクセラレータ31での処理結果がローカルキャッシュ32に格納されているとする。その場合、処理結果を用いるデータ処理が、アクセラレータ31で実行されるときには、アクセラレータ31は、データメモリ50へのアクセスなしに処理を実行できる。よって、性能の向上が期待できる。
 しかし、処理結果を用いるデータ処理が、CPU20で実行される場合には、データの不整合が発生する。CPU20はデータメモリ50に保存されているデータを入力として処理を実行しようとするが、最新のデータはローカルキャッシュ32に含まれているからである。
 第2の実施形態では、そのような問題を解決するために、データの属性としてフラグAとフラグBとの2種類のフラグが追加される。フラグAは、アクセラレータ31によって更新されるフラグであり、最新のデータがアクセラレータ31のローカルキャッシュ32にあることを示す。フラグBは、CPU20が、アクセラレータ31に対して、ローカルキャッシュ32からデータメモリ50への書き戻しを要求するためのフラグである。
 第2の実施形態では、演算装置としてCPU20が選択された場合に、CPU20がデータ処理を開始する前に、フラグAが真であればフラグBを真に変更し、フラグAが偽になるまで待つ処理がライブラリ・ソフトウェア42に追加される。
 アクセラレータ31は、少なくともフラグAが真の場合、フラグBを一定間隔で監視する。そして、アクセラレータ31は、フラグBが真になると、ローカルキャッシュ32中のデータをデータメモリ50に書き戻し、フラグAを偽にする。また、データメモリ50中のデータをローカルキャッシュ32にコピーした後に内容を変更した場合には、フラグAを真にする。
 なお、アクセラレータ31が、フラグBを一定間隔で監視(ポーリング)する代わりに、CPU20によりフラグBの内容が変更されたときに、CPU20からアクセラレータ31に直接通知を行う機構を組み込むようにしてもよい。例えば、CPU20からアクセラレータ31に割り込みなどの手段で通知を行う機構が考えられる。
 また、本実施形態でも、アクセラレータ31としてFPGAが使用される。しかし、アクセラレータ31として、GPUなどの他の演算機能を有する素子が使用されてもよい。以下、アクセラレータ31をFPGA31と表現することがある。
 図6は、第2の実施形態におけるライブラリ・ソフトウェアによる処理手順を示すフローチャートである。図7は、第2の実施形態の計算機11の動作を説明するためのブロック図である。
 図7に示すように、CPU20は、関数21として、確認・待合せ処理22と演算処理23とを含む。確認・待合せ処理22と演算処理23とは、CPU20がライブラリ・ソフトウェア42に従って処理を実行することによって実現される。
 データメモリ50には、データ51が格納されるが、データ51は、演算対象になるデータ本体52と属性53とを含む。属性53には、フラグAとフラグBとが含まれている。
 FPGA31は、ローカルキャッシュメモリ(ローカルキャッシュ)32を有するが、さらに、フラグ変更回路35、監視回路36および書戻回路37を含む。フラグ変更回路35は、フラグAの値(「真」または「偽」)を変更する。監視回路36は、フラグBの値(「真」または「偽」)を監視する。書戻回路37は、所定の条件が成立すると、ローカルキャッシュ32に保持されているデータを、データメモリ50に書き戻す。
 図6および図7を参照して、第2の実施形態におけるライブラリ・ソフトウェア42にもとづく処理を説明する。
 ステップS11~S16の処理は、第1の実施形態における処理と同様である。以下、ライブラリ・ソフトウェア42によって処理が実行されるように表現するが、実際の処理の主体は、CPU20である。
 ステップS13の処理で演算装置としてCPU20が選択された場合、ライブラリ・ソフトウェア42は、確認・待合せ処理22によって、処理対象のデータに対する演算処理が実行される前にフラグAを確認する(ステップS21)。フラグAの値が偽の場合、CPU20による演算処理が開始される(ステップS14)。フラグAの値が真の場合には、ライブラリ・ソフトウェア42は、確認・待合せ処理22によって、フラグBを真に変更した上で(ステップS22)、フラグAの値が偽になるまで待つ(ステップS23)。
 FPGA31は、ローカルキャッシュ32にデータを格納した後にデータを変更したときに、フラグAの値を真にする。そして、FPGA31において、監視回路36は、フラグBを一定間隔で監視する。フラグBが真になった場合、すなわち、CPU20が処理を行う場合、FPGA31において、書戻回路37は、ローカルキャッシュ32中のデータをデータ本体52としてデータメモリ50に書き戻す。また、フラグ変更回路35は、フラグAの値を偽にする。
 ライブラリ・ソフトウェア42は、フラグAの値が偽となったことを確認したときに(ステップS23)、フラグBの値を偽に変更する(ステップS24)。そして、CPU20は、データメモリ50に格納されているデータに対して演算処理を行う(ステップS14)。
 以上に説明したように、上記の各実施形態では、処理対象(演算対象)の属性情報(例えば、データのサイズ)に応じて、CPUが処理を実行するのかFPGA等のアクセラレータが処理を実行するのかが判断され、判断結果に応じて処理を実行する演算装置が決定される。よって、処理対象のデータに対して適切な演算装置で処理が実行される。
 なお、適切な演算装置は、オフロードのオーバヘッドと演算速度(または、演算時間)とを考慮して、総合的に演算時間を短くすることができる演算装置を意味する。
 また、上記の各実施形態におけるライブラリ・ソフトウェアは、CPU等のプロセッサとFPGA等のアクセラレータを含む密結合プロセッサ上で動作するライブラリ・ソフトウェアとして好適に適用可能である。すなわち、密結合プロセッサにおいて、ライブラリ・ソフトウェアを実行する演算装置が、データサイズ等に応じて動的に切り替えられる用途に適用できる。
 図8は、ライブラリの主要部を示すブロック図である。図8に示すライブラリ100は、処理対象のデータの属性情報(一例として、行列のサイズを示す情報)を取得する属性取得手段(属性取得部)110と、取得された属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段(演算装置選択部)120と、演算装置選択手段120が演算装置としてプロセッサ(例えば、CPU)を選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段(処理開始部)130と、演算装置選択手段120が演算装置としてアクセラレータ(例えば、FPGA)を選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段(処理指示部)140とを備えている。
 図9は、他の態様のライブラリの主要部を示すブロック図である。図9に示すライブラリ100は、さらに、アクセラレータのデータ処理の完了を待つ処理完了検知手段(処理完了検知部)150を備えている。
 図10は、アクセラレータの主要部を示すブロック図である。図10に示すアクセラレータ200は、最新データがローカルキャッシュメモリ220(実施形態では、ローカルキャッシュ32)に保持されているか否かを示す第1状態情報(実施形態では、フラグA)とローカルキャッシュメモリ220から主メモリ(実施形態では、データメモリ50)へのデータの書き戻しを要求するための第2状態情報(実施形態では、フラグB)とを属性情報として含む処理対象のデータに対してデータ処理を行うデータ処理手段(データ処理部)210と、第2状態情報でローカルキャッシュメモリ220から主メモリへのデータの書き戻しが要求された場合に、ローカルキャッシュメモリ220に格納されている処理対象のデータを主メモリに書き戻す書戻手段(書戻部)230(実施形態では、書戻回路37で実現される。)と、処理対象のデータをローカルキャッシュメモリ220に格納したときに、第1状態情報を最新データがローカルキャッシュメモリに保持されていることを示す第1状態(例えば、「真」)にし、ローカルキャッシュメモリ220に格納されている処理対象のデータを主メモリに書き戻したときに、第1状態情報を第1状態とは異なる第2状態(例えば、「偽」)にする状態変更手段(状態変更部)240(実施形態では、フラグ変更回路35で実現される。)とを備えている。
 アクセラレータ200は、第2状態情報を監視する状態監視手段(状態監視部:実施形態では、監視回路36で実現される。)を備えていてもよい
 上記の実施形態の一部又は全部は以下の付記のようにも記載されうるが、本発明の構成は以下の構成に限定されない。
(付記1)アクセラレータを有する計算機のためのライブラリであって、
 処理対象のデータの属性情報を取得する属性取得手段と、
 取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段と、
 前記演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段と、
 前記演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段と
 を備えたことを特徴とするライブラリ。
(付記2)アクセラレータのデータ処理の完了を待つ処理完了検知手段をさらに備えた
 付記1記載のライブラリ。
(付記3)前記処理開始手段は、最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始する機構を含む
 付記1または付記2記載のライブラリ。
(付記4)前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
 前記データ処理を開始する機構は、最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始する
 付記3記載のライブラリ。
(付記5)ローカルキャッシュメモリを有するアクセラレータであって、
 最新データが前記ローカルキャッシュメモリに保持されているか否かを示す第1状態情報と前記ローカルキャッシュメモリから主メモリへのデータの書き戻しを要求するための第2状態情報とを属性情報として含む処理対象のデータに対してデータ処理を行うデータ処理手段と、
 前記第2状態情報で前記ローカルキャッシュメモリから主メモリへのデータの書き戻しが要求された場合に、前記ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻す書戻手段と、
 処理対象のデータを前記ローカルキャッシュメモリに格納したときに、前記第1状態情報を最新データが前記ローカルキャッシュメモリに保持されていることを示す第1状態にし、前記ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻したときに、前記第1状態情報を前記第1状態とは異なる第2状態にする状態変更手段と
 を備えたことを特徴とするアクセラレータ。
(付記6)処理対象のデータの属性情報を取得する属性取得手段と、取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段と、前記演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段と、前記演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段とを含むライブラリと、プロセッサとを備えた計算機に実装される
 付記5記載のアクセラレータ。
(付記7)アクセラレータを有する計算機のためのライブラリプログラムであって、
 コンピュータに、
 処理対象のデータの属性情報を取得する処理と、
 取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する処理と、
 演算装置としてプロセッサが選択された場合に、プロセッサを用いたデータ処理を開始する処理と、
 演算装置としてアクセラレータが選択された場合に、アクセラレータに対してデータ処理の実行を指示する処理と
 を実行させるためのライブラリプログラム。
(付記8)コンピュータに、
 アクセラレータのデータ処理の完了を待つ処理をさらに実行させるための
 付記7記載のライブラリプログラム。
(付記9)コンピュータに、
 最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始させる
 付記7または付記8記載のライブラリプログラム。
(付記10)前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
 コンピュータに、
 最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始させる
 付記9記載のライブラリプログラム。
(付記11)アクセラレータを有する計算機のためのライブラリプログラムが格納された記憶媒体であって、プロセッサによって実行されるときに、前記ライブラリプログラムは、
 処理対象のデータの属性情報を取得し、
 取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択し、
 前記演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始し、
 前記演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する。
(付記12)付記11記載の記憶媒体に格納されたライブラリプログラムは、プロセッサによって実行されるときに、アクセラレータのデータ処理の完了を待つ。
(付記13)付記11または付記12記載の記憶媒体に格納されたライブラリプログラムは、プロセッサによって実行されるときに、最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始する。
(付記14)前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
 付記13記載の記憶媒体に格納されたライブラリプログラムは、プロセッサによって実行されるときに、最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始する。
 以上、実施形態および実施例を参照して本願発明を説明したが、本願発明は上記実施形態および実施例に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
 この出願は、2017年3月28日に出願された日本特許出願2017-062114を基礎とする優先権を主張し、その開示の全てをここに取り込む。
 10,11 計算機
 20  CPU
 21  関数
 22  確認・待合せ処理
 23  演算処理
 30,31 アクセラレータ(FPGA)
 32  ローカルキャッシュ(ローカルキャッシュメモリ)
 35  フラグ変更回路
 36  監視回路
 37  書戻回路
 40  プログラムメモリ
 41  アプリケーションプログラム
 42  ライブラリ・ソフトウェア
 50  データメモリ
 51  データ
 52  データ本体
 53  属性
 100 ライブラリ
 110 属性取得手段
 120 演算装置選択手段
 130 処理開始手段
 140 処理指示手段
 150 処理完了検知手段
 200 アクセラレータ
 210 データ処理手段
 220 ローカルキャッシュメモリ
 230 書戻手段
 240 状態変更手段

Claims (14)

  1.  アクセラレータを有する計算機のためのライブラリであって、
     処理対象のデータの属性情報を取得する属性取得手段と、
     取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段と、
     前記演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段と、
     前記演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段と
     を備えたことを特徴とするライブラリ。
  2.  アクセラレータのデータ処理の完了を待つ処理完了検知手段をさらに備えた
     請求項1記載のライブラリ。
  3.  前記処理開始手段は、最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始する機構を含む
     請求項1または請求項2記載のライブラリ。
  4.  前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
     前記データ処理を開始する機構は、最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始する
     請求項3記載のライブラリ。
  5.  ローカルキャッシュメモリを有するアクセラレータであって、
     最新データが前記ローカルキャッシュメモリに保持されているか否かを示す第1状態情報と前記ローカルキャッシュメモリから主メモリへのデータの書き戻しを要求するための第2状態情報とを属性情報として含む処理対象のデータに対してデータ処理を行うデータ処理手段と、
     前記第2状態情報で前記ローカルキャッシュメモリから主メモリへのデータの書き戻しが要求された場合に、前記ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻す書戻手段と、
     処理対象のデータを前記ローカルキャッシュメモリに格納したときに、前記第1状態情報を最新データが前記ローカルキャッシュメモリに保持されていることを示す第1状態にし、前記ローカルキャッシュメモリに格納されている処理対象のデータを主メモリに書き戻したときに、前記第1状態情報を前記第1状態とは異なる第2状態にする状態変更手段と
     を備えたことを特徴とするアクセラレータ。
  6.  処理対象のデータの属性情報を取得する属性取得手段と、取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する演算装置選択手段と、前記演算装置選択手段が演算装置としてプロセッサを選択した場合に、プロセッサを用いたデータ処理を開始する処理開始手段と、前記演算装置選択手段が演算装置としてアクセラレータを選択した場合に、アクセラレータに対してデータ処理の実行を指示する処理指示手段とを含むライブラリと、プロセッサとを備えた計算機に実装される
     請求項5記載のアクセラレータ。
  7.  アクセラレータを有する計算機のためのライブラリプログラムであって、
     コンピュータに、
     処理対象のデータの属性情報を取得する処理と、
     取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択する処理と、
     演算装置としてプロセッサが選択された場合に、プロセッサを用いたデータ処理を開始する処理と、
     演算装置としてアクセラレータが選択された場合に、アクセラレータに対してデータ処理の実行を指示する処理と
     を実行させるためのライブラリプログラム。
  8.  コンピュータに、
     アクセラレータのデータ処理の完了を待つ処理をさらに実行させるための
     請求項7記載のライブラリプログラム。
  9.  コンピュータに、
     最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始させる
     請求項7または請求項8記載のライブラリプログラム。
  10.  前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
     コンピュータに、
     最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始させる
     請求項9記載のライブラリプログラム。
  11.  アクセラレータを有する計算機のためのライブラリプログラムを格納するコンピュータ読み取り可能な記録媒体であって、
     前記ライブラリプログラムは、プロセッサによって実行されるときに、
     処理対象のデータの属性情報を取得し、
     取得された前記属性情報にもとづいて、データ処理を実行する演算装置を選択し、
     演算装置としてプロセッサが選択された場合に、プロセッサを用いたデータ処理を開始し、
     演算装置としてアクセラレータが選択された場合に、アクセラレータに対してデータ処理の実行を指示する
     記録媒体。
  12.  前記ライブラリプログラムは、プロセッサによって実行されるときに、
     アクセラレータのデータ処理の完了を待つ
     請求項11記載の記録媒体。
  13.  前記ライブラリプログラムは、プロセッサによって実行されるときに、
     最新データがアクセラレータに保持されている場合には、アクセラレータから主メモリへのデータの書き戻しが完了してからデータ処理を開始する
     請求項11または請求項12記載の記録媒体。
  14.  前記属性情報は、最新データがアクセラレータに保持されているか否かを示す第1状態情報と、アクセラレータから主メモリへのデータの書き戻しを要求するための第2状態情報とを含み、
     前記ライブラリプログラムは、プロセッサによって実行されるときに、
     最新データがアクセラレータに保持されていることを第1状態情報が示しているときに、前記第2状態情報でアクセラレータから主メモリへのデータの書き戻しを要求し、アクセラレータから主メモリへのデータの書き戻しの完了を検知したらデータ処理を開始する
     請求項13記載の記録媒体。
PCT/JP2018/004146 2017-03-28 2018-02-07 アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ WO2018179873A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2017-062114 2017-03-28
JP2017062114 2017-03-28

Publications (1)

Publication Number Publication Date
WO2018179873A1 true WO2018179873A1 (ja) 2018-10-04

Family

ID=63675059

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/004146 WO2018179873A1 (ja) 2017-03-28 2018-02-07 アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ

Country Status (1)

Country Link
WO (1) WO2018179873A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785483A (zh) * 2019-11-07 2021-05-11 深南电路股份有限公司 一种数据处理加速的方法及设备
WO2021245758A1 (ja) * 2020-06-01 2021-12-09 日本電気株式会社 情報処理装置、情報処理方法およびプログラム
JP2023519305A (ja) * 2020-03-23 2023-05-10 メンティアム テクノロジーズ インコーポレイテッド ニューラルネットワーク高速化のためのデジタル-imcハイブリッドシステムアーキテクチャ
WO2023208087A1 (zh) * 2022-04-27 2023-11-02 华为技术有限公司 一种数据处理方法、装置及相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124235A (ja) * 1992-08-25 1994-05-06 Oki Electric Ind Co Ltd キャッシュ制御方式
JP2013186770A (ja) * 2012-03-09 2013-09-19 Hitachi Ltd データ処理装置
JP2014178804A (ja) * 2013-03-14 2014-09-25 Sony Corp キャッシュ制御装置、プロセッサ、情報処理システム、および、その制御方法
JP2014222473A (ja) * 2013-05-14 2014-11-27 日本電気株式会社 データ処理装置、データ処理方法、データ処理制御装置、プログラムおよび記録媒体

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06124235A (ja) * 1992-08-25 1994-05-06 Oki Electric Ind Co Ltd キャッシュ制御方式
JP2013186770A (ja) * 2012-03-09 2013-09-19 Hitachi Ltd データ処理装置
JP2014178804A (ja) * 2013-03-14 2014-09-25 Sony Corp キャッシュ制御装置、プロセッサ、情報処理システム、および、その制御方法
JP2014222473A (ja) * 2013-05-14 2014-11-27 日本電気株式会社 データ処理装置、データ処理方法、データ処理制御装置、プログラムおよび記録媒体

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785483A (zh) * 2019-11-07 2021-05-11 深南电路股份有限公司 一种数据处理加速的方法及设备
CN112785483B (zh) * 2019-11-07 2024-01-05 深南电路股份有限公司 一种数据处理加速的方法及设备
JP2023519305A (ja) * 2020-03-23 2023-05-10 メンティアム テクノロジーズ インコーポレイテッド ニューラルネットワーク高速化のためのデジタル-imcハイブリッドシステムアーキテクチャ
JP7459287B2 (ja) 2020-03-23 2024-04-01 メンティアム テクノロジーズ インコーポレイテッド ニューラルネットワーク高速化のためのデジタル-imcハイブリッドシステムアーキテクチャ
WO2021245758A1 (ja) * 2020-06-01 2021-12-09 日本電気株式会社 情報処理装置、情報処理方法およびプログラム
WO2023208087A1 (zh) * 2022-04-27 2023-11-02 华为技术有限公司 一种数据处理方法、装置及相关设备

Similar Documents

Publication Publication Date Title
WO2018179873A1 (ja) アクセラレータを有する計算機のためのライブラリ、およびアクセラレータ
Vijaykumar et al. A case for core-assisted bottleneck acceleration in GPUs: enabling flexible data compression with assist warps
JP4987882B2 (ja) スレッドに最適化されたマルチプロセッサアーキテクチャ
EP2798461B1 (en) Low latency cluster computing
KR20080104073A (ko) 처리 유닛의 동적 로드 및 언로드
US9733982B2 (en) Information processing device and method for assigning task
JP4381459B1 (ja) 情報処理装置、粒度調整方法およびプログラム
JPWO2011135759A1 (ja) 情報処理装置及びタスク切り替え方法
JP2010108086A (ja) Cpuエミュレーションシステム、cpuエミュレーション方法及びcpuエミュレーションプログラム
US20230267011A1 (en) Apparatus and method for secondary offloads in graphics processing unit
JP2009080583A (ja) 情報処理装置、並列処理最適化方法およびプログラム
US20160124852A1 (en) Memory management for graphics processing unit workloads
JP6836065B2 (ja) 情報処理装置、pld管理プログラム及びpld管理方法
US9015719B2 (en) Scheduling of tasks to be performed by a non-coherent device
US11556377B2 (en) Storage medium, task execution management device, and task execution management method
JP6488962B2 (ja) キャッシュ制御装置、キャッシュ制御方法およびキャッシュ制御プログラム
JP4631442B2 (ja) プロセッサ
US11748077B2 (en) Apparatus and method and computer program product for compiling code adapted for secondary offloads in graphics processing unit
US11327760B2 (en) Method and apparatus for balancing binary instruction burstization and chaining
JP7305052B2 (ja) 遅延量更新装置、処理システム及びプログラム
CN110879744B (zh) 利用多线程执行计算图的方法和系统
WO2020250420A1 (ja) プログラム変換装置、プログラム変換方法およびプログラム変換プログラム
CN117222982A (zh) 加速器控制系统、加速器控制方法和加速器控制程序
CN116414555A (zh) 在多核处理设备中调度缓存预算的方法和执行其的设备
Jog et al. A Case for Core-Assisted Bottleneck Acceleration in GPUs: Enabling Flexible Data Compression with Assist Warps

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18776463

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP