JP2021162924A - Memory allocation method and processing apparatus - Google Patents
Memory allocation method and processing apparatus Download PDFInfo
- Publication number
- JP2021162924A JP2021162924A JP2020061336A JP2020061336A JP2021162924A JP 2021162924 A JP2021162924 A JP 2021162924A JP 2020061336 A JP2020061336 A JP 2020061336A JP 2020061336 A JP2020061336 A JP 2020061336A JP 2021162924 A JP2021162924 A JP 2021162924A
- Authority
- JP
- Japan
- Prior art keywords
- memory
- area
- data flow
- buffer
- flow graph
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 239000000872 buffer Substances 0.000 claims abstract description 92
- 238000010586 diagram Methods 0.000 description 3
- 238000013467 fragmentation Methods 0.000 description 3
- 238000006062 fragmentation reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Memory System (AREA)
Abstract
Description
本発明は、データフローグラフを実行するためのメモリアロケーション方法及び処理装置に関する。 The present invention relates to a memory allocation method and a processing device for executing a data flow graph.
従来、データフローグラフを実行する様々な方法ないし装置が用いられている(例えば、特許文献1参照)。 Conventionally, various methods or devices for executing a data flow graph have been used (see, for example, Patent Document 1).
データフローグラフを実行する際には、ノードを実行するのに必要となるバッファをメモリ領域に割り当てるメモリアロケーションを行う必要がある。 When executing a data flow graph, it is necessary to perform memory allocation that allocates the buffer required to execute the node to the memory area.
本発明の目的は、適切なメモリアロケーションを実現可能なメモリアロケーション方法及び処理装置を提供することにある。 An object of the present invention is to provide a memory allocation method and a processing device capable of realizing appropriate memory allocation.
本発明の第1実施態様は、データフローグラフを実行するためのメモリアロケーション方法であって、前記データフローグラフの所定のステージにおいて、メモリ領域の内の所定の共用領域において一方向側から入力バッファを割り当てると共に逆方向側から出力バッファを割り当てる第1の割当ステップと、前記データフローグラフの前記所定のステージの次のステージにおいて、前記所定の共用領域において前記逆方向側から入力バッファを割り当てると共に前記一方向側から出力バッファを割り当てる第2の割当ステップと、を具備するメモリアロケーション方法である。 A first embodiment of the present invention is a memory allocation method for executing a data flow graph, in which an input buffer is input from one direction in a predetermined shared area within a memory area at a predetermined stage of the data flow graph. In the first allocation step of allocating and allocating the output buffer from the reverse direction side, and in the next stage of the predetermined stage of the data flow graph, the input buffer is allocated from the reverse direction side in the predetermined common area and the input buffer is allocated. It is a memory allocation method including a second allocation step of allocating an output buffer from the one-way side.
本発明の第2実施態様は、データフローグラフを実行するための処理装置(10)であって、メモリ領域を有するメモリ(12)と、前記データフローグラフのノードを実行し前記メモリ領域に対する入出力を実行する演算装置(14)と、前記データフローグラフの所定のステージにおいて、前記メモリ領域の内の所定の共用領域において一方向側から入力バッファを割り当てると共に逆方向側から出力バッファを割り当て、前記所定のステージの次のステージにおいて、前記所定の共用領域において前記逆方向側から入力バッファを割り当てると共に前記一方向側から出力バッファを割り当てるメモリアロケーション装置(16)と、を具備する処理装置である。 A second embodiment of the present invention is a processing device (10) for executing a data flow graph, in which a memory (12) having a memory area and a node of the data flow graph are executed and input to the memory area. In the arithmetic unit (14) that executes output and a predetermined stage of the data flow graph, an input buffer is allocated from one direction side and an output buffer is allocated from the opposite direction side in a predetermined shared area in the memory area. A processing device including a memory allocation device (16) that allocates an input buffer from the opposite direction side and an output buffer from the one direction side in the predetermined common area in the next stage of the predetermined stage. ..
本発明では、適切なメモリアロケーションを実現可能となっている。 In the present invention, it is possible to realize an appropriate memory allocation.
図1乃至図4を参照して、本発明の一実施形態を説明する。 An embodiment of the present invention will be described with reference to FIGS. 1 to 4.
図1を参照して、本実施形態の処理装置10について概説する。
図1に示されるように、処理装置10は、組み込みシステムに搭載され、データフローグラフを実行するものである。処理装置10において、メモリ12は、メモリ領域を有する。演算装置14は、データフローグラフのノードを実行し、メモリ12のメモリ領域に対する入出力を実行する。メモリアロケーション装置16は、データフローグラフの所定のステージにおいて、メモリ12のメモリ領域の内の所定の共用領域において、一方向側から入力バッファを割り当てると共に、逆方向側から出力バッファを割り当て、当該所定のステージの次のステージにおいて、共用領域の逆方向側から入力バッファを割り当てると共に、一方向側から出力バッファを割り当てる。また、メモリアロケーション装置16は、メモリ12のメモリ領域の内の所定の共通領域に、データフローグラフの全てのステージにわたって利用される共通バッファを割り当てる。
The
As shown in FIG. 1, the
図2乃至図4を参照して、本実施形態の処理方法について説明する。 The processing method of the present embodiment will be described with reference to FIGS. 2 to 4.
図2を参照して、本実施形態のデータフローグラフについて説明する。
本実施形態のデータフローグラフについては、後戻りのない順方向のデータフローグラフである。データフローグラフについては、同時に実行される各ステージに分割される。各ステージでは、入力バッファからの入力に対して、ノードが実行され、出力バッファに対して出力がなされる。
The data flow graph of the present embodiment will be described with reference to FIG.
The data flow graph of the present embodiment is a forward data flow graph with no backtracking. The data flow graph is divided into stages that are executed at the same time. At each stage, a node is executed for the input from the input buffer and output is made to the output buffer.
本実施形態では、図2に示されるように、データフローグラフは、ステージ1乃至ステージ3に分割される。ステージ1では、入力バッファb1からの入力に対して、ノードn1及びn2が夫々実行され、出力バッファb2及びb3に対して夫々出力がなされる。ステージ2では、入力バッファb2及びb3からの入力に対して、ノードn3が実行され、出力バッファb4に対して出力がなされる。ステージ3では、入力バッファb3及びb4からの入力に対して、ノードn4が実行されて、出力バッファb5に対して出力がなされる。ここで、バッファb3については、ステージ1乃至ステージ3にわたって利用される共通バッファである。
In this embodiment, as shown in FIG. 2, the data flow graph is divided into
図3及び図4を参照して、本実施形態のメモリアロケーション方法について説明する。
本実施形態のメモリアロケーション方法では、データフローグラフのグラフプログラムのコンパイル時に、データフローグラフのステージの分割と、メモリ領域におけるメモリのアロケーションとを静的に行う。
The memory allocation method of the present embodiment will be described with reference to FIGS. 3 and 4.
In the memory allocation method of the present embodiment, when the graph program of the data flow graph is compiled, the stage division of the data flow graph and the memory allocation in the memory area are statically performed.
メモリ領域の各メモリ要素にはアドレスが順次付与されており、アドレスの先頭側及び末尾側を夫々上側及び下側と称する。 Addresses are sequentially assigned to each memory element in the memory area, and the start side and the end side of the address are referred to as an upper side and a lower side, respectively.
メモリ領域において、データフローグラフのステージ毎に利用される共用領域を確保すると共に、全てのステージにわたって共通に利用される共通領域を確保する。そして、データフローグラフの所定のステージにおいて、メモリ領域の共用領域の一方向側から入力バッファを割り当てると共に、逆方向側から出力バッファを割り当て、当該所定のステージの次のステージにおいて、共用領域の逆方向側から入力バッファを割り当てると共に、一方向側から出力バッファを割り当てる。また、メモリ領域の共通領域には、全てのステージにわたって利用される共通バッファを割り当てる。 In the memory area, a common area used for each stage of the data flow graph is secured, and a common area commonly used for all stages is secured. Then, in a predetermined stage of the data flow graph, an input buffer is allocated from one direction side of the shared area of the memory area, and an output buffer is allocated from the opposite direction side. In the next stage of the predetermined stage, the reverse of the shared area is allocated. The input buffer is allocated from the directional side, and the output buffer is allocated from the unidirectional side. In addition, a common buffer used over all stages is allocated to the common area of the memory area.
ここで、メモリ領域の共用領域及び共通領域については、データフローグラフのグラフプログラムの実行中にメモリ不足の発生しないサイズが割り当てられる。即ち、共用領域に必要なサイズについては、各ステージにおいて必要となる入出力バッファの合計サイズの内の最大の合計サイズとなる。また、共通領域に必要なサイズについては、全共通バッファの合計サイズとなる。 Here, for the shared area and the common area of the memory area, a size that does not cause a memory shortage is allocated during the execution of the graph program of the data flow graph. That is, the size required for the shared area is the maximum total size of the total size of the input / output buffers required for each stage. The size required for the common area is the total size of all common buffers.
本実施形態では、図3及び図4に示されるように、データフローグラフのステージ1(S1)では、メモリ領域の共用領域Rにおいて、一方向側である上側から入力バッファb1を割り当て、逆方向側である下側から出力バッファb2を割り当てる。また、メモリ領域の共通領域Sに、出力バッファとして共通バッファb3を割り当てる。上述したとおり、データフローグラフのステージ1では、入力バッファb1からの入力に対して、ノードn1及びn2が夫々実行され、出力バッファb2及びb3に対して夫々出力がなされる。
In the present embodiment, as shown in FIGS. 3 and 4, in the stage 1 (S1) of the data flow graph, the input buffer b1 is allocated from the upper side, which is one direction side, in the shared area R of the memory area, and the input buffer b1 is allocated in the reverse direction. The output buffer b2 is allocated from the lower side, which is the side. Further, the common buffer b3 is allocated as an output buffer to the common area S of the memory area. As described above, in
ステージ2(S2)では、メモリ領域の共用領域Rにおいて、逆方向側である下側から入力バッファb2を割り当て、一方向側である上側から出力バッファb4を割り当てる。また、メモリ領域の共通領域Sに、入力バッファとして共通バッファb3を割り当てる。上述したとおり、ステージ2では、入力バッファb2及びb3からの入力に対して、ノードn3が実行され、出力バッファb4に対して出力がなされる。 In the stage 2 (S2), in the shared area R of the memory area, the input buffer b2 is allocated from the lower side on the opposite direction side, and the output buffer b4 is allocated from the upper side on the unidirectional side. Further, the common buffer b3 is allocated as an input buffer to the common area S of the memory area. As described above, in the stage 2, the node n3 is executed for the input from the input buffers b2 and b3, and the output is output to the output buffer b4.
ステージ3(S3)では、メモリ領域の共用領域Rにおいて、一方向側である上側から入力バッファb4を割り当て、逆方向側である下側から出力バッファb5を割り当てる。また、メモリ領域の共通領域Sに、入力バッファとして共通バッファb3を割り当てる。上述したとおり、ステージ3では、入力バッファb3及びb4からの入力に対して、ノードn4が実行されて、出力バッファb5に対して出力がなされる。 In the stage 3 (S3), in the shared area R of the memory area, the input buffer b4 is allocated from the upper side on the one-way side, and the output buffer b5 is assigned from the lower side on the opposite direction side. Further, the common buffer b3 is allocated as an input buffer to the common area S of the memory area. As described above, in the stage 3, the node n4 is executed for the input from the input buffers b3 and b4, and the output is output to the output buffer b5.
ここで、メモリ領域の共用領域Rに必要なサイズについては、ステージ1では、入力バッファb1と出力バッファb2との合計サイズとなり、ステージ2では、入力バッファb2と出力バッファb4との合計サイズとなり、ステージ3では、入力バッファb4と出力バッファb5との合計サイズとなる。ここでは、ステージ3の合計サイズが最大の合計サイズとなっているため、メモリ領域の共用領域Rに必要なサイズについては、ステージ3の合計サイズである入力バッファb4と出力バッファb5との合計サイズとなる。また、メモリ領域の共通領域Rに必要なサイズについては、共通バッファb3のサイズとなる。
Here, the size required for the shared area R of the memory area is the total size of the input buffer b1 and the output buffer b2 in the
本実施形態のメモリアロケーション装置及び方法は以下の効果を奏する。 The memory allocation device and method of the present embodiment have the following effects.
本実施形態では、メモリ領域において共用領域を確保し、データフローグラフの所定のステージにおいて、共用領域の一方向側から入力バッファを割り当てると共に、逆方向側から出力バッファを割り当て、当該所定のステージの次のステージにおいて、共用領域の逆方向側から入力バッファを割り当てると共に、一方向側から出力バッファを割り当てている。そして、共用領域に必要なサイズについては、各ステージにおいて必要となる入出力バッファの合計サイズの内の最大の合計サイズとなっている。 In the present embodiment, a shared area is secured in the memory area, and in a predetermined stage of the data flow graph, an input buffer is allocated from one direction side of the shared area and an output buffer is allocated from the opposite direction side. In the next stage, the input buffer is allocated from the opposite side of the common area, and the output buffer is allocated from the one-way side. The size required for the shared area is the maximum total size of the total size of the input / output buffers required for each stage.
ここで、メモリ領域をバッファとして使用するためには、当該バッファに対応した連続したメモリ領域が必要となる。そして、データフローグラフの各ノードを実行するためにバッファが必要となる度にメモリ領域を確保し、バッファが不要となる度にメモリ領域を解放するメモリアロケーション方法では、各ノードの実行において必要となるバッファのサイズが異なる場合には、バッファとして使用することが不可能な細分化されたメモリ領域が発生するメモリ領域の断片化を招来してしまう。この場合には、グラフプログラムを停止したうえで、メモリ領域を整理して断片化を解消することが必要となり、特に組み込みシステムには不適切である。また、データフローグラフの各ノードを実行するために必要となるバッファのサイズとは無関係に、常に一定のサイズのメモリ領域を確保する場合には、メモリ領域の断片化を回避することは可能となるが、メモリの利用効率が低下してしまう。 Here, in order to use the memory area as a buffer, a continuous memory area corresponding to the buffer is required. Then, in the memory allocation method in which a memory area is secured each time a buffer is needed to execute each node of the data flow graph and the memory area is released every time the buffer is no longer needed, it is necessary for the execution of each node. If the size of the buffer is different, a fragmented memory area that cannot be used as a buffer is generated, resulting in fragmentation of the memory area. In this case, it is necessary to stop the graph program and then arrange the memory area to eliminate fragmentation, which is particularly unsuitable for embedded systems. In addition, it is possible to avoid fragmentation of the memory area if a memory area of a certain size is always secured regardless of the size of the buffer required to execute each node of the data flow graph. However, the memory utilization efficiency is reduced.
これに対して、上述した本実施形態では、原理的にメモリ領域の断片化が発生しないようになっており、また、データフローグラフの各ノードを実行するために常に一定のサイズのメモリ領域を確保する場合と比較して、メモリの利用効率が高くなっている。 On the other hand, in the above-described embodiment, in principle, the memory area is not fragmented, and a memory area of a constant size is always used to execute each node of the data flow graph. Compared to the case of securing, the memory utilization efficiency is high.
また、メモリ領域の共用領域を単に半分に分割して、ステージ毎に一方向側のメモリ領域に入力バッファと出力バッファ、逆方向側のメモリ領域に出力バッファと入力バッファとを交互に割り当てていくメモリアロケーションでは、共用領域に必要なサイズについては、各ステージにおいて必要となる入力バッファの合計サイズ又は出力バッファの合計サイズの内の最大の合計サイズの2倍のサイズとなる。 In addition, the shared area of the memory area is simply divided in half, and the input buffer and the output buffer are allocated to the memory area on the one-way side and the output buffer and the input buffer are alternately allocated to the memory area on the opposite direction for each stage. In memory allocation, the size required for the shared area is twice the maximum total size of the total size of the input buffers or the total size of the output buffers required for each stage.
これに対して、上述した本実施形態では、共用領域に必要なサイズについては、各ステージにおいて必要となる入出力バッファの合計サイズの内の最大の合計サイズにすぎず、メモリの利用効率が高くなっている。 On the other hand, in the above-described embodiment, the size required for the shared area is only the maximum total size of the total size of the input / output buffers required for each stage, and the memory utilization efficiency is high. It has become.
さらに、本実施形態では、データフローグラフのグラフプログラムのコンパイル時に、データフローグラフのステージの分割と、メモリ領域におけるメモリのアロケーションとを静的に行っているため、グラフプログラムの実行中にメモリ不足が発生することがない。なお、データフローグラフのグラフプログラムの実行時に、データフローグラフのステージの分割と、メモリ領域におけるメモリのアロケーションとを動的に行うようにしてもよい。 Further, in the present embodiment, when the graph program of the data flow graph is compiled, the stages of the data flow graph are statically divided and the memory is allocated in the memory area, so that the memory is insufficient during the execution of the graph program. Does not occur. When executing the graph program of the data flow graph, the stage division of the data flow graph and the allocation of the memory in the memory area may be dynamically performed.
10…処理装置 12…メモリ 14…演算装置 16…メモリアロケーション装置
10 ...
Claims (4)
前記データフローグラフの所定のステージにおいて、メモリ領域の内の所定の共用領域において一方向側から入力バッファを割り当てると共に逆方向側から出力バッファを割り当てる第1の割当ステップと、
前記データフローグラフの前記所定のステージの次のステージにおいて、前記所定の共用領域において前記逆方向側から入力バッファを割り当てると共に前記一方向側から出力バッファを割り当てる第2の割当ステップと、
を具備するメモリアロケーション方法。 A memory allocation method for executing data flow graphs
In a predetermined stage of the data flow graph, a first allocation step of allocating an input buffer from the one-way side and allocating an output buffer from the opposite direction in a predetermined shared area in the memory area, and
In the next stage of the predetermined stage of the data flow graph, a second allocation step of allocating an input buffer from the opposite direction side and allocating an output buffer from the one direction side in the predetermined common area, and
A memory allocation method comprising.
請求項1に記載のメモリアロケーション方法。 It further comprises an additional allocation step of allocating a common buffer used across multiple stages of the data flow graph to a predetermined common area within the memory area.
The memory allocation method according to claim 1.
請求項1に記載のメモリアロケーション方法。 When compiling the graph program of the data flow graph, the stages of the data flow graph are divided and the memory is allocated in the memory area.
The memory allocation method according to claim 1.
メモリ領域を有するメモリ(12)と、
前記データフローグラフのノードを実行し前記メモリ領域に対する入出力を実行する演算装置(14)と、
前記データフローグラフの所定のステージにおいて、前記メモリ領域の内の所定の共用領域において一方向側から入力バッファを割り当てると共に逆方向側から出力バッファを割り当て、前記所定のステージの次のステージにおいて、前記所定の共用領域において前記逆方向側から入力バッファを割り当てると共に前記一方向側から出力バッファを割り当てるメモリアロケーション装置(16)と、
を具備する処理装置。
A processing device (10) for executing a data flow graph.
A memory (12) having a memory area and
An arithmetic unit (14) that executes a node of the data flow graph and executes input / output to the memory area, and
In a predetermined stage of the data flow graph, an input buffer is allocated from one direction side and an output buffer is allocated from the opposite direction side in a predetermined common area in the memory area, and in the next stage of the predetermined stage, the said A memory allocation device (16) that allocates an input buffer from the opposite direction side and an output buffer from the one direction side in a predetermined shared area.
A processing device comprising.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020061336A JP7494526B2 (en) | 2020-03-30 | 2020-03-30 | MEMORY ALLOCATION METHOD AND PROCESSING APPARATUS - Patent application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2020061336A JP7494526B2 (en) | 2020-03-30 | 2020-03-30 | MEMORY ALLOCATION METHOD AND PROCESSING APPARATUS - Patent application |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2021162924A true JP2021162924A (en) | 2021-10-11 |
JP7494526B2 JP7494526B2 (en) | 2024-06-04 |
Family
ID=78003466
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020061336A Active JP7494526B2 (en) | 2020-03-30 | 2020-03-30 | MEMORY ALLOCATION METHOD AND PROCESSING APPARATUS - Patent application |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7494526B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3901869B2 (en) | 1999-03-10 | 2007-04-04 | 株式会社リコー | Memory device |
JP4484756B2 (en) | 2004-06-21 | 2010-06-16 | 三洋電機株式会社 | Reconfigurable circuit and processing device |
JP2019207458A (en) | 2018-05-28 | 2019-12-05 | ルネサスエレクトロニクス株式会社 | Semiconductor device and memory access setting method |
-
2020
- 2020-03-30 JP JP2020061336A patent/JP7494526B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP7494526B2 (en) | 2024-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5475553B2 (en) | Method for performing calculation based on graph, computer-readable storage medium storing instructions for executing the method, and system for executing the method | |
JP2009528610A (en) | Method and apparatus for dynamically resizing cache partition based on task execution phase | |
CN105808328A (en) | Task scheduling method, device and system | |
JP5270924B2 (en) | Fixed-length memory block management apparatus and control method for fixed-length memory block management apparatus | |
JP2020119564A (en) | Method for allocating resource to multiple path neural network and layers of the same, and multiple path neural network analyzer | |
Simmendinger et al. | The GASPI API: A failure tolerant PGAS API for asynchronous dataflow on heterogeneous architectures | |
US9471387B2 (en) | Scheduling in job execution | |
US20110153971A1 (en) | Data Processing System Memory Allocation | |
CN108279976B (en) | Compiling resource scheduling method, computer and computer readable storage medium | |
US9753769B2 (en) | Apparatus and method for sharing function logic between functional units, and reconfigurable processor thereof | |
JP2017162522A (en) | Method and apparatus for allocating interrupts in multi-core system | |
JP2021162924A (en) | Memory allocation method and processing apparatus | |
JP2016071886A5 (en) | ||
JP4409568B2 (en) | Band control program and multiprocessor system | |
US9170839B2 (en) | Method for job scheduling with prediction of upcoming job combinations | |
JP5355152B2 (en) | Dynamic reconfiguration device | |
WO2020088078A1 (en) | Fpga-based data processing method, apparatus, device and medium | |
WO2020213397A1 (en) | Processor and register inheritance method | |
Andersson et al. | Partitioned aperiodic scheduling on multiprocessors | |
JP2008033838A (en) | Memory management device and memory management method | |
CN114546393A (en) | Multitask program compiling method and device and multi-core chip | |
JP2007122337A (en) | Arithmetic unit | |
KR102275871B1 (en) | A buffer management method for efficiently processing transmission and reception data and communication system | |
WO2021179333A1 (en) | Task allocation method and apparatus, and electronic device and computer-readable storage medium | |
KR101674540B1 (en) | Apparatus for resource allocation and operating method thereof, and program applied to the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230308 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20231228 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20240109 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20240201 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20240308 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20240423 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20240506 |